Jump to content
Medved Trader Forums

CS0019 Comparison Error


Recommended Posts

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 by Jason
Link to comment
Share on other sites

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)) )

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...