Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

ALMA moving average ? Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
kram
Posted : Wednesday, January 17, 2018 11:45:10 AM
Registered User
Joined: 10/7/2004
Posts: 80

does anyone have the formula for the ALMA moving average?  

links that may assist.  thank you

 

https://www.prorealcode.com/prorealtime-indicators/alma-arnaud-legoux-moving-average/

https://tradingsim.com/blog/5-strategies-day-trading-arnaud-legoux-moving-average/

Bruce_L
Posted : Wednesday, January 17, 2018 12:30:34 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I cannot think of a way to create a generalized version of this. That said, specific versions could be created for specific settings and there is a pattern for how this could be done.

I tried to follow the code exactly, but I may be missing something about the math, because the results seem "faster" than the examples with the same settings (more weight seems to be placed on recent values than in the examples).

Window: 9
Sigma: 6
Offset: 0.85

(EXP(-((0-(0.85-(9-1)))*(0-(0.85-(9-1))))/(2*(9/6)*(9/6))) * C0 + EXP(-((1-(0.85-(9-1)))*(1-(0.85-(9-1))))/(2*(9/6)*(9/6))) * C1 + EXP(-((2-(0.85-(9-1)))*(2-(0.85-(9-1))))/(2*(9/6)*(9/6))) * C2 + EXP(-((3-(0.85-(9-1)))*(3-(0.85-(9-1))))/(2*(9/6)*(9/6))) * C3 + EXP(-((4-(0.85-(9-1)))*(4-(0.85-(9-1))))/(2*(9/6)*(9/6))) * C4 + EXP(-((5-(0.85-(9-1)))*(5-(0.85-(9-1))))/(2*(9/6)*(9/6))) * C5 + EXP(-((6-(0.85-(9-1)))*(6-(0.85-(9-1))))/(2*(9/6)*(9/6))) * C6 + EXP(-((7-(0.85-(9-1)))*(7-(0.85-(9-1))))/(2*(9/6)*(9/6))) * C7 + EXP(-((8-(0.85-(9-1)))*(8-(0.85-(9-1))))/(2*(9/6)*(9/6))) * C8) / (EXP(-((0-(0.85-(9-1)))*(0-(0.85-(9-1))))/(2*(9/6)*(9/6))) + EXP(-((1-(0.85-(9-1)))*(1-(0.85-(9-1))))/(2*(9/6)*(9/6))) + EXP(-((2-(0.85-(9-1)))*(2-(0.85-(9-1))))/(2*(9/6)*(9/6))) + EXP(-((3-(0.85-(9-1)))*(3-(0.85-(9-1))))/(2*(9/6)*(9/6))) + EXP(-((4-(0.85-(9-1)))*(4-(0.85-(9-1))))/(2*(9/6)*(9/6))) + EXP(-((5-(0.85-(9-1)))*(5-(0.85-(9-1))))/(2*(9/6)*(9/6))) + EXP(-((6-(0.85-(9-1)))*(6-(0.85-(9-1))))/(2*(9/6)*(9/6))) + EXP(-((7-(0.85-(9-1)))*(7-(0.85-(9-1))))/(2*(9/6)*(9/6))) + EXP(-((8-(0.85-(9-1)))*(8-(0.85-(9-1))))/(2*(9/6)*(9/6))))

Window: 20
Sigma: 1
Offset: 0.2

