Jason Posted July 26, 2019 Report Posted July 26, 2019 (edited) Why does this not work? if ( (Low[2] < EMA_10) && Close[1] >= PP_S1 && Math.Abs(Close-Open) = Min(2,0, Math.Abs(Close-Open)) ) Incidentally, why can't I do something like this: if ( (Close[2].Crosses(EMA_10) && Close[1] >= PP_S1 && Math.Abs(Close-Open) = Min(2,0, Math.Abs(Close-Open)) ) Both fail for me. The idea is to test if the prior candle has a low below the EMA_10 and high above it. Edited July 26, 2019 by Jason Quote
Jason Posted July 26, 2019 Author Report Posted July 26, 2019 Sorry, forgot the actual error description: Pos Code Description 75, 10 CS0019 Operator '&&' cannot be applied to operands of type 'bool' and 'double' Quote
Jerry Medved Posted July 26, 2019 Report Posted July 26, 2019 I didn't have a chance to plug it in, but at first glance, = is an assignment, not a comparison. you want == there if ( (Low[2] < EMA_10) && Close[1] >= PP_S1 && Math.Abs(Close-Open) == Min(2,0, Math.Abs(Close-Open)) ) if ( (Close[2].Crosses(EMA_10) && Close[1] >= PP_S1 && Math.Abs(Close-Open) == Min(2,0, Math.Abs(Close-Open)) ) Quote
Jason Posted July 26, 2019 Author Report Posted July 26, 2019 Doh that did it. It was just flagging the error at the beginning at "(Low[2]" so I thought the problem was there. Thanks Quote
Mike Medved Posted July 26, 2019 Report Posted July 26, 2019 Jason, the problem is the lexical parser we're using does not give the right column for the error sometimes. Correct row though Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.