Can i use HighestSince( EXPRESSION, ARRAY, Nth = 1 ) on realtime charts?
@dharminnaik, yes.
Obviously, the meaning/usefulness of resulting array depends on the expression and the array passed to the function.
Why did you think it is was not possible?
yes i thought... not sure so i askd... thanks
hii how about this formula....
NDays=Param("Number of Days",3,1,100,1);
Dayhi=TimeFrameGetPrice("L",inDaily,-1);
Daylo=TimeFrameGetPrice("H",inDaily,-1);
NDaysDHLAvg=0;
for(i=1;i<=NDays;i++)
{
DayH=TimeFrameGetPrice("H",inDaily,-i);
DayL=TimeFrameGetPrice("L",inDaily,-i);
NDaysDHLAvg=NDaysDHLAvg+(DayH-DayL);
}
NDaysDHLAvg=NDaysDHLAvg/NDays;
ADM= NDaysDHLAvg;
BT2 = ((Dayhi)+((0.70)(ADM)));
BT3 = ((Dayhi)+(0.90ADM));
ST2 = ((Daylo)-((0.70)(ADM)));
ST3 = ((Daylo)-(0.90ADM));
For realtime....
Every AFL function can be used in realtime. There is no difference for AmiBroker if you use it RT or not. Of course everything is subject to reasonable expectations http://www.amibroker.com/guide/x_performance.html
As to your formula it is very inefficient, because it uses TimeFrameGetPrice inside loop.
You should NOT use timeframe functions inside loops (or any other array functions for that matter) because typically the same thing can be achieved much faster without loops at all.
If you wanted to create multiple day average you should use
// no loops
TimeFrameSet( inDaily );
NDaysDHLAvg = MA( H-L, NDays ); // n-day average of H-L differences
TimeFrameRestore();
NDaysDHLAvg = TimeFrameExpand( NDaysDHLAvg , inDaily );
hello i want to scan stocks nearby 200 EMA ( nearby means percentage between moving average and price. above and below both side)..