//+---------------------------------------------------------------------------------------------------+ //| HLHB Trend-Catcher.mq4 | //| Copyright 2016, Boh113 | //| http://www.babypips.com/blogs/loonie-adventures/forex-hlhb-system-explained.html | //+---------------------------------------------------------------------------------------------------+ #property copyright "Copyright 2016, Boh113" #property link "http://www.babypips.com/blogs/loonie-adventures/forex-hlhb-system-explained.html" #property version "2.01" #property strict //+---------------------------------------------------------------------------------------------------+ input int TakeProfit=2000; input int StopLoss=500; input int FastMA=5; input int SlowMA=10; input int RSI=10; input double LotSize=0.02; input bool TrailingStop=true; //+---------------------------------------------------------------------------------------------------+ int start() { int ord,i; double PreviousSlowMA=iMA(NULL,0,SlowMA,0,MODE_EMA,PRICE_CLOSE,2); double CurrentSlowMA=iMA(NULL,0,SlowMA,0,MODE_EMA,PRICE_CLOSE,1); double PreviousFastMA=iMA(NULL,0,FastMA,0,MODE_EMA,PRICE_CLOSE,2); double CurrentFastMA=iMA(NULL,0,FastMA,0,MODE_EMA,PRICE_CLOSE,1); double PreviousRSI=iRSI(NULL,0,RSI,PRICE_MEDIAN,2); double CurrentRSI=iRSI(NULL,0,RSI,PRICE_MEDIAN,1); TSL(); for(i=0;i0)return(0); if(PreviousFastMACurrentSlowMA) { if(PreviousRSI<50.00&&CurrentRSI>50.00) Buy_Function(); } if(PreviousFastMA>PreviousSlowMA&&CurrentFastMA50.00&&CurrentRSI<50.00) Sell_Function(); } return(0); } //+---------------------------------------------------------------------------------------------------+ int Buy_Function() { { OrderSend(Symbol(),OP_BUY,LotSize,Ask,5,Ask-(StopLoss*Point),Ask+(TakeProfit*Point),Blue); } return(0); } //+---------------------------------------------------------------------------------------------------+ int Sell_Function() { { OrderSend(Symbol(),OP_SELL,LotSize,Bid,5,Bid+(StopLoss*Point),Bid-(TakeProfit*Point),Red); } return(0); } //+---------------------------------------------------------------------------------------------------+ int TSL() { for(int i=0;iAsk) { if (OrderStopLoss()>(Ask+(StopLoss*Point))) { bool res=OrderModify(OrderTicket(),OrderOpenPrice(),(Ask+(StopLoss*Point)),OrderTakeProfit(),0,Red); } } } } return(0); } //+---------------------------------------------------------------------------------------------------+