Job finished
Specification
Hello,
ok so my EA is working perfect but only when its operating alone. What i need is to indentify the trades made by every EA using unique magic number becouse there is no other way. So i need the peace of code with all the needed doubles if you use ones.. sorry i cannot give you my code to work on. My ea opening trades in standart way by using magic number in ordersend and before that i put it in tickets ofcourse, like in example bellow. The EA is going to work with diferend parameters in diferend pairs. The most important for me is "close all" function wich now uses all the trades wich is in acc wich is not good. i use equity stop by indentifying when to close the trades.i put some example also to better explain. So i need if conditions are happen for closing i need to do it by selecting only trades the ones that this EA made, but not as it is now (while orders is > 0) .
extern double MagicNumber=132; int ticket; if(x > x && ok == true && x == 0) { ticket = OrderSend(Symbol(),OP_BUY, Lot,Ask,Slippage,0,0," buy",MagicNumber,0,Blue); OrderModify(ticket,OrderOpenPrice(),Ask-StopLoss*Point*platform_digital,Ask+TakeProfit*Point*platform_digital,0);//Modify it! } { if(x < x && ok == true && x == 0) { ticket = OrderSend(Symbol(),OP_SELL,Lot,Bid,Slippage,0,0," sell",MagicNumber,0,Red); OrderModify(ticket,OrderOpenPrice(),Bid+StopLoss*Point*platform_digital,Bid-TakeProfit*Point*platform_digital,0);//Modify it! } } } } } if(AccountEquity() >= EquityStop) // CLOSE !!! { while(OrdersTotal()>0) { OrderSelect(0,SELECT_BY_POS); if(OrderType()==OP_BUY) OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),999,Red); if(OrderType()==OP_SELL) OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),999,Orange); if(OrderType()==OP_BUYSTOP||OrderType()==OP_SELLSTOP||OrderType()==OP_BUYLIMIT||OrderType()==OP_SELLLIMIT) OrderDelete(OrderTicket()); } }
One more thing, i put the ordersmax protection using very primityve algorythm, so i need fix for that also. i think it would be best to count the orders using ticket but i am not sure if the int ticket will not be the sum of all the ea runing becouse all of them have the same code. The problem is that if i limit one order per bar, and using on multiple charts and they need to open at the same time it couses the problem, other EA's will not enter becouse of restriction :
//OrderMax protection extern double MaxOpenOrders = 1; double o = OrdersTotal(); { if(o >= MaxOpenOrders) ok = false; if(o == 0 && AccountEquity() <= EquityStop) // to turn it on again if the profit has been reached with 1 order and all is closed allready ok = true; }
Anybody can help me?
please take this job and give me your skype, i will contact you if you really can do this.