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
Changed to this
Seems to be working.your arrays are not serialized.
that's why it's this.
Buffer[i+1]=Buffer[i]+delta;
peeking into the future
It doesn't recalculate 0 bar - for the same reason - your start - it doesn't start with 0.
your arrays are not serialized.
so that's why it's this.
peeking into the future.
It doesn't recalculate 0 bar for the same reason you don't start with 0.
My 0 bar is not calculated according to the formula.
And then based on the price movement, the indicator will catch up with the trend
For example if the price has moved away from the indicator and will not move, then duringthe "period" of candle indicator will catch up the price, this is a kind of alternative to MA for me
lazarev-d-m:
it's kind of an alternative to MA for me
My first indicator. I want to scale the symbol from 0 to 100. Am I doing it right? And how to make the current bar not to recalculate (in the tester it jerks, but not on the chart)
Memorise the opening time of the current bar and compare it with the same value of the incoming tick. Only recalculate the value of the current bar when the values do not match.
I would put this in the initialization block:
and the variables would be declared at the global level of the program:
Memorise the opening time of the current bar and compare it with the same value of the incoming tick. Only recalculate the value of the current bar when the values do not match.
I would put this in the initialisation block:
I haven't noticed anything else. The articles suggest a similar structure. There is a check for division by zero.
Yes, to avoid recalculating, you can also compare prev_calculated and rates_total, as far as I remember.
I haven't noticed anything else. The articles suggest a similar structure. There is a check for division by zero.
Yes, to avoid recalculating, you can also compare prev_calculated and rates_total, as far as I remember.
The terminal needs some time to "get up", synchronise its databases with the server, etc. when starting up. If the indicator is launched at the same time, there may be no data for the indicator calculation. Try the easiest solution: to insert a delay of two or three seconds into OnInit().
In general, it is desirable to print all important information when searching for a problem area. Like
Yedelkin:
I haven't found any help for live trading yet - just try opening and closing a position in a demo account.
Here it is: https://www.mql5.com/ru/forum/6343/page96#comment_419028