I downloaded two indicators, one to plot the bid size, one ask size.
Unfortunately it has a few issues: (1) no historical bid/ask size couldn't be plotted. (2) The values couldn't update in real time, i.e. the values couldn't update as long as the bid/ask size changes.
The problem seems to lie on the code because it uses OnBarUpdate() which is wrong for such kinds of data. The ask size code:
protected override void OnBarUpdate() { if (Historical) return; AskSize0.Set(GetCurrentAskVolume()); } #region Properties [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove public DataSeries AskSize0 { get { return Values[0]; } } #endregion
I believe it only takes one line or two to achieve it but I have nearly zero programming knowledge. I tried to guess "the right code" for several days but failed miserably.
What should I change in order to use "OnMarketData()"?
Could anyone kindly tell me?
Thanks a lot.
Comment