//+------------------------------------------------------------------+ //| Copyright 2005, Gordago Software Corp. | //| http://www.gordago.com/ | //+------------------------------------------------------------------+ #property copyright "Copyright 2005, Gordago Software Corp." #property link "http://www.gordago.com" bool indicator_buffers [2]; double indicator_color1= Aqua; double indicator_color2= Red; extern double lStopLoss = 25; extern double sStopLoss = 25; extern double lTrailingStop = 30; extern double sTrailingStop = 30; extern double Lots = 1; int ServerTimeZone = 0; extern int NumberOfBarH6 = 100; // quantity H6 of the candles //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ void init() { int i; for (i=0; i= 19 || TimeHour(CurTime()) + ServerTimeZone <= 0) { Comment ("\n","Current Time : ",TimeToStr(CurTime())," ( GTM=", ServerTimeZone," ) is NOT GOOD for Trade by this Robot", "\n"); return(0); } int cnt, ticket; if(Bars<100){ Print("bars less than 100"); return(0); } if(lStopLoss<10){ Print("StopLoss less than 10"); return(0); } if(sStopLoss<10){ Print("StopLoss less than 10"); return(0); } double diMA0=iMA(NULL,240,7,0,MODE_EMA,PRICE_CLOSE,0); double diMA1=iMA(NULL,240,18,0,MODE_EMA,PRICE_CLOSE,0); double diMA3=iMA(NULL,240,7,0,MODE_EMA,PRICE_CLOSE,0); double diMA4=iMA(NULL,240,18,0,MODE_EMA,PRICE_CLOSE,0); double diCustom5=iCustom(NULL, 15, "GentorCCIM_v[1]", Close, 0, 0); double diMA6=iMA(NULL,15,7,0,MODE_EMA,PRICE_CLOSE,0); double diOpen7=iOpen(NULL,15,0); double diClose8=iClose(NULL,15,0); double diCustom9=iCustom(NULL, 15, "GentorCCIM_v[1]", Close, 0, 0); int total=OrdersTotal(); if(total<1){ if(AccountFreeMargin()<(1000*Lots)){ Print("We have no money. Free Margin = ", AccountFreeMargin()); return(0); } if ((oh6>ch6 && diCustom5>0 )){ ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-lStopLoss*Point,0, "gordago simple",16384,0,Green); if(ticket>0){ if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice()); } else Print("Error opening BUY order : ",GetLastError()); return(0); } if (( oh60) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice()); } else Print("Error opening SELL order : ",GetLastError()); return(0); } } for(cnt=0;cnt0) { if(Bid-OrderOpenPrice()>Point*lTrailingStop) { if(OrderStopLoss()0) { if((OrderOpenPrice()-Ask)>(Point*sTrailingStop)) { if((OrderStopLoss()>(Ask+Point*sTrailingStop)) || (OrderStopLoss()==0)) { OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*sTrailingStop,OrderTakeProfit(),0,Red); return(0); } } } } } }