smoothed moving average in MS

Questions about MultiCharts and user contributed studies.
JoshD
Posts: 8
Joined: 24 Feb 2022
Has thanked: 1 time

smoothed moving average in MS

Postby JoshD » 12 Nov 2022

Good day,

I would like to use a smoothed moving average (SMMA) in MS. Is there already a function or indicator for this?

I found the following, but I am not sure if it is correct:

Function & Indicator:

Code: Select all

//Function: inputs: Price( numericseries ), Length( numericsimple ) ; { this input should be a constant >= 1 } Vars: SmoothingFactor( 1 / Length ), SMMA(0); If Currentbar = 1 then SMMA = Price else SMMA = SMMA[1] + SmoothingFactor * ( Price - SMMA[1] ) ; //Indicator: inputs: Price(Close), Length(13) ; vars: SmoothingFactor( 1 / Length ), SMMA( Price ); SMMA= SMMA[1] + SmoothingFactor * ( Price - SMMA[1] ) ; Plot1( SMMA, "SMMA", White ) ;[code] Thanks a lot!
Last edited by JoshD on 13 Nov 2022, edited 3 times in total.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: smoothed moving average in MS

Postby TJ » 12 Nov 2022

See posts #1 & #2
viewtopic.php?t=11713

JoshD
Posts: 8
Joined: 24 Feb 2022
Has thanked: 1 time

Re: smoothed moving average in MS

Postby JoshD » 13 Nov 2022

Sorry I didn't know I should adjust the post accordingly. I hope now it fits.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: smoothed moving average in MS

Postby TJ » 13 Nov 2022

Sorry I didn't know I should adjust the post accordingly. I hope now it fits.
You have 2 codes there. One is a function, the other is the indicator.


//Function:

Code: Select all

inputs: //Function: Price( numericseries ), Length( numericsimple ) ; { this input should be a constant >= 1 } Vars: SmoothingFactor( 1 / Length ), SMMA(0); If Currentbar = 1 then SMMA = Price else SMMA = SMMA[1] + SmoothingFactor * ( Price - SMMA[1] ) ;

//Indicator:

Code: Select all

//Indicator: inputs: Price(Close), Length(13) ; vars: SmoothingFactor( 1 / Length ), SMMA( Price ); SMMA= SMMA[1] + SmoothingFactor * ( Price - SMMA[1] ) ; Plot1( SMMA, "SMMA", White ) ;[code]


Return to “MultiCharts”