Announcement

Collapse
No announcement yet.

Alter MACD Accuracy?

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

  • Alter MACD Accuracy?

    Hi All!

    I am working on a program that trades using MACD (among other things), so I'm sorry if this gets really technical.

    Please let me if any of this is in error

    [From right-clicking on an Advanced Chart]
    1. Basic Studies/MACD
    Signal-line is default using SMA
    2. Formulas/Builtin/builtinMACD.efs
    EMA only, with parameter window
    3. Formulas/EFS 2 Basic/basicMACD.efs
    No options
    4. Formulas/EFS 2 Custom/customMACD.efs
    Like basicMACD.efs, but can change parameters

    Now, I see that unaltered the values of: "MACD" & "builtinMACD.efs" are the same; and that of "basicMACD" & "customMACD" are the same. In terms of the EFS, some of them allow parameter changes, like using SMA for "MACD", or MA lengths on "builtinMACD".

    So my first question is, how do I get these values to match that of Prophet.net or Yahoo Finance? I am not sure who is more reliable, since Prophet and Yahoo differ from each other too!

    And my second question is, how can I increase the accuracy level of the MACD variables? Right now, they go to the hundreths (0.04). Is it possible for me to arbitrarily set the accuracy level of the MACD EFS, like to thousandths? Reason is, I'm storing an array for them, and I need the increase in accuracy or else the EFS is not valuable for me and I will have to code MACD from scratch.

    Please let me know if you can help! I would like to get this done so I can refine the program logic.
    Last edited by ryang; 03-29-2009, 12:07 AM.

  • #2
    Re: Alter MACD Accuracy?

    ryang
    The Basic Studies MACD offers the option to use either simple or exponential averages for both the MACD and Signal lines.
    The builtinMACD.efs uses the legacy MACDStudy() function which also offers the option to use either simple or exponential averages for both the MACD and Signal lines. You can change the selection through Edit Studies
    The basicMACD.efs and the customMACD.efs instead use the efs2 functions which only use the exponential average to calculate both the MACD and Signal lines
    As far as I know the traditional MACD is calculated using exponential averages so if you want to write an efs that offers you the option to use either then use the legacy MACDStudy() function
    As to matching Prophet.net that will depend on what they are using to calculate the MACD
    With regards to your second question you cannot increase the number of decimals displayed by a plot as that is controlled by the efs engine. However you can output the value as a string [which will not plot but will display in the Cursor Window] in which case you can determine the decimal precision. You would do that using the toFixed() method which converts a number to a string and allows you to define the number of decimals (see the example in the enclosed screenshot)
    Alex




    Originally posted by ryang
    Hi All!

    I am working on a program that trades using MACD (among other things), so I'm sorry if this gets really technical.

    Please let me if any of this is in error

    [From right-clicking on an Advanced Chart]
    1. Basic Studies/MACD
    Signal-line is default using SMA
    2. Formulas/Builtin/builtinMACD.efs
    EMA only, with parameter window
    3. Formulas/EFS 2 Basic/basicMACD.efs
    No options
    4. Formulas/EFS 2 Custom/customMACD.efs
    Like basicMACD.efs, but can change parameters

    Now, I see that unaltered the values of: "MACD" & "builtinMACD.efs" are the same; and that of "basicMACD" & "customMACD" are the same. In terms of the EFS, some of them allow parameter changes, like using SMA for "MACD", or MA lengths on "builtinMACD".

    So my first question is, how do I get these values to match that of Prophet.net or Yahoo Finance? I am not sure who is more reliable, since Prophet and Yahoo differ from each other too!

    And my second question is, how can I increase the accuracy level of the MACD variables? Right now, they go to the hundreths (0.04). Is it possible for me to arbitrarily set the accuracy level of the MACD EFS, like to thousandths? Reason is, I'm storing an array for them, and I need the increase in accuracy or else the EFS is not valuable for me and I will have to code MACD from scratch.

    Please let me know if you can help! I would like to get this done so I can refine the program logic.

    Comment

    Working...
    X