multiple smoothing moving average

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #50720 quote
    PEDRAM.JOKAR
    Participant
    Average

    hi

     

    how can I code multiple smoothing moving average? number of smoothing times can be adjustable.

    #50764 quote
    Leo
    Participant
    Veteran
    period=20
    
    MA=average[period](close)
    sMA=average[period](MA)
    ssMA=average[period](sMA)
    sssMA=average[period](ssMA)
    ssssMA=average[period](sssMA)
    sssssMA=sssMA=average[period](ssssMA)
    
    return MA, sMA, ssMA, sssMA, ssssMa , sssssMA

    Hahaha, looks funny the code… I use it very often and very useful because I get rid of another parameter in case I need two crossing moving average in my codes

    tell me how do you use it

    PEDRAM.JOKAR thanked this post
    #63408 quote
    karolcrabtree
    Participant
    New

    Hi,

    Can you please help me to adapt this code for a simple multiple smoothing moving average (14,10)

    would be very grateful,

    Thanks

    Karol

    #63618 quote
    PEDRAM.JOKAR
    Participant
    Average

    Hi Karol

    If i am not wrong your intention, it would be as below:

    MA=average[14](close)
    sMA=average[10](MA)
    
    return sMA
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

multiple smoothing moving average


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by PEDRAM.JOKAR
7 years, 11 months ago.

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