Barindex() is changed with chart zoom. How to fix it

when i plot barindex() it is changed with zooming the chart. How to make it unchanged?
It is changing with zoom out and zoom in.

forum search?

So,

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

qbi = qfdb + bi;
1 Like

Thanks for quick reply. I need volume of the first bar of the database.
i am using the code

fbarVolume = valuewhen(qfdb ==1,Volume) ;

it is not updated after some cadelbars.

Your first post does not mention any volume.
Have you read here before posting?
Why not taking time to create detailed to the point post in first place?


/// get Volume of very first data bar without deactivating QuickAFL
/// @link https://forum.amibroker.com/t/barindex-is-changed-with-chart-zoom-how-to-fix-it/12508/4
/// what is QuickAFL: http://www.amibroker.com/kb/2008/07/03/quickafl/
bi = Barindex();
qfdb = Status( "quickaflfirstdatabar" );
qbi = qfdb + bi;
quickAFL_first_vol = Ref(V, -qbi);
printf( "First DB bar's volume: %g", SelectedValue(quickAFL_first_vol) );
5 Likes

Thanks, It helps me lot

1 Like