Proffessor v3 - MetaTrader 5 Expert | MT5 EA Download - MetaTrader 5 Resources






Author of this idea : Vitality
MQL5 code author : Balabashka Kong
The trading strategy is simple. A buy or sell position is opened and protected by a pending stop-loss order at a distance of Delta 1 . Then, a grid consisting of limit or stop orders placed at a distance of Delta 2 from each other is created. The number of pending orders in each direction is set in Max Lines. Pending orders (Buy Limit, Sell Limit, Buy Stop and Sell Stop) are passed through a single pending order function, where Pending Order Type ( Order Type ), Volume ( Volume ), Stop Loss ( SL ) and Take Profit ( TP ) are passed
//+------------------------------------------------------------------+ //|Pending orders | //+------------------------------------------------------------------+ Blank pending order ( ENUM_ORDER_TYPE order type, double volume, double price, double SL, double tp) { sl=m_symbol.NormalizePrice(sl); tp=m_symbol.NormalizePrice(tp); If (m_trade.OrderOpen(m_symbol.Name(), order type, trading volume, 0.0 , m_symbol.NormalizePrice(price),m_symbol.NormalizePrice(sl),m_symbol.NormalizePrice(tp))) { if (m_trade.ResultOrder()== 0 ) { Print ( "#1" , enumeration to string (order type), "-> false. Result recoding: " ,m_trade.ResultRetcode(), ", result description: " ,m_trade.ResultRetcodeDescription()); PrintResultTrade(m_trade,m_symbol); } other { Print ( "#2" , enumeration to string (order type), "-> true. Result recoding:" , m_trade.ResultRetcode(), ", result description: " ,m_trade.ResultRetcodeDescription()); PrintResultTrade(m_trade,m_symbol); } } other { Print ( "#3" , enumeration to string (order type), "-> false. Result recoding: " ,m_trade.ResultRetcode(), ", result description: " ,m_trade.ResultRetcodeDescription()); PrintResultTrade(m_trade,m_symbol); } //--- }
When the profit is reached, the target profit is closed , all positions are closed and all pending orders are deleted. If your loss exceeds, you can also close all positions and delete pending orders for loss closure (if you set loss closure to 0.0, this parameter is disabled).
EA operations (opening positions and setting protective pending orders) are performed within the working time interval from the start time to the end time ( the start time may be smaller than the end time or exceed it).
Analyze the approximate time of the ADX value working time range . If ADX is below 40, it is considered flat and a limit pending order is placed. Otherwise, use a stop-loss pending order;
If DI+ is higher than DI-, buy, otherwise sell.
Best optimization result of two parameters ( current column ADX from 0 to 2, step 1 and working time range from M1 to H1)
EURUSD, current column ADX 0, working time range H1

USDJPY, current column ADX 2. Working time range M1

In the case of EURUSD, the current bar ADX is 0, the working time frame is H1, but the loss closing parameter is set to "0.0"

and USDJPY, current bar ADX 2, working time range M1, but the loss closing parameter is set to "0.0"

Attachment download
📎 proffessor_v3.mq5 (47.7 KB)
Source: MQL5 #22084
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •