Symmetrical Moving Average

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #203109 quote
    JS
    Participant
    Senior

    Moving averages are excellent filters for reducing noise and maintaining a good step response.

    When calculating a simple moving average, only the input values on one side of the output value are used.

    Alternatively, the group of input values can be chosen symmetrically around the output value, this prevents a relative shift between the input and output values.

    In the screenshot the difference between a simple moving average (red) and a symmetrical moving average (green).

     
    N=500
    Period = 10
    For i = Period/2 to N
    $SyMA[i]=0
    For j= -Period/2 to Period/2
    $SyMA[i] = $SyMA[i] + Close[i + j]
    Next
    $AvgSyMA[i] = $SyMA[i] / (Period+1)
    DrawSegment(BarIndex[i], $AvgSyMA[i], BarIndex[i+1], $AvgSyMA[i+1]) Coloured(0,255,0)
    Next
    Return
    
    denmar and jacquesgermain thanked this post
    #203136 quote
    snucke
    Participant
    Veteran
    why do you make it so it lags?
    #203143 quote
    jacquesgermain
    Participant
    Senior
    observation: the same symmetrical mm can be obtained with the sma predefined prt + horizontal offset -5
    #203144 quote
    JS
    Participant
    Senior

    Hi @snucke

    As you can see in the screenshot, the symmetric MA responds faster to the price changes than the simple MA, so there is less delay (lagging)…

    #203147 quote
    snucke
    Participant
    Veteran
    What i ment was why is it Infront of the price and not where the price actually is? Makes it look faster at reacting than i normal average
    #203153 quote
    JS
    Participant
    Senior

    Simple moving average:

    Y[10] = (x[10] + x[11] + x[12] + x[13] + x[14]) / 5

    Symmetrical moving average:

     Y[10] = (x[8] + x[9] + x[10] + x[11] + x[12]) / 5

    #203169 quote
    snucke
    Participant
    Veteran
    Why not show them in the same place? Where price is and where a normal moving average is being plotted
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Symmetrical Moving Average


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
JS @js Participant
Summary

This topic contains 6 replies,
has 3 voices, and was last updated by snucke
3 years, 3 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 10/26/2022
Status: Active
Attachments: 1 files
Logo Logo
Loading...