(EXP(-((0-(0.2-(20-1)))*(0-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C0 + EXP(-((1-(0.2-(20-1)))*(1-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C1 + EXP(-((2-(0.2-(20-1)))*(2-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C2 + EXP(-((3-(0.2-(20-1)))*(3-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C3 + EXP(-((4-(0.2-(20-1)))*(4-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C4 + EXP(-((5-(0.2-(20-1)))*(5-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C5 + EXP(-((6-(0.2-(20-1)))*(6-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C6 + EXP(-((7-(0.2-(20-1)))*(7-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C7 + EXP(-((8-(0.2-(20-1)))*(8-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C8 + EXP(-((9-(0.2-(20-1)))*(9-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C9 + EXP(-((10-(0.2-(20-1)))*(10-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C10 + EXP(-((11-(0.2-(20-1)))*(11-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C11 + EXP(-((12-(0.2-(20-1)))*(12-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C12 + EXP(-((13-(0.2-(20-1)))*(13-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C13 + EXP(-((14-(0.2-(20-1)))*(14-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C14 + EXP(-((15-(0.2-(20-1)))*(15-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C15 + EXP(-((16-(0.2-(20-1)))*(16-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C16 + EXP(-((17-(0.2-(20-1)))*(17-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C17 + EXP(-((18-(0.2-(20-1)))*(18-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C18 + EXP(-((19-(0.2-(20-1)))*(19-(0.2-(20-1))))/(2*(20/1)*(20/1))) * C19) / (EXP(-((0-(0.2-(20-1)))*(0-(0.2-(20-1))))/(2*(20/1)*(20/1))) + EXP(-((1-(0.2-(20-1)))*(1-(0.2-(20-1))))/(2*(20/1)*(20/1))) + EXP(-((2-(0.2-(20-1)))*(2-(0.2-(20-1))))/(2*(20/1)*(20/1))) + EXP(-((3-(0.2-(20-1)))*(3-(0.2-(20-1))))/(2*(20/1)*(20/1))) + EXP(-((4-(0.2-(20-1)))*(4-(0.2-(20-1))))/(2*(20/1)*(20/1))) + EXP(-((5-(0.2-(20-1)))*(5-(0.2-(20-1))))/(2*(20/1)*(20/1))) + EXP(-((6-(0.2-(20-1)))*(6-(0.2-(20-1))))/(2*(20/1)*(20/1))) + EXP(-((7-(0.2-(20-1)))*(7-(0.2-(20-1))))/(2*(20/1)*(20/1))) + EXP(-((8-(0.2-(20-1)))*(8-(0.2-(20-1))))/(2*(20/1)*(20/1))) + EXP(-((9-(0.2-(20-1)))*(9-(0.2-(20-1))))/(2*(20/1)*(20/1))) + EXP(-((10-(0.2-(20-1)))*(10-(0.2-(20-1))))/(2*(20/1)*(20/1))) + EXP(-((11-(0.2-(20-1)))*(11-(0.2-(20-1))))/(2*(20/1)*(20/1))) + EXP(-((12-(0.2-(20-1)))*(12-(0.2-(20-1))))/(2*(20/1)*(20/1))) + EXP(-((13-(0.2-(20-1)))*(13-(0.2-(20-1))))/(2*(20/1)*(20/1))) + EXP(-((14-(0.2-(20-1)))*(14-(0.2-(20-1))))/(2*(20/1)*(20/1))) + EXP(-((15-(0.2-(20-1)))*(15-(0.2-(20-1))))/(2*(20/1)*(20/1))) + EXP(-((16-(0.2-(20-1)))*(16-(0.2-(20-1))))/(2*(20/1)*(20/1))) + EXP(-((17-(0.2-(20-1)))*(17-(0.2-(20-1))))/(2*(20/1)*(20/1))) + EXP(-((18-(0.2-(20-1)))*(18-(0.2-(20-1))))/(2*(20/1)*(20/1))) + EXP(-((19-(0.2-(20-1)))*(19-(0.2-(20-1))))/(2*(20/1)*(20/1))))

Window: 50
Sigma: 6
Offset: 0.85

(EXP(-((0-(0.85-(50-1)))*(0-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C0 + EXP(-((1-(0.85-(50-1)))*(1-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C1 + EXP(-((2-(0.85-(50-1)))*(2-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C2 + EXP(-((3-(0.85-(50-1)))*(3-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C3 + EXP(-((4-(0.85-(50-1)))*(4-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C4 + EXP(-((5-(0.85-(50-1)))*(5-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C5 + EXP(-((6-(0.85-(50-1)))*(6-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C6 + EXP(-((7-(0.85-(50-1)))*(7-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C7 + EXP(-((8-(0.85-(50-1)))*(8-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C8 + EXP(-((9-(0.85-(50-1)))*(9-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C9 + EXP(-((10-(0.85-(50-1)))*(10-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C10 + EXP(-((11-(0.85-(50-1)))*(11-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C11 + EXP(-((12-(0.85-(50-1)))*(12-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C12 + EXP(-((13-(0.85-(50-1)))*(13-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C13 + EXP(-((14-(0.85-(50-1)))*(14-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C14 + EXP(-((15-(0.85-(50-1)))*(15-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C15 + EXP(-((16-(0.85-(50-1)))*(16-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C16 + EXP(-((17-(0.85-(50-1)))*(17-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C17 + EXP(-((18-(0.85-(50-1)))*(18-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C18 + EXP(-((19-(0.85-(50-1)))*(19-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C19 + EXP(-((20-(0.85-(50-1)))*(20-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C20 + EXP(-((21-(0.85-(50-1)))*(21-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C21 + EXP(-((22-(0.85-(50-1)))*(22-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C22 + EXP(-((23-(0.85-(50-1)))*(23-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C23 + EXP(-((24-(0.85-(50-1)))*(24-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C24 + EXP(-((25-(0.85-(50-1)))*(25-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C25 + EXP(-((26-(0.85-(50-1)))*(26-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C26 + EXP(-((27-(0.85-(50-1)))*(27-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C27 + EXP(-((28-(0.85-(50-1)))*(28-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C28 + EXP(-((29-(0.85-(50-1)))*(29-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C29 + EXP(-((30-(0.85-(50-1)))*(30-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C30 + EXP(-((31-(0.85-(50-1)))*(31-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C31 + EXP(-((32-(0.85-(50-1)))*(32-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C32 + EXP(-((33-(0.85-(50-1)))*(33-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C33 + EXP(-((34-(0.85-(50-1)))*(34-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C34 + EXP(-((35-(0.85-(50-1)))*(35-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C35 + EXP(-((36-(0.85-(50-1)))*(36-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C36 + EXP(-((37-(0.85-(50-1)))*(37-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C37 + EXP(-((38-(0.85-(50-1)))*(38-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C38 + EXP(-((39-(0.85-(50-1)))*(39-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C39 + EXP(-((40-(0.85-(50-1)))*(40-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C40 + EXP(-((41-(0.85-(50-1)))*(41-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C41 + EXP(-((42-(0.85-(50-1)))*(42-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C42 + EXP(-((43-(0.85-(50-1)))*(43-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C43 + EXP(-((44-(0.85-(50-1)))*(44-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C44 + EXP(-((45-(0.85-(50-1)))*(45-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C45 + EXP(-((46-(0.85-(50-1)))*(46-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C46 + EXP(-((47-(0.85-(50-1)))*(47-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C47 + EXP(-((48-(0.85-(50-1)))*(48-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C48 + EXP(-((49-(0.85-(50-1)))*(49-(0.85-(50-1))))/(2*(50/6)*(50/6))) * C49) / (EXP(-((0-(0.85-(50-1)))*(0-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((1-(0.85-(50-1)))*(1-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((2-(0.85-(50-1)))*(2-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((3-(0.85-(50-1)))*(3-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((4-(0.85-(50-1)))*(4-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((5-(0.85-(50-1)))*(5-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((6-(0.85-(50-1)))*(6-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((7-(0.85-(50-1)))*(7-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((8-(0.85-(50-1)))*(8-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((9-(0.85-(50-1)))*(9-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((10-(0.85-(50-1)))*(10-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((11-(0.85-(50-1)))*(11-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((12-(0.85-(50-1)))*(12-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((13-(0.85-(50-1)))*(13-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((14-(0.85-(50-1)))*(14-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((15-(0.85-(50-1)))*(15-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((16-(0.85-(50-1)))*(16-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((17-(0.85-(50-1)))*(17-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((18-(0.85-(50-1)))*(18-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((19-(0.85-(50-1)))*(19-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((20-(0.85-(50-1)))*(20-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((21-(0.85-(50-1)))*(21-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((22-(0.85-(50-1)))*(22-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((23-(0.85-(50-1)))*(23-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((24-(0.85-(50-1)))*(24-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((25-(0.85-(50-1)))*(25-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((26-(0.85-(50-1)))*(26-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((27-(0.85-(50-1)))*(27-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((28-(0.85-(50-1)))*(28-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((29-(0.85-(50-1)))*(29-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((30-(0.85-(50-1)))*(30-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((31-(0.85-(50-1)))*(31-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((32-(0.85-(50-1)))*(32-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((33-(0.85-(50-1)))*(33-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((34-(0.85-(50-1)))*(34-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((35-(0.85-(50-1)))*(35-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((36-(0.85-(50-1)))*(36-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((37-(0.85-(50-1)))*(37-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((38-(0.85-(50-1)))*(38-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((39-(0.85-(50-1)))*(39-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((40-(0.85-(50-1)))*(40-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((41-(0.85-(50-1)))*(41-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((42-(0.85-(50-1)))*(42-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((43-(0.85-(50-1)))*(43-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((44-(0.85-(50-1)))*(44-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((45-(0.85-(50-1)))*(45-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((46-(0.85-(50-1)))*(46-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((47-(0.85-(50-1)))*(47-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((48-(0.85-(50-1)))*(48-(0.85-(50-1))))/(2*(50/6)*(50/6))) + EXP(-((49-(0.85-(50-1)))*(49-(0.85-(50-1))))/(2*(50/6)*(50/6))))



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
kram
Posted : Wednesday, January 17, 2018 4:15:40 PM
Registered User
Joined: 10/7/2004
Posts: 80

i appreciate the work and will look forward to using it.  thank you

Bruce_L
Posted : Wednesday, January 17, 2018 4:16:54 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You're welcome.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.