//+------------------------------------------------------------------+ //| RealHour.mq4 | //| Bernard Citra | //| | //| Matthew 6:33 | //| "But seek ye first The Kingdom of God, and His righteousness; | //| and all these things shall be added unto you." | //| | //+------------------------------------------------------------------+ #property copyright "Bernard Citra" //--->Input Parameter extern int Start = 10; //FXDD server GMT+3 extern int Finish = 18; extern double Lot = 0.1; extern int Trigger = 15; extern int Limit = 150; extern int StopLoss = 80; extern int BreakEven = 30; //+------------------------------------------------------------------+ //| Main Program | //| | //+------------------------------------------------------------------+ int start() { int Ticket; int TicketBuy = 0; int TicketSell = 0; int MN=1; string Text="RealHour"+Symbol(); //set the order if (Hour()==Start && Minute()==1) { setOrder(Text,MN); } //Delete the opposite pending order once the 1st order is hit for (int i=0; i move stoploss to open price else { if (OrderType()==OP_BUY) { if(High[0]-OrderOpenPrice()>=BreakEven*Point && OrderStopLoss()=BreakEven*Point && OrderStopLoss()>OrderOpenPrice()) { OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Green); } } } } } return (0); } //+------------------------------------------------------------------+ //| Set Order Function | //| | //+------------------------------------------------------------------+ void setOrder (string Text, int MN) { double EntryLong, EntryShort, SLLong, SLShort, TPLong, TPShort; int Ticket; int Bought = 0; int Sold = 0; //Determine Price Range EntryLong = iHigh(NULL,60,Highest(NULL,60,MODE_HIGH,3,1))+(Trigger+MarketInfo(Symbol(),MODE_SPREAD))*Point; EntryShort = iLow (NULL,60,Lowest(NULL,60,MODE_LOW,3,1))-Trigger*Point; SLLong = EntryLong-StopLoss*Point; SLShort = EntryShort+StopLoss*Point; TPLong = EntryLong+Limit*Point; TPShort = EntryShort-Limit*Point; //send order for (int j=0;j