Hi I'm trying to create an ami exporation AFl which will scan stock for "intraday fall from high" and "intraday recovery from low". The section is supposed to scan for % change and provide net % change value with color. Its showing no value instead. Would be grateful if I could find some help here.
Code:
_SECTION_BEGIN("Formula2");
DOpen = TimeFrameGetPrice( "O", inDaily, 0 ); // gives you Todays Open price.
DHigh = TimeFrameGetPrice( "H", inDaily, 0 ); // gives you Todays High price.
DLow = TimeFrameGetPrice( "L", inDaily, 0 ); // gives you Todays High price.
DLast = TimeFrameGetPrice( "C", inDaily, 0); //
if ("DLast" == "DHigh")
mod = ((Dlast - Dlow)/Dlow*100);
else if ("DLast" == "DLow")
mod = ((Dlow - DHigh)/Dhigh*100);
Net = Param("mod",null,0,100);
Filter = Buy OR Sell ;
colorstatus = IIf( DLast == DHigh,colorGreen,IIf( DLast == DLow,colorRed,Null));
AddColumn(Net, "NET",1.2 );
shape = Buy*shapeUpArrow + Sell*shapeDownArrow;
PlotShapes(shape, IIf( Buy, colorLime, colorRed),0,IIf( Buy, low, high) );
_SECTION_END();