|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
You need this thread dose it posible to creat any function of "mql code" posting in this forum? : there is some links like 'one order per chart' for example.
|
|
|||
|
This is what I use.
int buy_orders = 0, sell_orders = 0;
int i; int cnt = OrdersTotal(); for (i=0;i<cnt;i++) { OrderSelect(i, SELECT_BY_POS, MODE_TRADES); if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) if (OrderType() == OP_BUY) buy_orders++; else if (OrderType() == OP_SELL) sell_orders++; } I always put this at the start of every ea and then check that there are no existing orders in the logic section.(I borrowed it from someone else!) if(sell_orders<1 && etc.... |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MQL4 Guide | RickD | Metatrader Programming | 21 | 05-06-2008 06:53 PM |
| Need Help To Edit This Great EA | zeppelin | Expert Advisors - Metatrader 4 | 83 | 11-16-2007 12:43 PM |
| How to edit ex4 file | Fisher | Indicators - Metatrader 4 | 2 | 08-09-2006 11:30 AM |
| cant find the edit button | Duke Nukem | General Discussion | 9 | 12-09-2005 08:24 AM |