ninjatrader-freeorderflow
ninjatrader-freeorderflow copied to clipboard
Sometimes draws incorrect POC
For the "Bars" period, the indicator will sometimes incorrectLy render the POC value. It will draw a line on a volume row that is not the maximum volume in the profile. I have attached image links to the $MNQ 15 minute chart for the trading day Feb 21 at 10:15 AM, EST. You can see the first image has a candle with volume profile and POC in the lower wick (yellow) which is representative of this indicator. The second image link is using the OrderFlow suite volume profile indicator provided by NinjaScript and the POC is within the body (pink/purple color). When I implement a custom indicator that simply calculates the POC, it also aligns with the OrderFlow suite indicator POC value. Are you able to replicate this issue on your end and if so, do you have any suggestions as to why it is doing this?
Check that the Resolution parameter of OrderFlow Volume Profile is set to Tick. If not, change the compare again.
Check that the Resolution parameter of OrderFlow Volume Profile is set to Tick. If not, change the compare again.
The resolution parameter has been set to Tick. I'm not sure what you mean by change the compare again but I've tried comparing the two indicators multiple times and I get the same results each time. Both the built-in volume profile from the OrderFlow suite and this one are set to tick and bars. I recreated a similar indicator utilizing barVolume with key, value pairs for volume and price and was able to recreate the accurate POC per bar. (Although Idt I've sorted out which volume/price to use in a tie). I have tried combing over the calculation in the Investsoft indicator script to see if there is a reason why the summation for bar POC would be incorrect but have not figured it out. This is the segment I'm assuming is faulty.
public FofVolumeProfileRow UpdateRow(double price, long buyVolume, long sellVolume, long otherVolume) { var row = AddOrUpdate( price, (double key) => new FofVolumeProfileRow() { buy = buyVolume, sell = sellVolume, other = otherVolume }, (double key, FofVolumeProfileRow oldValue) => new FofVolumeProfileRow() { buy = buyVolume + oldValue.buy, sell = sellVolume + oldValue.sell, other = otherVolume + oldValue.other } ); // caculate POC if (row.total > MaxVolume) { MaxVolume = row.total; POC = price; } // calculate total volume for use in VAL and VAH TotalVolume += (buyVolume + sellVolume + otherVolume); return row; }
At first I was wondering if perhaps the code was accidentally taking in some volume from the first tick of the next bar but I tried editing that and it didn't seem to work, although I could've done it incorrectly as I am a novice/beginner coder.
I have had similar issue where reloading ninjascript fixed the position of POC.