Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Join our fan page
You liked the script? Try it in the MetaTrader 5 terminal
- Views:
- 4600
- Rating:
- Published:
- 2019.01.02 14:28
-
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
The Moving Average with step indicator.
It has two input parameters:
- Period - calculation period
- Step - step size
The calculation is similar to a Simple Moving Average. However, some prices are excluded from the calculations in accordance with the step size.
If parameters are set to Period = 4 and Step = 2, the calculation will be as follows:
StepMA = (Close[i] + Close[i+2] + Close[i+4] + Close[i+6]) / 4.0
If Step = 1, the indicator is identical to a simple moving average.
Moving Average with step. Period = 4, Step = 2
Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/22947