in Search

MACD question

Last post 05-09-2006, 18:15 by StorkBite. 14 replies.
Sort Posts: Previous Next
  •  05-04-2006, 11:04 17088

    MACD question

    I wish to know if I am doing things correctly? I have read my MS users manuel P.186 on changing the MACD parameters but when it actually comes to it the MACD idicator only lets you change one number by right clicking on the idicator thats easy.Lets say for eg I want to change from 26-12-9 to 39-19-9 by changing that one number do the others automatically fall in line?????????????


    Regards PeterB
  •  05-04-2006, 13:28 17091 in reply to 17088

    Re: MACD question

    The value that you are adjusting is the signal line periods i.e. the moving average period. The difference is still between the 0.075 and 0.15 exponential moving averages.

    You can make your own MACD by following the instructions/code in the "Creating Your Own Indicators" section of the manual.

    You wil not be able to exactly replicate the built in MACD, but the differences are, for the most part, insignificant.

    If you get stuck, just ask for help.


    wabbit :D

    "The question of whether a computer can think is no more interesting than the question of whether a submarine can swim."
    Edsgar W. Dijkstra

     

    MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC C, 11 PRO w/QC & MDK
    For custom MetaStock programming : http://www.wabbit.com.au
    My SkyPE status :
    My SkyPE account : wabbit.com.au

  •  05-04-2006, 13:34 17092 in reply to 17088

    trigger line

    hey peter.... that changes the the signal/trigger line only.... perhaps you can adapt the code below to match your needs.....h


    macd style with inputs { edited to reflect jose's more accurate numbers and investorretired's histogram suggestions}

    -------------------------------------------
    ma1:=Input("short moving average",1,100,12.3);
    ma2:=Input("long moving average ",1,200,25.7);
    ma3:=Input("signal moving average",1,200,9);
    0;
    a:=Mov(C ,ma1 ,E )- Mov(C ,ma2 ,E );
    b:=Mov(a,ma3,E);

    a;
    b;
    a-b

    ----------------------------------------------
  •  05-04-2006, 14:09 17096 in reply to 17088

    Re: trigger line

    Try 12.3/25.7/9 periods in Hayseed's indicator, for a very close fit to the default MACD.


    jose '-)
    MetaStockTools.com
  •  05-08-2006, 11:53 17220 in reply to 17088

    Re: trigger line

    Any idea of how to add the MACD-histogram?

    :?
  •  05-08-2006, 12:05 17221 in reply to 17088

    macd histogram

    hey whitehorse...... most just use the same macd but change the style to the histogram under color/style tab on the indicators settings itself.....h
  •  05-08-2006, 18:15 17224 in reply to 17088

    Re: macd histogram

    Hayseed:

    Changing a MACD to a histogram in MS will not get the desired results. This will give a histogram of the MACD or MACD signal line.

    I believe the MACD histogram is defined as the difference between the MACD line and the MACD signal line and then presented as a histogram. This makes the centerline crossovers and divergences easily identifiable.

    By changing your formula slightly (Listed Below “a;b” to “a-b”) and by then changing the line style to histogram will get the desired results. You may also want to add a horizontal line at zero.

    macd style with inputs
    --------------------------------------------
    ma1:=Input("short moving average",1,100,12);
    ma2:=Input("long moving average ",1,200,26);
    ma3:=Input("signal moving average",1,200,9);
    a:=Mov(C ,ma1 ,E )- Mov(C ,ma2 ,E );
    b:=Mov(a,ma3,E);

    a-b

    InvestorRetired
  •  05-08-2006, 19:13 17227 in reply to 17088

    histogram/divergence

    hey ir.... thanks, your absolutely correct.... my error.... have spent too many years refering to the 'difference' as 'divergence'.... its the old dog new trick syndrome.....h
  •  05-08-2006, 22:43 17235 in reply to 17088

    using decimals in Moving averages?

    Metastock will allow you to use decimals in a moving average, but it will calculate the Moving average as if it were whole numbers.

    here is a test

    Macd 1 using decimals in the input

    ma1:=Input("short moving average",1,100,12.3);
    ma2:=Input("long moving average ",1,200,25.7);
    ma3:=Input("signal moving average",1,200,9);
    0;
    a:=Mov(C ,ma1 ,E )- Mov(C ,ma2 ,E );
    b:=Mov(a,ma3,E);

    a;
    b;
    a-b


    Macd 2 using only whole numbers

    ma1:=Input("short moving average",1,100,12);
    ma2:=Input("long moving average ",1,200,26);
    ma3:=Input("signal moving average",1,200,9);
    0;
    a:=Mov(C ,ma1 ,E )- Mov(C ,ma2 ,E );
    b:=Mov(a,ma3,E);

    a;
    b;
    a-b


    plot them into a chart and you will see that the numbers are the same
  •  05-08-2006, 23:00 17237 in reply to 17088

    Re: using decimals in Moving averages?

    Henry, the plots are clearly different.

    Try plotting both indicators in the same window.


    jose '-)
    MetaStockTools.com
  •  05-08-2006, 23:48 17238 in reply to 17088

    Re: using decimals in Moving averages?

    Hi Jose


    The plots are clearly different because one MA is using a whole number of 25 and the other is using a whole number of 26, not because MS is using the fractional component of the "periods" parameter.


    Regards

    Roy
    MetaStock Tips & Tools
  •  05-09-2006, 0:46 17242 in reply to 17088

    Decimals in Moving Averages

    take a look at this post

    http://forum.equis.com/viewtopic.php?t=103&highlight=
  •  05-09-2006, 1:04 17243 in reply to 17088

    Re: Decimals in Moving Averages

    Hmmm... I guess that MetaStock's standard MA functions truncate inputs to integer values.

    This works:


    Code:

    ma1:=Input("short moving average",1,100,12.3);
    ma2:=Input("long moving average ",1,200,25.7);
    ma3:=Input("signal moving average",1,200,9);

    Ema1:=C*2/(ma1+1)+PREV*(1-2/(ma1+1));
    Ema2:=C*2/(ma2+1)+PREV*(1-2/(ma2+1));

    a:=Ema1-Ema2;
    b:=Mov(a,ma3,E);

    a;b;a-b



    jose '-)
    MetaStockTools.com
  •  05-09-2006, 4:29 17257 in reply to 17088

    Re: Decimals in Moving Averages

    I did not read the posts too thoroughly but in case it is relevant I think maybe what you are looking for is the PPO indicator or percentage price oscillator or simply price oscillator. It's basically a slightly more flexible version of the MACD although it still has limitations. Syntax: OscP(periods,periods,ma_method,diff_method).
  •  05-09-2006, 18:15 17270 in reply to 17088

    Re: Decimals in Moving Averages

    It's a precision thing, not a method thing... :)
    Traders' Consortium
View as RSS news feed in XML