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.
197 stars 95 forks source link

OrderFlow works with custom bar type called DeltaBarsType but disappears when the data series shifts. #5

Open Curbfeeler opened 2 years ago

Curbfeeler commented 2 years ago

First of all, thanks so much for putting this out there. This repo is SEXY! I have often wanted to do an orderflow-type of screen with a custom bar type, but knowing how much work it would be I have not done so. Thank you kind stranger for doing all this work. I am a dev with 10 years C# experience and 20 years overall, so I wanted to get this issue on the books, but I will be digging in to figure out what is happening here. Will update you as soon as I know. Looking forward to helping on this project as needed. This is so, so cool!

Curbfeeler commented 2 years ago

Just a quick update on this, I have not been able to find the culprit yet, but after debugging I got the idea to put a try/catch inside OrderFlow.OnRender() and another within renderBarClusters() and while I still do see some exceptions logged in the output, the indicator no longer disappears.

Error I was getting:

   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.SortedDictionary`2.get_Item(TKey key)
   at NinjaTrader.NinjaScript.AddOns.SightEngine.SECore`2.get_Item(K index) in c:\Users\xxx\Documents\NinjaTrader 8\bin\Custom\AddOns\SE.cs:line 248
   at NinjaTrader.NinjaScript.Indicators.WyckoffZen.OrderFlow.WyckoffOrderFlow.renderBarClusters(Int32 barIndex, Boolean realtimeCalculation) in c:\Users\xxx\Documents\NinjaTrader 8\bin\Custom\Indicators\OrderFlow.cs:line 703
   at NinjaTrader.NinjaScript.Indicators.WyckoffZen.OrderFlow.OnRender(ChartControl chartControl, ChartScale chartScale) in c:\Users\xxx\Documents\NinjaTrader 8\bin\Custom\Indicators\OrderFlow.cs:line 884
gbzenobi commented 2 years ago

Hello!, first of all thank you for using it and being interested in my project. I appreciate your time and what you can contribute.

Regarding NT8 has some instability problems with the indicators (it is not the only one that happens to me that sometimes they stop working and you have to reload them).

Regarding OrderFlow.OnRender() and renderBarClusters(), I had also tried (originally I had a try-catch) but it worsens the performance, if you can improve that or have another idea, please let me know.

AlexQT90 commented 1 year ago

As I understand, it works with all DataSeries Type.