Why are you testing the result of the Cross function for being less than or equal to three? Cross returns an array containing only zeroes and ones, so I think the whole Buy array will be full of ones (ie. every bar will have a buy signal).
Also, I'm not sure how the formula is supposed to work, but are you sure your operator precedence is correct for the OR and AND operators? Regards, GP --- In [email protected], "power.stocks" <[EMAIL PROTECTED]> wrote: > > I wrote a program if macd signal line cross over only overbought/sold > zone. Buy it could not work proper. Kindly solve the problem. > > Buy=Cross( MACD( 12, 26 ), Signal( 12, 26, 9 ) ) <=3 OR MACD( 12, 26 > ) > 0.5 AND ( MACD( 12, 26 )>Signal( 12, 26, 9 ) ) ; >
