gbzenobi / CSharp-NT8-OrderFlowKit

Hi I'm Gabriel Zenobi, this is a toolkit that I developed for investment funds, banks and traders of all kinds.
191 stars 89 forks source link

Order Flow Chart on Range 30 or lower #20

Open xncv-hs opened 1 year ago

xncv-hs commented 1 year ago

These indicators are really great, thanks for creating them.

I have a problem when I add the Order Flow indicator to a Range chart, mainly of 30 or lower.

The previous orders disappear from the chart after a number of seconds, I think it's to do with a new bar being created.

NicTheMajestic commented 10 months ago

I also have this issue on tick charts

Downside 1 at 4767 Indicator 'OrderFlow': Error on calling 'OnRender' method on bar 1475: The given key was not present in the dictionary.

It is crashing on line 720 of OrderFlow.cs

In my case barIndex is 1440 but the count of barIndex is 1236.

I tried adding a sanity check

                if(!this.wyckoffBars.ContainsKey(barIndex))
                {
                    return;
                }

however nothing renders now. My guess is the bug is in the bard index calculation method or something is changing the bard index.

NicTheMajestic commented 10 months ago

This error is caused by too much data. I was able to solve this by reducing the number bars I load by reducing days loaded or making my bar size larger.