Moving Average Type

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #123769 quote
    sulimaster
    Participant
    Average

    Hi

    I’m trying to code the moving average indicator where I can then select the different type e.g. simple = 0, exponential = 1, etc. Why does it not work for type 7 = Zero Lag Exponential and type 8 = Hull? I have included variables a = Integer and b = MA type so that you can change these variables once indicator added to chart without having to modify the code.

    Gives error as below:

    Error in the indicator: MA TYPE (1 7)

    Define the type of moving average

    What am I doing wrong please?

    Thanks

    Sachin

     

    period = a
    type = b
    
    MAHigh=Average[period,type](high)
    MALow=Average[period,type](low)
    
    return MAHIGH as "High", MALow as "Low"
    #123777 quote
    robertogozzi
    Moderator
    Master

    v10.3 allows 0-6, v11 should allow up to 8 (I am not sure, though).

    sulimaster thanked this post
    #123785 quote
    Vonasi
    Moderator
    Master

    You can always hard code the missing indicators into your indicator.

    The code for most popular average calculations can be found in this indicator.

    Average Filter Regression

    sulimaster and willi thanked this post
    #123801 quote
    GraHal
    Participant
    Master

    For info @sulimaster

    Whenever I use Indicator Type 7 or 8 in a coded strategy it always works for me.

    But I just tried in a stand alone Indicator (as above) and it gave me the error message etc.

    sulimaster thanked this post
    #123807 quote
    Vonasi
    Moderator
    Master

    ProBuilder and ProOrder use different engines hence there are sometimes differences to be found.

    sulimaster thanked this post
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Moving Average Type


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
sulimaster @sulimaster Participant
Summary

This topic contains 4 replies,
has 4 voices, and was last updated by Vonasi
5 years, 10 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 03/29/2020
Status: Active
Attachments: No files
Logo Logo
Loading...