//+------------------------------------------------------------------+ //| ADXcross EXPERT | //+------------------------------------------------------------------+ #property link "http://www.forex-instruments.info" extern double Lots=0.1; extern int Stoploss=20; extern int TakeProfit=999; extern double TrailingStop = 10; extern int Slip=5; double b4plusdi,b4minusdi,nowplusdi,nowminusdi,Opentrades,cnt,total; //+------------------------------------------------------------------+ //| Setting internal variables for quick access to data | //+------------------------------------------------------------------+ int start() { Opentrades=0; for (cnt=0;cnt0) { if(Bid-OrderOpenPrice()>Point*TrailingStop) { if(OrderStopLoss()0) { if((OrderOpenPrice()-Ask)>(Point*TrailingStop)) { if(OrderStopLoss()==0.0 || OrderStopLoss()>(Ask+Point*TrailingStop)) { OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Aqua); return(0); } } } } } } if (Opentrades==0) //and iATR(5,2)b4minusdi && nowplusdinowminusdi) { //Alert(Symbol()," ",Period()," ADX BUYING"); OrderSend(Symbol(),OP_BUY,Lots,Ask,Slip,Ask-Stoploss*Point,Ask+TakeProfit*Point,"ADX",0,0,White); } } } return(0); // }