correct this simple code if you can

 

hello, I have a very simple code. i do not know why it dose not work.

the " ResistanceOnexmt " and " ResistanceOnexpt " are prices and they are 5 points above and under one of the Resistance Lines, and " PriceBID " is SYMBOL_BID.

all these variables are global in client terminal and refreshed just before this pert comes.

I have 12 of this code fragment in my EA.  I want every time that " PriceBID " is in between of these prices " AllowSell "(also global) becomes true and control goes to " Criterion() "

for the other trading conditions.

problem is the control NEVER goes inside the second "if" even when the Price is right and it should go in.

i have put "Alert" functions everywhere in this code. and i am sure the control goes in the first "if" but it never goes in the second "if".

any Ideas?  am i missing something?

 <Deleted>

Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Symbol Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Symbol Properties
  • www.mql5.com
Symbol Properties - Environment State - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
kriss.ro:

Please edit your post and use the code button (Alt+S) when pasting code.

EDIT your original post, please do not just post the code correctly in a new post.

SYMBOL_BID is an Enum, not a price. Check the documentation for function SymbolInfoDouble()

Reason: