거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Twitter에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
Experts

MultiMartin - MetaTrader 5용 expert

조회수:
16484
평가:
(32)
게시됨:
2019.12.05 22:13
업데이트됨:
2021.06.21 21:20
\MQL5\Include\MT4Bridge\
MT4Mode.mqh (0.72 KB) 조회
MT4Time.mqh (1.59 KB) 조회
MT4Orders.mqh (110.1 KB) 조회
MultiMartin.mq5 (18.59 KB) 조회
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

This is a multi-asset expert adviser based on martingale trading strategy. Its original idea is taken from another expert adviser - ExpMartin available for MT4.

Warning. Martingale is easy yet very dangerous strategy. Evaluate your risks carefully.

The strategy is to open reversal trades with increased lots after every loss, until a profitable trade occured or a maximal number of reversals achieved. In both cases next trade will start with initial lot.

MultiMartin trading 3 symbols in MT5 tester in visual mode

In comparison to the original one, this expert adviser demonstrates several points:

  • conversion from MT4 to MT5 (MT4Orders and other header files are used, please find all dependencies attached);
  • conversion from functional programming to OOP paradigm, which in essence makes it possible to fulfill the next objective:
  • adaptation from single-symbol to multi-symbol processing;
  • source code refactoring for easier reading and support;

Also some bugs were fixed.

The program can still be improved in many aspects, for example, operation by timer, volatility analysis, etc. are left out of consideration.


Input parameters

Specific symbol settings - used for step by step optimization on every work symbol (should be selected as current chart symbol).

  • UseTime - enable/disable new trades opening according to the range of hours [HourStart..HourEnd]; 
  • HourStart - starting hour of the range when new trades are allowed; takes effect if only UseTime is true; 
  • HourEnd - ending hour of the range when new trades are allowed; takes effect if only UseTime is true;
  • Lots - initial lot size;
  • Factor - multiplication factor for increased lots;
  • Limit - maximal number of multiplications, if reached - initial lot is used;
  • StopLoss - distance to stoploss in points (no automatic pip adjustement); 
  • TakeProfit - distance to takeprofit in points (no automatic pip adjustement);
  • StartType - trade type for starting order: o - buy, 1 - sell; 

Common settings - used for trading.

  • Magic - expert id;
  • SkipBadTime - an option to wait predefined period of time after trading errors (such as "not enough money", "lost connection" etc);
  • WorkSymbols - a string of work symbols and their specific settings, which should be selected after separate optimizations per every symbol; the settings for symbols are separated by semicolon; the format is "name±lots*factor^limit(sl,tp)[start,stop];...", for example "EURUSD+0.01*2.0^7(500,500)[2,22];AUDJPY+0.01*2.0^5(500,500)[1,21]" -- to trade EURUSD and AUDJPY starting with buying (the plus sign) of 0.01 lots, then multiplied by 2 on losses up to 7 or 5 times correspondingly, stoploss and takeprofit are all 500 points, trading window differs by 1 hour; 
  • Trail - a mode how to treat stop orders: none - fixed level stoploss (no trailing), break-even - trail after profit equal to stoploss size in points, straight - trail from very beginning (may end up with a loss up to the stoploss size in points, but not larger than that);

When used with multi-currency settings, it's advisable to place the expert to a chart with most liquid symbol (where ticks arrive most frequently and trading sessions are continuous), for example EURUSD. Alternatively, one can replace OnTick event handler with OnTimer and start a timer in OnInit.


Example reports

MultiMartin trade performance on EURUSD for 3 years 2016-2019

MultiMartin trade performance on EURUSD for 3 years 2016-2019

MultiMartin trade performance on EURUSD,AUDJPY,GBPCHF for 2019

MultiMartin trade performance on EURUSD,AUDJPY,GBPCHF for 2019


    Scalp All Scalp All

    Opens random positions on marketwatch symbols.

    LotLoss LotLoss

    Simple risk management tool.

    BPNN MQL Predictor Demo with library BPNN MQL Predictor Demo with library

    This is a demo indicator with BPNN neural network library ported from C++ to MQL.

    WmiFor 3.5 for MT5 (with DTW engine) WmiFor 3.5 for MT5 (with DTW engine)

    This indicator predicts future price movements by searching for similar candle patterns in the rate history.