Hi
I am trying to test the quick AFL concept in an Analysis window. It seems that in the AW my code takes into account the entire database (as if I had set SetBarsRequired(sbrAll,sbrAll); ). Whereas the same code works as expected on a chart.
So in effect, both of the following lines report the same numbers in AW:
bi (local BarIndex)
Absolute Barindex from quickaflfirstdatabar
What am I doing wrong please?
SetBarsRequired(600,0);
part_diag_filename = "bbbtest0";
bi=BarIndex();
msg="bi (local BarIndex)= "+NumToStr(bi,1.0);
printf(msg+"\n");
_MYTRACE( part_diag_filename, msg );
staticbi=StaticVarGet("AbsoluteBarindex");
msg="staticbi (static var)= "+NumToStr(staticbi,1.0);
printf(msg+"\n");
_MYTRACE( part_diag_filename, msg );
FirstBar = Status( "quickaflfirstdatabar" );
AbsBarIndex = FirstBar + bi;
msg="Absolute Barindex from quickaflfirstdatabar = "+NumToStr(AbsBarIndex,1.0);
printf(msg+"\n");
_MYTRACE( part_diag_filename, msg );
bi3 = staticbi - FirstBar;
msg="Local Barindex from static var = "+NumToStr(bi3,1.0);
printf(msg+"\n");
_MYTRACE( part_diag_filename, msg );
PS: _MYTRACE is a procedure that outputs to a text file, suitable for examining AW output.