Jump to content
Medved Trader Forums

Recommended Posts

Posted (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 by Jason
Posted

Sorry, forgot the actual error description:

Pos    Code    Description    
75, 10    CS0019    Operator '&&' cannot be applied to operands of type 'bool' and 'double'    

 

Posted

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

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