I am comparing the data from the indicator coming out from the VOL indicator and my indicator and it seems that my indicator will occasionally come out with false bid/ask volume. If we hit F5, we will get back the accurate volume according to the VOL indicator.
My initialize code:
Add(Instrument.FullName, BarsPeriod.Id, BarsPeriod.Value,MarketDataType.Bid);
Add(Instrument.FullName, BarsPeriod.Id, BarsPeriod.Value,MarketDataType.Ask);
These are the codes I have tried:
Values[1].Set(Volumes[1][0]);
Values[0].Set(Volumes[2][0]);
Values[1].Set(VOL(BarsArray[1])[0]);
Values[0].Set(VOL(BarsArray[2])[0]);
PlotBid.Set(GetCurrentBidVolume());
PlotAsk.Set(GetCurrentAskVolume());
GetCurrentAskVolume and GetCurrentBidVolume seems to throw some bogus value that does not fit the VOL data plotted on the Ask Prices. Would this be a Time and Sales data instead?
As you can see from the screenshot, both VOL and Volumes throw the same figure and do not correspond to the VOL indicator, however, the non-refreshed data are all correct. I'm using Zenfire btw.
Comment