While doing some prototypes, I immediately came across several problems because I need a couple of years of weekly data to get the relevant swing highs and lows from the weekly data.
The first thing I tried was to load up all the data I need on the 3-min chart where I am deploying the indicator - however having 1000 days of 3-min bars is not very practical. It takes 12 seconds to load not only because I've got half a dozen other indicators besides this one operating on the data.
I figured I could try applying the indicator to 10 days of 3-min data, as I usually use, and then dynamically load the higher time-frame bars in the indicator. However looking at the code in the Pivots indicator which makes use of the Data.Bars.GetBars() function, I would have to process the looping for the indicator's functionality myself, because the bars from GetBars() do not launch the onBarUpdate() event.
Can I manually add the bars into the BarsArray somehow so the dynamically loaded data is processed by onBarUpdate()? It looks like coding it manually will require lots of jumping through hoops to do something simple like this:
if (High[2] >= High[0] && High[2] >= High[1] && High[2] >= High[3] && High[2] >= High[4])
Then after that problem comes another problem: the rectangles that I use to plot the S/R levels just disappear when I am scroll left from the currentBar. See this thread - a known NT7 limitation,
Instead of drawing the rectangles on the charts myself in the override Plot method, I tried normal Plots. NT7 plots the lines quite happily and they are not affected by this limitation, i.e. the lines are visible all the way to the left-hand side of the chart instead of disappearing. Obviously DrawRectangle() is not the way to go - can I get NT7 to plot rectangles instead of lines? Any examples out there?
Comment