I'm trying to use MA to trigger alerts when the price is inside two custom indicator lines. Math of the two indicator seems heavy for CPU because it cannot calculate them successfully in real time with every tick incoming. It only gives the true value when setting them to calculate on bar close.
The trick I have been using to overcome this problem is to program an indicator that gives 1 when the condition is met (price between two lines) but using the previous bar value of indicator lines to avoid calculating them in real time. But a new problem arise, this indicator need to be reloaded after each bar closes. With an indicator based in 60 minutes bars is manageable, but with an indicator based in 5 minutes bars is a headache.
What can I do?
Sergio
Comment