i’m looking for the smoothed moving average (SMMA) code but i can’t find it,
i tried to figure out how to calculate it in excel and then bring it into probuilder language
but for now i haven’t had good results, can someone help me?,
thanks
thanks roberto,
but when I import the file it tells me that it has already been used before
and that it is impossible to use it again, honestly I don’t think I’ve ever used it, however, can you have a new one?
It’s not protected, you must have done something wrong.
This is the code:
Period = 20
Series = CustomClose
IF BarIndex = 0 THEN
AFR = Series
ELSE
AFR = AFR[1] + (Series - AFR[1]) / Period
ENDIF
RETURN AFR AS "SMMA Smoothed Moving Average"
Hi ! Would you mind to tell me how to calculate this one a different way. Meaning for example : (with x periods) set the MA to high or low and shift it x bar over.
Thanks a lot !
To illustrate, the way we can do it here :
You can select data sources (series) other than CLOSE with the properties (you can choose HIGH, LOW, OPEN, TYPICAL PRICE, etc…) owing to the keyword CUSTOMCLOSE.
As to shift (using past values to be plotted now) you can easily add a SHIFT variable:
Period = 20 //20 periods
Shift = 2 //shift the average 2 bars (cannot be < 0)
Series = CustomClose //this will let you choose any other data source
IF BarIndex < (Period + Shift) THEN
AFR = Series
ELSE
AFR = AFR[1] + (Series - AFR[1]) / Period
ENDIF
RETURN AFR[Shift] AS "SMMA Smoothed Moving Average"
To shift it the other way round read https://www.prorealcode.com/topic/medie-mobili-e-cicli-di-borsa/#post-169506