Jump to content
Medved Trader Forums
Jason

Conditional Code Suddenly Stops Working

Recommended Posts

Why does this work:

(Close <= EMA_10+.05 && Close > EMA_10-.05) && (EMA_10 >= VWAP_U) && (Open[3] >= Close) && (High[3] >= High) )

but then this fails:

(Close.Crosses(EMA_10) | Close.Crosses(EMA_20)) && (EMA_10 >= VWAP_U) && (Open[3] >= Close) && (High[3] >= High) )

with the error codes:

25, 102    CS0019    Operator '>=' cannot be applied to operands of type 'MT.Charting.PaintbarBase.IndexedPropertyDouble' and 'MT.Charting.PaintbarBase.IndexedPropertyDouble'    
25, 124    CS0019    Operator '>=' cannot be applied to operands of type 'double' and 'MT.Charting.PaintbarBase.IndexedPropertyDouble'    
25, 146    CS0019    Operator '>=' cannot be applied to operands of type 'double' and 'MT.Charting.PaintbarBase.IndexedPropertyDouble'  

The EMA, Open[3] and High[3] elements are highlighted but none of that code was changed.

 

Thanks

 

 

 

Share this post


Link to post
Share on other sites

we are fixing this. Meanwhile, if you change it to
(Close.Crosses(EMA_10[0]) || Close.Crosses(EMA_20[0])) && (EMA_10[0] >= VWAP_U[0]) && (Open[3] >= Close[0]) && (High[3] >= High[0]) )

it will work

NOTE: | is a bitwise OR where as || is a logical OR. Need to use || or MT supports the word OR

Share this post


Link to post
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...