I wrote a custom indicator and it works fine. I want to implement automatic placing of orders through EA calls, but I always cannot get the correct indicator value.
When debugging the strategy, the values obtained were not what I expected.
In the data window, you can see the two output items of the custom indicator, but the values are empty.
I checked other posts with the same problem and it seems to be a for loop problem.
But how should it be modified?
There is a value INT_MAX = Maximal value, which can be represented by int type = 2147483647 = EMPTY_VALUE
Try to reason and learn.
bars=rates_total-prev_calculated; } if(bars<=count) return(0);
-
After the first run (where prev_calculated is zero), bars will be zero and the code doesn't do anything.
Do your lookbacks correctly #9 — #14 & #19. (2016)
-
No need for the (slow) sort. Just find the min/max (faster).
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I wrote a custom indicator and it works fine. I want to implement automatic placing of orders through EA calls, but I always cannot get the correct indicator value.
When debugging the strategy, the values obtained were not what I expected.
In the data window, you can see the two output items of the custom indicator, but the values are empty.
I checked other posts with the same problem and it seems to be a for loop problem.
But how should it be modified?