OpenTime 2 - MetaTrader 5 Expert | MT5 EA Download - MetaTrader 5 Resources

The EA is open for further development version 1.
Both intervals use the same lot and trailing functions. The EA may have only one position per time interval.
A unique magic number is generated for each time interval. The magic number specifying interval #1 magic is in the input argument :
Enter ultra-short InpTakeProfitTwo = 90 ; // Take profit interval #2 (in pips) Enter string _____3_____= "Advisor Options" ; Enter m_magic = 714479490 ; // MagicNumber Interval #1 (Interval #2 == MagicNumber+1) //--- Enter own m_slippage = 30 ;
This magic number is stored in the internal m_magic_one variable, and the magic number for range #2 is stored in the internal m_magic_two variable, which is greater than m_magic_one by one:
//+------------------------------------------------------------------+ //--- #define m_magic_one m_magic #define m_magic_two m_magic_one+ 1 //--- #Include <Trading\PositionInfo.mqh>
EURUSD, M30 test results:

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