The writer of the speculation:Â vitaly
MQL5 code writer: barabashkakvn
The buying and selling technique is modest. BUY or SELL place is opened and safe by means of a pending Prohibit line at a distance of Delta 1. Upcoming, a grid consisting of Restrict or Prohibit pending orders at a distance of Delta 2 from one every other is created. The selection of pending orders of each and every route is ready in Max Traces. Pending orders (Purchase Restrict, Promote Restrict, Purchase Prohibit and Promote Prohibit) are eager by means of a unmarried PendingOrder serve as, to which a pending line sort (order_type), quantity (quantity), cancel loss (sl) and jerk benefit (tp) are handed
//+------------------------------------------------------------------+ //| Pending line                                                    | //+------------------------------------------------------------------+ void PendingOrder(ENUM_ORDER_TYPE order_type,double quantity,double worth,double sl,double tp)   {   sl=m_symbol.NormalizePrice(sl);   tp=m_symbol.NormalizePrice(tp);   if(m_trade.OrderOpen(m_symbol.Title(),order_type,quantity,0.0,       m_symbol.NormalizePrice(worth),m_symbol.NormalizePrice(sl),m_symbol.NormalizePrice(tp)))     {       if(m_trade.ResultOrder()==0)         {         Print("#1 ",EnumToString(order_type)," -> false. Result Retcode: ",m_trade.ResultRetcode(),               ", description of result: ",m_trade.ResultRetcodeDescription());         PrintResultTrade(m_trade,m_symbol);         }       else         {         Print("#2 ",EnumToString(order_type)," -> true. Result Retcode: ",m_trade.ResultRetcode(),               ", description of result: ",m_trade.ResultRetcodeDescription());         PrintResultTrade(m_trade,m_symbol);         }     }   else     {       Print("#3 ",EnumToString(order_type)," -> false. Result Retcode: ",m_trade.ResultRetcode(),             ", description of result: ",m_trade.ResultRetcodeDescription());       PrintResultTrade(m_trade,m_symbol);     } //---   }
When achieving the Benefit Alike goal benefit, akin all positions and take away all pending orders. You’ll be able to additionally akin all positions and delete pending orders for those who lose greater than Loss akin (for those who eager Loss akin to 0.0, the parameter is disabled).
The EA operation (opening positions and atmosphere protecting pending orders) is carried out throughout the operating hour break from Get started date to Finish date (Get started date is also not up to Finish date or exceed it).
Major concept
Inspecting ADX price on Paintings TimeFrame time frame. If ADX is beneath 40, this is regarded as to be flat, and Restrict pending orders are positioned. In a different way, Prohibit pending orders are old;
If DI+ is upper than DI-, purchase, another way, promote.
The most efficient optimization result of the 2 parameters (Tide bar ADX from 0 to two, step 1 and Paintings TimeFrame from M1 to H1)
EURUSD, Currenr bar ADX 0, Paintings TimeFrame H1
USDJPY, Currenr bar ADX 2, Paintings TimeFrame M1
In case of EURUSD, Tide bar ADX 0, Paintings TimeFrame H1, however the Loss Alike parameter is ready to “0.0”
and USDJPY, Tide bar ADX 2, Paintings TimeFrame M1, however the Loss Alike parameter is ready to “0.0”
Translated from Russian by means of MetaQuotes Ltd.
Untouched code: