Disliked{quote} I have checked the value of envelopes[CURR][MODE_MAIN] during the backtesting process and 0 (zero) is a valid value which comes during the test, and non zero values comes also ... MODE_MAIN have not any significance for the iEnvelopes indicator, and only MODE_UPPER and MODE_LOWER are used ... Source: https://www.mql5.com/en/articles/1496 Also, MQLQ4 Reference from MetaEditor mode [in] Indicator line index. It can be any of Indicators line identifiers enumeration value (0 - MODE_MAIN, 1 - MODE_UPPER, 2 - MODE_LOWER). MODE_MAIN...Ignored
Result of printing MODE_LOWER/MODE_MAIN/MODE_UPPER (for M15, and same for M30):
2016.01.05 01:00 TestEnvelopes EURUSD,M15: Envelopes M1 : 1.08147/1.08255/1.08363 => CORRECT
2016.01.05 01:00 TestEnvelopes EURUSD,M15: Envelopes M5 : 1.08168/1.08277/1.08385 => CORRECT
2016.01.05 01:00 TestEnvelopes EURUSD,M15: Envelopes M15 : 1.08184/1.08292/1.084 => CORRECT
2016.01.05 01:00 TestEnvelopes EURUSD,M15: Envelopes M30 : 1.08109/1.08217/1.08325 => CORRECT
2016.01.05 01:00 TestEnvelopes EURUSD,M15: Envelopes M60 : 1.08485/1.08594/1.08702 => CORRECT