TimeNum is an array and you can't use that in an AND statement. Use this: Buy = Close > MA( Close , 20 ) AND LastValue(TimeNum())>=93000 AND LastValue(TimeNum())<=103000;
More efficiently use: tod = LastValue(TimeNum()); Buy = Close > MA( Close, 20 ) AND tod >= 93000 AND tod <= 103000; Barry --- In [email protected], "longarm61" <[EMAIL PROTECTED]> wrote: > > Hi, > > I just want my buy rule to apply from 9:30 to 10:30. Apparently > there's a syntax error with the code below (second line, at the end), > but this dummy can't figure it out. Would somone be kind enough to > tell me what I'm doing wrong? Thanks. > > > Buy = Close > MA( Close , 20 ) > AND TimeNum()>=93000 AND TimeNum()<=103000); >
