Rejoignez notre page de fans
SMA(no loop) - indicateur pour MetaTrader 5
- Vues:
- 4247
- Note:
- Publié:
- 2022.02.13 16:00
- Mise à jour:
- 2022.02.13 16:03
- Besoin d'un robot ou d'un indicateur basé sur ce code ? Commandez-le sur Freelance Aller sur Freelance
Simple moving average is calculated by adding prices for last n periods and then dividing that sum by the period. This addition is often done with help of a loop. This loop within a loop implementation is okay for single instances but as the algorithms grow and multiple calculations need to be made, it can cost time and cause latency. Even the finest examples I have seen on code base use loop initially.
In this version, I am proposing a loop less method for calculating the Simple moving average.
Rates Version of a script https://www.mql5.com/en/code/30791
High Low LinesAdd High and Low lines based on number of previous bars defined in input field
Set Trailing Stop only when profit
Price Line 2Shows Last Price, Daily % Change, Symbol name, Countdown or Time left on closing and Time on chat