bool ris;
bool ris2;
if (OrderType()==OP_BUY &&mc1>mc2&&mc01<mc02 )
ris=OrderClose(ticket,lots,Bid,3,clrAqua);
if(OrderType()==OP_SELL && mc1<mc2 && mc01>mc02)
ris2=OrderClose(ticket,lots,Ask,3,clrBrown);
return(0);
- how does this program ever come to market? what's wrong here?
- [Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2.
- Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6.
- When you post code please use the SRC button! Please edit your post.
General rules and best pratices of the Forum. - General - MQL5 programming forum - 4108 means something completely different in MT5.Why did you post your MT4 question in the Root / MT5 General section instead of the MQL4 section, (bottom of the Root page?)
Runtime Errors - Codes of Errors and Warnings - Standard Constants, Enumerations and Structures - MQL4 Reference4108
ERR_INVALID_TICKET
Invalid ticket
General rules and best pratices of the Forum. - General - MQL5 programming forum if (OrderType()==OP_BUY &&mc1>mc2&&mc01<mc02 )
You can not use any Trade Functions until you select an order.ris=OrderClose(ticket,lots,Bid,3,clrAqua);
Obviously your ticket variable is bogus. Do you even check if the order has already been closed, or if you haven't opened one yet?-
Check your return codes for errors and report them.
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 - Use the debugger or print out your variables, including _LastError and find out why.
you're right I'm wrong

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