in Search

One More "Easy" Question, Please Help

Last post 08-06-2009, 4:46 by hatem. 1 replies.
Sort Posts: Previous Next
  •  08-04-2009, 9:12 30334

    One More "Easy" Question, Please Help

    Hello,

    Please have a look at the "Buy" code below:
    A>=B
    AND
    C<=D
    AND
    E>=F
    AND
    Cross(G,H)

    This piece of code works like this: When G crosses over H and at that bar
    if the other conditions met, Buy!

    However, G might have already crossed H (G>H) and one of the other conditions had
    not met yet. I mean, G may cross over H at the ninth bar and at that time since E<F there is no signal produced. At the tenth bar E may be over F, however there would be no signal because G crossed over H a bar ago. So if I convert the code into the following:
    A>=B
    AND
    C<=D
    AND
    E>=F
    AND
    G>=H

    This time, there would be several continuous signals one after another. But I only need the
    first one after the last (Sell) signal.

    How could I tell MetaStock to use only the first Buy signal after the last (Sell) signal and override the rest?

  •  08-06-2009, 4:46 30362 in reply to 30334

    Re: One More "Easy" Question, Please Help

    i suggest you use ALERT code

    so you should give all your previous coding  a name like xyz

    alert((fml("xyz")=1),30)

     

    try it

View as RSS news feed in XML