- Why did you post your MT4 question in the
Root /
MT5 General section
instead of the
MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon. -
When you post code please use the CODE button (Alt-S)!
(For large amounts of code, attach it.) Please edit your post.
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor result1=OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
Check your return codes for errors, report them 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(OrderType()==OP_BUY){ if(Bid-OrderOpenPrice()>PuntiAZ*p){ bool result=OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+Pips_Stop*p,OrderTakeProfit(),Red);
Where do you check that the new SL is still below the market in your OrderModify? You can't move stops (or pending prices) closer to the market than the minimum (MODE_STOPLEVEL * _Point.)
Requirements and Limitations in Making Trades - Appendixes - MQL4&Tutorial- Use the debugger or print out your variables, including Bid and find out why.
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
Hi guys, i have different problem with this EA, he return erro ordermodify 130 i try to modify Ask Bid i try to inverted but when i launch the ea don't start the function Azzerrastop(); if something can help me please
thanks for all and sorry for my english