I got the same result when I write the if order in this way:
if(OrderOpenPrice() != price) { Print("Modifying BuyStop from ",OrderOpenPrice()," to " ,price); if(OrderModify(M1BTicket,price,stoploss,takeprofit,0,Red)) Print("Buy Stop Modified!"); }
-
if(OrderModify(M1BTicket,price,stoploss,takeprofit,0,Red)) Print("Buy Stop Modified!");
Check your return codes for errors, and report them including GLE/LE. Don't look at it unless you have an error. Don't just silence the compiler, it is trying to help you.
What are Function return values ? How do I use them ? - MQL4 and MetaTrader 4 - MQL4 programming forum
Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
Only those functions that return a value (e.g. iClose, MarketInfo, etc.) must you call ResetLastError before in order to check after. if((OrderOpenPrice()>price) || (OrderOpenPrice()<price))
This is almost always true. Doubles are rarely equal. Understand the links in:
The == operand. - MQL4 and MetaTrader 4 - MQL4 programming forumif(OrderOpenPrice() != price)
See № 1- What does the open price have to do with your SL? Why don't you test the current SL against the new SL?
ERR_NO_RESULT
You Server Change the SL to X It is at X! Change the SL to X It is at X! Change the SL to X You are insane
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hey guys,
Please look at this code:
How this code can has this result??
Print order should not be processed when OrderOpenPrice() == price but it does!!. I can't understand it please help me.