
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
Does this exist in German?
From the article itself you can switch between the different available languages.
https://www.mql5.com/de/articles/10
for(int i=1;i<rates_total;i++)
{
MTMBuffer[i]=price[i]-price[i-1];
AbsMTMBuffer[i]=fabs(MTMBuffer[i]);
}
Why use [i-1] to calculate [i] and start i=1 ? no [0] ?
MTMBuffer[i]=price[i]-price[i-1];
Hello.
Broadly speaking, if you use one of the native mql5 indicator functions that starts with "i", you don't need to pay attention to the route. The copybuffer will do it for you.
On the other hand if you go through a specific dev, you have to pay attention to the number of bars, especially for the first pass because otherwise you risk an out of range
look at the code of this rsi that uses Irsi, no position for the course and everything goes well.
On the other hand, this Rsi does not go through the function.
Everything is calculated by hand, so to speak, and you have to do the positioning well so that everything goes smoothly.
why in oninit
it needs to return 0?
why in oninit
it needs to return 0?
In MQL5, the OnInit() function is called when the indicator, expert advisor (EA), or script is initialized. It is expected to return an integer value to signal the success or failure of the initialization process.
When OnInit() returns 0 , it indicates that the initialization was successful. If you need to signal that something went wrong during initialization, you can return a non-zero value, which will prevent the indicator, EA, or script from running properly.