Analysis and Chart results are different

Hi all,

i am a complete AmiBroker newbie. So sorry if i am asking something what probably might be answered already. I am asking this, because i did not found an answer in this forum nor in the Knowledge Base or the AB-Help. I do hope that anyone is able to help me.

Here is the problem:

I do have this very simple AFL:

Ratio = Cum( log( C / Ref( C, -1 ) ) * 100 );
Filter = Status( "LastBarInRange" );
AddColumn( Ratio, "Ratio" );

If I understood QuickAFL right, the - if enabled - QuickAFL would lead to 31 Bars needed (30 are default and +1 for Ref(…, -1).

But i do not get different results if QuickAFL is enabled - in the analysis window - or not.

The result even does not change if i set the Range from “1 recent bars” to - for example - “500 recent bars”.

In the chart are 415 bars loaded. Here i get a result of 19.7535 for XBI
In analysis window (415 recent bars range) i do get: 36.23 for XBI
In analysis window (1 recent bars range) i do get: 36.23 for XBI

The results in analysis window are the same if i enable/disable QuickAFL for the exploration - no matter if i do it over the menu or SetBarsRequired( sbrAll );.

I hope someone is able to explaine me this behaviour.

I do now, that for this formula it is required, that the starting base for the calculation needs to be the same to get same results (same amount of bars are required).

Best,
Stefan

You have different number of bars so cumulative sum from those bars is different. Really you need to use _TRACE as advised here How do I debug my formula?

Also you really need to read this thread: QuickAFL and Analysis Window (hint: QuickAFL is applied to subsequent runs of the formula, so it is NOT used for first but to second and next symbols in Analysis run, first symbol always uses all bars, and it is only used on second and next runs of chart after “applying” indicator)