RidgeRunner wrote:
Help me understand how to create indicators that only update once per new bar...
I want to only do those calculations a single time so I can actually check prices for a trade every few milliseconds...
RJo wrote:
I don't see how this is possible--to update once per bar, yet check prices for a trade every few milliseconds. Even on a M1 chart, you would be continually checking for new trades using a periodic indicator reading.
I would be checking continually against an array of calculated values rather than calculating the values before each check. The values I use will never change after a new bar opens and they are calculated the first time and before the next bar opens.
RidgeRunner wrote:
Also, I want to be able to run more than one instance of the EA in a 5 minute chart.
RJo wrote:
Just open duplicate charts. One EA per chart. Same magic numbers if you want inter-EA coordination.
Perhaps. However, I wonder how doing this will work if both EAs have an identical set of variables but the values of some variables are different.
RidgeRunner wrote:
Will shifting an indicator 1 bar make it not recalculate more often than one time per bar, or will it recalculate each time it's value is called?
RJo wrote:
Yes. For an example, attach the standard MA indi in MT4 and shift it by 1 applied to the Close. The reading will be static as opposed to jumping around.
The fact that the value is constant has nothing to do with whether it is being recalculated 1,000 times each minute. It only shows that the answer did not change. In fact, the example you cite the right end of the MA does jump around. It just does that one bar to the right of the current bar.