Help you with what? You haven't stated a problem, you stated a want.
How To Ask Questions The Smart Way. 2004
Prune pointless queries.
You have only four choices:
-
Search for it (CodeBase or Market). Do you expect us to do your research for you?
- Beg at:
- Coding help - MQL4 programming forum
- Make It No Repaint Please! - MQL4 programming forum
- MT4 to MT5 code converter - MQL5 programming forum
- Please fix this indicator or EA - General - MQL5 programming forum
- Requests & Ideas (MQL5 only!) - Expert Advisors and Automated Trading - MQL5 programming forum
-
MT4: Learn to code it.
MT5: Begin learning to code it.If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.
-
or pay (Freelance) someone to code it. Top of every page is the link Freelance.
We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
No free help 2017.04.21
I want a script or EA which can close 50% of all current opened buy and sell orders
is there anyone can help me ??
Save it as a script or you can copy the attached file to the script.
#property strict #property show_inputs input double KapatYuzde=50;// can close x% of all current opened buy and sell orders int start() { int total = OrdersTotal(); for(int i=total-1;i>=0;i--) { bool sdddt=OrderSelect(i, SELECT_BY_POS); int type = OrderType(); bool result = false; double ClosedOrder=NormalizeDouble(OrderLots()*KapatYuzde/100,2); double EnKucukLot=MarketInfo(Symbol(),MODE_MINLOT); // Print(OrderTicket()," ",ClosedOrder," LOts ",OrderLots()); if(ClosedOrder>EnKucukLot) { switch(type) { //Close opened long positions case OP_BUY : result = OrderClose( OrderTicket(), ClosedOrder, MarketInfo(OrderSymbol(), MODE_BID), 5, CLR_NONE ); break; //Close opened short positions case OP_SELL : result = OrderClose( OrderTicket(), ClosedOrder, MarketInfo(OrderSymbol(), MODE_ASK), 5, CLR_NONE ); break; //Close pending orders // case OP_BUYLIMIT : // case OP_BUYSTOP : // case OP_SELLLIMIT : // case OP_SELLSTOP : result = OrderDelete( OrderTicket() ); } if(result == false) { if (GetLastError()>0) Alert("Order " , OrderTicket() , " failed to close. Error:" , GetLastError() ); Sleep(3000); } } } return(0); } // Close All int CloseAllTrades() { int total = OrdersTotal(); for(int i=total-1;i>=0;i--) { bool asdsa=OrderSelect(i, SELECT_BY_POS); int type = OrderType(); bool result = false; //if(OrderType()==OP_BUY) vOrderClose (OrderTicket(), lot3, MarketInfo(OrderSymbol(), MODE_BID), 10, Red); //if(OrderType()==OP_SELL) vOrderClose (OrderTicket(), lot3, MarketInfo(OrderSymbol(), MODE_ASK), 10, Red); switch(type) { //Close opened long positions case OP_BUY : result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, CLR_NONE ); break; //Close opened short positions case OP_SELL : result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, CLR_NONE ); break; //Close pending orders case OP_BUYLIMIT : case OP_BUYSTOP : case OP_SELLLIMIT : case OP_SELLSTOP : result = OrderDelete( OrderTicket() ); } if(result == false) { if (GetLastError()>0) Alert("Order " , OrderTicket() , " failed to close. Error:" , GetLastError() ); Sleep(3000); } } return(0); }
Save it as a script or you can copy the attached file to the script.
Help you with what? You haven't stated a problem, you stated a want.
How To Ask Questions The Smart Way. 2004
Prune pointless queries.
You have only four choices:
-
Search for it (CodeBase or Market). Do you expect us to do your research for you?
- Beg at:
- Coding help - MQL4 programming forum
- Make It No Repaint Please! - MQL4 programming forum
- MT4 to MT5 code converter - MQL5 programming forum
- Please fix this indicator or EA - General - MQL5 programming forum
- Requests & Ideas (MQL5 only!) - Expert Advisors and Automated Trading - MQL5 programming forum
-
MT4: Learn to code it.
MT5: Begin learning to code it.If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.
-
or pay (Freelance) someone to code it. Top of every page is the link Freelance.
We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
No free help 2017.04.21
thank you for clarification
thank you
thank you
Save it as a script or you can copy the attached file to the script.
thank you man, you are the best
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I want a script or EA which can close 50% of all current opened buy and sell orders
is there anyone can help me ??