I am looking to write my own cumulative delta indicator, there were a few things that I am wondering about/having trouble with.
OnMarketData works just fine for comparing last price values with bid and ask values, but it doesn't allow for historical comparisons. For this I am using an added tick series. Do I need to add a bid and ask series as well to have accurate values? because this is untenable with my current cpu resources. Is GetAsk(barsAgo) sufficient?
Once I have successfully accumulated the ask and bid smashes, I need to plot. I found a wonderful indicator from NT Alan that demonstrates rendering candlestick charts with non price series data, and I was planning on using this for my cumulative delta. But one thing I was having an issue with was high and low. Open[0] would be Value[1] and Close[0] would be Value[0], so High[0] and Low[0] would have to be MAX and MIN from the current tick to the start of the candle. I tried this with the MAX and MIN indicator and it would not work. Am I taking the wrong approach?
Finally, there are a few other things I am looking to develop using the bid and ask. As a start I would just like to ask how I can use OnMarketData in the manner described at the beginning of this post (comparing e.Last/e.Price with e.Ask and e.Bid), but filtered by time such that I am only accumulating buys and sells say, in the last 5 seconds of a 1min candle. Can I reference bar time within the OnMarketData method directly?
Thank you for any code examples and guidance you may be able to offer.

Comment