Symmetrical Moving Average

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

    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
    Scherm­afbeelding-2022-10-26-om-23.10.16.png Scherm­afbeelding-2022-10-26-om-23.10.16.png
    #203136 quote
    snuckesnucke
    Participant
    Veteran
    why do you make it so it lags?
    #203143 quote
    jacquesgermainjacquesgermain
    Participant
    Veteran
    observation: the same symmetrical mm can be obtained with the sma predefined prt + horizontal offset -5
    #203144 quote
    JSJS
    Participant
    Master

    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
    snuckesnucke
    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
    JSJS
    Participant
    Master

    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
    snuckesnucke
    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.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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 snuckesnucke
3 years, 11 months ago.

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