View Single Post
  #13 (permalink)  
Old 11-06-2005, 01:20 PM
Alex.Piech.FinGeR's Avatar
Alex.Piech.FinGeR Alex.Piech.FinGeR is offline
Senior Member
 
Join Date: Oct 2005
Location: Germany
Posts: 305
Alex.Piech.FinGeR has much to be proud ofAlex.Piech.FinGeR has much to be proud ofAlex.Piech.FinGeR has much to be proud ofAlex.Piech.FinGeR has much to be proud ofAlex.Piech.FinGeR has much to be proud ofAlex.Piech.FinGeR has much to be proud ofAlex.Piech.FinGeR has much to be proud ofAlex.Piech.FinGeR has much to be proud of
. 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 ?
Reply With Quote