거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Twitter에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
조회수:
5476
평가:
(15)
게시됨:
2018.04.18 16:57
OpenTime 2.mq5 (45.87 KB) 조회
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

This EA is a further development of OpenTime version 1.


What's new in version 2

  • The EA now allows setting two time intervals, inside which positions can be opened;
  • It also allows setting the days of the week when opening of positions is allowed;
  • The following parameters can be specified independently for each time interval:
    • Trading type: BUY or SELL
    • Stop Loss
    • Take Profit

The same lot size and trailing function are used for the two intervals. The EA may have only one position in each time interval.

A unique magic number is generated for each time interval. The magic number for interval #1 magic is specified in input parameters:

input ushort         InpTakeProfitTwo  = 90;                      // TakeProfit time interval #2 (in pips)
input string _____3_____="Advisor Options";
input ulong          m_magic=714479490;                           // MagicNumber time interval #1 (time interval #2 == MagicNumber+1)
//---
input ulong m_slippage=30;

This magic number is saved in the internal m_magic_one variable, while the magic number of the interval #2 is saved in the internal m_magic_two variable, which is larger than m_magic_one by one:

//+------------------------------------------------------------------+
//---
#define m_magic_one m_magic
#define m_magic_two m_magic_one+1
//---
#include <Trade\PositionInfo.mqh>


Input Parameters

  • Positions closing options
    • Use closing time interval #1 - enable/disable closing by time for interval #1;
    • Closing time interval #1 (ONLY hour:minute!) - time to close a position for the interval #1 (only hours and minutes are taken into account);
    • Use closing time interval #2 - enable/disable closing by time for interval #2;
    • Closing time interval #2 (ONLY hour:minute!) - time to close a position for the interval #2 (only hours and minutes are taken into account);
    • Trailing stop ("0" -> trailing OFF) (in pips) - trailing stop function, 0 means that the function is disabled;
    • Trailing step (in pips) - trailing step value.
  • Positions opening settings
    • Trade on Monday - enabled/disable trading on Monday;
    • Trade on Tuesday - enabled/disable trading on Tuesday;
    • Trade on Wednesday - enabled/disable trading on Wednesday;
    • Trade on Thursday - enabled/disable trading on Thursday;
    • Trade on Friday - enabled/disable trading on Friday;
    • Opening start time interval #1 (ONLY hour:minute!) - the beginning of the time interval #1 (only hours and minutes are taken into account);
    • Opening end time interval #1 (ONLY hour:minute!) - the end of the time interval #1 (only hours and minutes are taken into account);
    • Opening start time interval #2 (ONLY hour:minute!) - the beginning of the time interval #2 (only hours and minutes are taken into account);
    • Opening end time interval #2 (ONLY hour:minute!) - the end of the time interval #2 (only hours and minutes are taken into account);
    • Duration in seconds - the duration of an operation in seconds;
    • Type of trade in time interval #1 ("true" -> BUY, "false" -> SELL) - trading type allowed in the interval #1: BUY or SELL;
    • Type of trade in time interval #2 ("true" -> BUY, "false" -> SELL) - trading type allowed in the interval #2: BUY or SELL;
    • Volume transaction - the volume of position to open;
    • StopLoss time interval #1 (in pips) - Stop Loss for positions in the interval #1;
    • TakeProfit time interval #1 (in pips) - Take Profit for positions in the interval #1;
    • StopLoss time interval #2 (in pips) - Stop Loss for positions in the interval #2;
    • TakeProfit time interval #2 (in pips) - Take Profit for positions in the interval #2.
  • Expert Advisor Options
    • MagicNumber time interval #1 (time interval #2 == MagicNumber+1) - the unique ID used for positions in the interval #1. The magic number for the interval #2 is greater by one.

Testing results for EURUSD,M30:

MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/20087

Patterns_EA Patterns_EA

The Expert Advisor is based on 30 popular candlestick patterns.

TAT (Trend Analyzer Tool) TAT (Trend Analyzer Tool)

MACD+SAR - Trend Analyzer Tool.

SerialMA_EA SerialMA_EA

The Expert Advisor is based on a dynamic moving average.

Sar_HTF Sar_HTF

The iSAR indicator with the possibility to change the indicator timeframe in input parameters, implemented in color.