hi everyone .. little help please for coder beginner
You have only four choices:
- Search for it,
- learn 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 yours.
- Beg at Coding help - MQL4 and MetaTrader 4 - MQL4 programming forum or Need help with coding - General - MQL5 programming forum or Free MQL4 To MQL5 Converter - General - MQL5 programming forum or Requests & Ideas (MQL5 only!),
- or pay (Freelance) someone to code it.
No free help
urgent help.
I have an expert opening to many orders .
buy I can't close them all at once .
all I need is this equation:
if one open orders closed (TP or SL) then Close all orders.
https://book.mql4.com/trading/orderclose
- book.mql4.com
https://book.mql4.com/trading/orderclose
Can you wrote to me the Condition Line:
"If one of opened orders closed "
It's a lot more than one one. Post your attempt (using CODE button) and state the nature of your problem.
Can you wrote to me the Condition Line:
"If one of opened orders closed "
I don't know if I understood your condition correctly but I am assuming something it should be something like this.
static int PrevOpenedOrders = 0; if(PrevOpenedOrders < OrdersTotal()) { PrevOpenedOrders = OrdersTotal(); } else if(OrdersTotal()< PrevOpenedOrders)//This can be OrdersTotal()==PrevOpenedOrders -1 but I didn't write it because if there were 2 orders hit TP at once there will be an error { for(int i = OrdersTotal() - 1; i>=0; i--) { if(OrdersSelect(i,SELECT_BY_POS)) { bool res = OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),slippage); if(!res) Print("Error in closing the order #",OrderTicket()); } PrevOpenedOrders = 0; } }
- The first if invalidates the second. Remove it.
-
Using OrdersTotal directly and/or no Magic number filtering on your
OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual
trading.)
Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 and MetaTrader 4 - MQL4 programming forum -
After Sleep and between server calls the market will have changed.
You must update your variables. To use any pre-defined variables and series
arrays you must call RefreshRates
RefreshRates - Timeseries and Indicators Access - MQL4 Reference - "and state the nature of your problem."
Ahoj, mám otázku od EA, z nějakého důvodu: Trik se otevře (např.) 0001, když se obchod zavře. kdy trik se vrátí na 001, nebude znovu (pokud by měl). Můžete mi poradit, abych udělal chybu?
This is absolutely nonsense, even in Czech.
Překladač to hodil do cze automaticky:) Díky
The translator translated it into Czech. THx
I have an expert opening to many orders .
buy I can't close them all at once .
all I need is this equation:
if one open orders closed (TP or SL) then Close all orders.
Can anyone help??