TradingView
RicardoSantos
11 apr 2016 13:09

Function Exponential Moving Average 

Euro Fx/U.S. DollarFXCM

Beskrivning

Function describing Exponential Moving Average.

Versionsinformation

fixed a issue were length was bypassing the overload protection.
update to V4
Kommentarer
Noldo
Hi Ricardo , Is there a mistake in the code? My thought at line 8 :

_multiplier = 2 / (_length + 1) ====> False

_multiplier = 2 / (_length_adjusted + 1) ====> True ??
RicardoSantos
@Noldo, yes there is, but isnt a breaking issue, its just bypassing the overload protection(_length_adjusted) in case there is input with value equal or below zero.
thanks for mentioning it, ill update it when i get some time.
Noldo
@RicardoSantos, no problem sir. I m working on dynamical period strategy now and only _length makes bugs :



_length_adjusted script at least not opening position so maximum drawdown is much less :



so i felt the need to share , thanks for feedback and best regards .
Noldo
EDIT : Sorry i sent wrong date : now _length adjusted :


But my script uses not rounded periods , for example : period = 100/ 13 not round(100/13) maybe this situation made bugs too . (y)
Mer