Announcement

Collapse
No announcement yet.

MA Types

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MA Types

    I get the users's MA type from:

    fpArray[x] = new FunctionParameter("Type", FunctionParameter.STRING);
    with (fpArray[x++]) {
    fpArray[x-1].setName("Type");
    fpArray[x-1].addOption("MAStudy.SIMPLE");
    fpArray[x-1].addOption("MAStudy.EXPONENTIAL");
    fpArray[x-1].addOption("MAStudy.WEIGHTED");
    fpArray[x-1].addOption("MAStudy.VOLUMEWEIGHTED");
    }

    buy when I use "Type" as follows:

    fMA = new MAStudy(Length, 0, Source, Type );

    I get:

    Error: Parameter number 4 of function MAStudy is invalid

    The source parameter is exactly the same and that works. I'm guessing the source is text and Moving Average Type is not.

    How can I solve this? Help please.

    Thanks.

  • #2
    Re: MA Types

    BerkoBob
    Open the builtinMA.efs which is in the Builtin folder of Formulas to see an example of how to do this
    Alex


    Originally posted by BerkoBob
    I get the users's MA type from:

    fpArray[x] = new FunctionParameter("Type", FunctionParameter.STRING);
    with (fpArray[x++]) {
    fpArray[x-1].setName("Type");
    fpArray[x-1].addOption("MAStudy.SIMPLE");
    fpArray[x-1].addOption("MAStudy.EXPONENTIAL");
    fpArray[x-1].addOption("MAStudy.WEIGHTED");
    fpArray[x-1].addOption("MAStudy.VOLUMEWEIGHTED");
    }

    buy when I use "Type" as follows:

    fMA = new MAStudy(Length, 0, Source, Type );

    I get:

    Error: Parameter number 4 of function MAStudy is invalid

    The source parameter is exactly the same and that works. I'm guessing the source is text and Moving Average Type is not.

    How can I solve this? Help please.

    Thanks.

    Comment

    Working...
    X