-
Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
Next time, post in the correct place. The moderators will likely move this thread there soon. - momet: i have an indicator and there is a variable "r" in that code that starts from -1 .
for (i=limit, r=Bars-i-1; i>=0; i--,r++)
It doesn't. It starts at Bars-1, the oldest bar on chart. Then you increment it and indicator breaks.
tBuffer[r][iMt1] = tBuffer[r-1][iMt1] + alpha*(price -tBuffer[r-1][iMt1]);
This r-1 is non-series indexing. Broken because r doesn't start at zero.
Your code is garbage.
MQL4 and MetaTrader 4, has it's own section on the forum. I have moved your topic to the correct section.
-
Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
Next time, post in the correct place. The moderators will likely move this thread there soon. -
It doesn't. It starts at Bars-1, the oldest bar on chart. Then you increment it and indicator breaks.
This r-1 is non-series indexing. Broken because r doesn't start at zero.
Your code is garbage.
it works properly. i also see in debugging section and see its -1. at least please help me to write the code in your way. i worked on it three days and i didnt understant something. im new in mql4. please write these some codes. Thank you
MQL4 and MetaTrader 4, has it's own section on the forum. I have moved your topic to the correct section.
ok thank you. i wasnt here for a while and didnt know that :)
Consider learning to use the more modern MQL4+ syntax and event handlers ... Updated MQL4 - Language Basics - MQL4 Reference
Thanks again Mr Carreiro
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi everyone, i have an indicator and there is a variable "r" in that code that starts from -1 . if you change it to zero, the first candle doesnt have amount. i want to know why is started "r" from -1 . i want to write this code to another language , can someone help me ? Thank you :).