. In other words, I want to open 1 position only for system 1, 1 position for system 2, and 1 to system 3.
OK
then you work with MAGIC Number per system
Code:
#property copyright "system 1"
#property link ""
#define MAGIC 01901
.
.
.
if ( ExistPosition() == False) {
OrderSend(Symbol(),op,Lots,pp,SLIPPAGE,ldStop,ldTake,lsComm,MAGIC,0,clOpen); // MAGIC = system 1
}
// if open 1 position only for system 1 MAGIC ?
bool ExistPosition() {
bool Exist=False;
for (int i=0; i<OrdersTotal(); i++) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC) Exist=True;
}
}
return(Exist);
}
can you posting you systems ?