Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 562
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
What's the right way? That's why I'm asking. I don't really know how to count indicators.
I'm going to guess:
should it be like this?
I don't know here at all.
If in general, it's enough for me to have the indicator calculated on the last 100 bars.Then do it like this.
Then make it like this
How do we get the variables?
Ahh... I hadn't noticed you were using the old format...
rates_total is Bars.
prev_calculated is IndicatorCounted()
Text probably not, but label please
docs.mql4.com/en/constants/objectconstants/enum_object_property
Properties OBJPROP_XSIZE and OBJPROP_YSIZE
The label does not follow the schedule...
Ahh... I hadn't noticed you were using the old format...
rates_total is Bars
prev_calculated is IndicatorCounted()
I'd rather deal with the old one) Although I've done a few EAs on 5.
But if you're writing in the old one, this construction won't work. The old one has no conditional operator expression1? expression2: expression3.
But if you write in the new one, but use the old int start() instead of the new int OnCalculate(... you'll be fine.
The label does not follow the graphic...
But if you're writing in the old one, this construction won't work. The old one has no conditional operator expression1? expression2: expression3.
But if you write in the new one, but use the old int start() instead of the new int OnCalculate(... everything will be fine.
I'm doing it in 610 build, but it's the old one. Then I'll learn with int OnCalculate, I'm getting too much code in it.
Made the code as follows:
There are no trades in the EA, at around 1500 one appears and that's it. At 200 the indicator counts correctly. Somehow with a small number of bars it is possible to get the EA to open trades.Doing in 610 build, but the old one. Then I'll learn with int OnCalculate, I'm getting too much code in it.
Made the code as follows:
The Expert Advisor has no trades, somewhere around 1500 one appears and that's it. At 200 the indicator counts correctly. Somehow with a small number of bars you can get the EA to open trades.Well then you need to figure out what you want to write EA or indicator first...
Maybe I missed something, but my understanding is that it will be indicator...
Well, then you need to figure out what you want to write first, an EA or an indicator...
Maybe I missed something, but my understanding is that it will be an indicator...
I already have an indicator. EA too, but I am not satisfied with the speed of optimization.
I have changed some strings and it seems the speed has become better. I do not know if it is correct?
I have replaced Bars inside the conditional operator with limit1.
If I understand correctly
and then we subtract the period and calculate the rest of the variables.
One thing I don't understand, if Bars is the number of bars in the window, we subtract uncounted bars from it.
The more uncounted ones we have, the less the number we get after subtraction and thus the less iterations in the loop.
But it is vice versa. So, IndicatorCounted(), simply put, is how many bars older than the first?
The original code is on p. 560. Only without these lines: