Hi funyoo,
do you have a module to add "maxOrder"?
So that I can determine, how much trade concurrently per pair are allowed.
Best regards and thanks for your efforts!!!!!
j_l
Hi funyoo,
do you have a module to add "maxOrder"?
So that I can determine, how much trade concurrently per pair are allowed.
Best regards and thanks for your efforts!!!!!
j_l
Last edited by j_l; 03-27-2009 at 12:56.
Hi j_l,
Add :
After the other functions :
Before the ordersend functions :Code://|---------count orders int CountOrders(int Type,int Magic) { int _CountOrd; _CountOrd=0; for(int i=0;i<OrdersTotal();i++) { OrderSelect(i,SELECT_BY_POS,MODE_TRADES); if(OrderSymbol()==Symbol()) { if((OrderType()==Type&&(OrderMagicNumber()==Magic)||Magic==0))_CountOrd++; } } return(_CountOrd); }
After the ordersend functions :Code:if((CountOrders(OP_BUY,Magic)+CountOrders(OP_SELL,Magic))<MaxOrders) {
In the extern parameters :Code:}
Code:extern int MaxOrders=100;//|---------------------maximum orders allowed
Trading forex risk disclaimer. Exclusive EAs in the Elite section.
Thank You So Much
So is this the code I would use to have more than one order opened by a single ea? If not, can you point me to the right spot on the forum or explain to me here how I can get my ea to open up to 5 orders at a time. Not at the same time, but to continue looking for trading opportunities when a trade is already opened.
Thanks
Shawn
Trading forex risk disclaimer. Exclusive EAs in the Elite section.
I am getting several variable undefined errors with type, magic, count_ord, and total.
I copied and pasted as is. Am I doing something wrong?
Trading forex risk disclaimer. Exclusive EAs in the Elite section.