in Search

Adding exception code

Last post 06-05-2009, 2:33 by wabbit. 3 replies.
Sort Posts: Previous Next
  •  06-04-2009, 12:08 29854

    Adding exception code

    Have this indicator that plot 1 or 0. But now want the indicator to plot 0 (even there is a signal) whenever the month is > 30 days. The indicator is not base on calendar month. In other word only wan the indicator to plot signal in month <= 30 days and ignore months > 30 days. Possible?
  •  06-04-2009, 15:59 29855 in reply to 29854

    Re: Adding exception code

    Show us your attempt using AND, and DayOfMonth()


    wabbit Big Smile [: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 & MDK
    For custom MetaStock programming : http://www.wabbit.com.au
    My SkyPE status :
    My SkyPE account : wabbit.com.au

  •  06-05-2009, 0:36 29856 in reply to 29855

    Re: Adding exception code

    aa:=barssince(dayofmonth()=0);

    bb:=if(max(aa,aa)<=30,ind1,0);

    cc:=if(max(aa,aa)>30,ind2,0);

    bb+cc;

    but the code above does not seems to plot rite

     

  •  06-05-2009, 2:33 29857 in reply to 29854

    Re: Adding exception code

    Flexi:
    Have this indicator that plot 1 or 0. But now want the indicator to plot 0 (even there is a signal) whenever the month is > 30 days. The indicator is not base on calendar month. In other word only wan the indicator to plot signal in month <= 30 days and ignore months > 30 days. Possible?


    Try:

    Code:
    ind:={your indicator logic goes here};

    (dayofmonth() <=30) * ind;



    wabbit Big Smile [: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 & MDK
    For custom MetaStock programming : http://www.wabbit.com.au
    My SkyPE status :
    My SkyPE account : wabbit.com.au

View as RSS news feed in XML