- order close error
- trading code
- [WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you.
There is no such function
You have to go through the list of opened orders, save the ticket numbers in an array, sort the array and then you can have something like you want. It could be done similar to this :
int ordersByTicket[]; for (int i=OrdersTotal()-1,i>=0, i--) if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES) { ArrayResize(ordersByTicket,ArraySize(ordersByTicket)+1); ordersByTicket[ArraySize(ordersByTicket)-1] = OrderTicket(); } ArraySort(ordersByTicket,WHOLE_ARRAY,MODE_DESCEND); ordersByTicket[0] == // last (biggest) ticket number and so on
TicketNumber = W[w]
Do you undestand??
Mladen, could you create the code of the these 6 functions below for me?
TicketNumber = W[w]
ALL Positions:
Do you undestand??
I don't (understand)
If you know the exact ticket numbers you want to access, then simply use OrderSelect(ticketNumber,SELECT_BY_TICKET,MODE_TRADES); function
No! I don't know the ticket number :S
WHat I want to do is the following:
I speaking for the EA:
"EA, close the first buy position!"
"EA, close the last sell position!"
"EA, close the three last position!"
"EA, close the last position and the 2nd of buy and 5nd of sell!"
In other words, I want to control which position the EA will close by "1st", "2nd", ..., "penultimate" and "last".
No! I don't know the ticket number :S
WHat I want to do is the following:
I speaking for the EA:
"EA, close the first buy position!"
"EA, close the last sell position!"
"EA, close the three last position!"
"EA, close the last position and the 2nd of buy and 5nd of sell!"
In other words, I want to control which position the EA will close by "1st", "2nd", ..., "penultimate" and "last".
No! I don't know the ticket number :S
WHat I want to do is the following:
I speaking for the EA:
"EA, close the first buy position!"
"EA, close the last sell position!"
"EA, close the three last position!"
"EA, close the last position and the 2nd of buy and 5nd of sell!"
In other words, I want to control which position the EA will close by "1st", "2nd", ..., "penultimate" and "last".
Exist other form more simple?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use