//+------------------------------------------------------------------+ //| Steve Cartwright Trader Camel CCI MACD.mq4 | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ extern double Lots=0.1; //##################################################################### int init() { //---- //---- return(0); } //##################################################################### int start() { double Lots; int TakeProfit, InitialStop, TrailingStop; int total,ticket,MinDist; double Spread; double ATR; int cnt, tmp; //############################################################################ //######################################################################################### //~~~~~~~~~~~~~~~~Miscellaneous setup stuff~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if(Bars<300) { Print("bars less than 300"); return(0); } //######################################################################################### int ArPer=20; double HighBar = Highest(NULL,0,MODE_HIGH,ArPer,1); double LowBar = Lowest (NULL,0,MODE_LOW,ArPer,1); double AroonLong = ((ArPer-HighBar+1)/ArPer)*100; double AroonShort = ((ArPer-LowBar+1)/ArPer)*100; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ATR=iATR(NULL,0,10,0); // BE CAREFUL OF EFFECTING THE AUTO TRAIL STOPS //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //######################################################################################### //################## ORDER CLOSURE ################################################## total=OrdersTotal(); if(total>0) { for(cnt=0;cnt0) { for(cnt=0;cnt0) { for(cnt=0;cnt0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice()); } else Print("Error opening BUY order : ",GetLastError()); return(0); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //ENTRY RULES: SHORT //################################ if(AroonShort == 100 && Close[0] < Low[1] ) { ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0,"Camel Short",16384,0,Red); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice()); } else Print("Error opening SELL order : ",GetLastError()); return(0); } //#################################################################################### //############ End of PROGRAM ######################### return(0); }