Opening and Сlosing on time – EA MetaTrader 5

Opening and Сlosing on time - expert for MetaTrader 5
The EA opens and closes positions at a specified time. Only HH:mm are considered in the inputs (time). Inputs: opening time (only HH:mm are considered) — position open time closing time (only HH:mm are considered) — position close time symbol — traded symbol volume transaction — position volume true -> Buy, false -> Sell — if

Opening and Сlosing on time v2 – EA MetaTrader 5

Opening and Сlosing on time v2 - expert for MetaTrader 5
The EA opens and closes positions at a specified time. The condition is additionally checked: for Buy —  if the fast iMA on the first bar exceeds the slow iMA                if(iMAGet(handle_iMAFast,1)>iMAGet(handle_iMASlow,1))                  {                   if(!RefreshRates())                      return;                   price=m_symbol.Ask();                   if(Extm_sl>0.0)                      sl=m_symbol.Bid()-Extm_sl;                   if(Extm_tp>0.0)                      tp=m_symbol.Bid()+Extm_tp;                   m_trade.Buy(m_lots,InpSymbol,price,sl,tp);                  } for Sell — if the fast iMA on