Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal


This is a cross-platform МТ45 Expert Advisor - expert for MetaTrader 5

Andrey Kornishkin | English Русский 中文 Español Deutsch 日本語 Português

votes: 26
2017.11.03 12:32
MT45.mq4 (10.21 KB)view
MT45.mq5 (10.21 KB)view

Trading Strategy

After a losing trade, the МТ45 EA opens the next trade with a higher lot.

The first deal is always a Buy operation, after that positions alternate, i.e. buying-selling-buying.

The EA opens positions at the candlestick opening.

After a Stop Loss, the EA increases the lot by KL coefficient until it reaches the maximum value of ML. Then the lot is reset to the initial one, .

EURUSD, the Н1 timeframe. The EA is optimized at an interval of 11.01.2014-09.09.2017

Expert Advisor Settings

input int    Stop = 600;  // Stop Loss
input int    Take = 700;  // Take Profit
input int    Slip = 100;  // Slippage
input int    MN   = 123;  // Magic
input double LT   = 0.01; // Lot
input double KL   = 2;    // Lot increase ratio
input double ML   = 10;   // Maximum lot


The cross-platform mode is implemented using preprocessor directives. An example of the Martingale function:

//|                                                                  |
double Lot()
   double lot=LT;
//---  MQL4
#ifdef __MQL4__
      if(OrderProfit()>0) lot=LT;
      if(OrderProfit()<0) lot=OrderLots()*KL;

//---  MQL5
#ifdef __MQL5__
      double profit=HistoryDealGetDouble(HistoryDealGetTicket(HistoryDealsTotal()-1),DEAL_PROFIT);
      double LastLot=HHistoryDealGetDouble(HistoryDealGetTicket(HistoryDealsTotal()-1),DEAL_VOLUME);
      if(profit>0) lot=LT;
      if(profit<0) lot=LastLot*KL;



The МetaТrader 4 terminal:

The МetaТrader 5 terminal:


  • It is recommended to use this EA only as a basis for your own strategy.

Translated from Russian by MetaQuotes Software Corp.
Original code:

Anubis Anubis

The Expert Advisor trades using the signals of the following indicators: iStdDev (two indicators), iMACD, iCCI, iATR. Moving positions to breakeven.

OpenTime OpenTime

Opening and closing positions at a specified time.

Multi Time Frame Trader Multi Time Frame Trader

The Expert Advisor trades based on the i-Regr indicator signals.

SubWindow SubWindow

A library for working with chart subwindows.