#include input double Lots = 0.1; input int TpPoints = 500; input int SlPoints = 500; input string OpenTime = "16:00"; datetime lastSignal; ulong posTicket; CTrade trade; int OnInit(){ return(INIT_SUCCEEDED); } void OnDeinit(const int reason){ } void OnTick(){ datetime openTime = StringToTime(OpenTime); if(lastSignal != openTime && TimeCurrent() > openTime){ lastSignal = openTime; Print("Open time reached..."); double ask = SymbolInfoDouble(_Symbol,SYMBOL_ASK); ask = NormalizeDouble(ask,_Digits); double tp = ask + TpPoints * _Point; tp = NormalizeDouble(tp,_Digits); double sl = ask - SlPoints * _Point; sl = NormalizeDouble(sl,_Digits); if(trade.Buy(Lots,_Symbol,ask,sl,tp,"TimeTrader")){ posTicket = trade.ResultOrder(); } } }