How can i get the value of bar index for the first visible bar?

I want to get the the bar number of first visible chart , i tried to use 3 different function to achieve that goal as shown in the below code but with no success

11

X = Status("firstvisiblebar");
Y = FirstVisibleValue(BarIndex());
Z = FirstVisibleValue(Cum(1))-1; 

Plot(X,"X =",colorGreen);
Plot(Y,"Y =",colorOrange);
Plot(Z,"Z =",colorRed);

Amibroker show the bar number till 30 and then it doesn't beyond that number

Is there any reasonable explanation for why this happen ?
&
How to overcome this problem ?

What you notice is result of QuickAFL

To get actual bar(index) (if QuickAFL is applied) there is "quickaflfirstdatabar" field of Status function.

bi = Barindex();
fvbi = FirstVisibleValue( bi );
qfdb = Status( "quickaflfirstdatabar" );

fdb = qfdb + fvbi;
2 Likes

Thanks fxshrat .. this is working fine :wink: