• Overview
  • Reviews (4)
  • Comments (2)
  • What's new

Martingale EnvBBcci

The Martingale EnvBBcci Expert Advisor trades using the signals of the Envelopes, Bollinger Bands (BB) and Commodity Channel Index (CCI).

It enters the market on receiving signals from Env, BB and CCI indicators. The orders are closed either by CCI signal and the Profit_Percent_Risk parameter in case of a profit, or by the Close_position_Reverse signal in case of a loss, or by a stop loss in case of a loss. The Stop Loss level for the first and next orders is set either according to the SL_Daily_0_to_30 (SL_Points=0), or the SL_Points (SL_Daily_0_to_30=0) parameter, or by the Env and BB indicators (SL_Daily_0_to_30=0 and SL_Points=0).

The trading volume used for opening positions depends on the following parameters: Max_order_1_to_5, Risk_Money_SL, SL_Daily_0_to_30, SL_Points and Risk_Percent_Balans_SL. Martingale system, which proportionally increases the trade volume according to the specified parameters, is applied when you open a trade. To set a fixed lot for the first position, select the Risk_Money_SL and SL_Points parameters, while specifying SL_Daily_0_to_30=0 and Risk_Percent_Balans_SL=0.

The EA is optimized for EURUSD M30 0_00001. You should attach the EA to a chart and allow automated trading to let the Expert Advisor work. However, with the proper settings, it is also appropriate for any timeframes and instruments.


  • Magic index - magic number assigned to the first trade; Magic_index+n is assigned to next trades, where n is a number of opened positions.
Note: Regardless of the amount of opened positions set in the Max_order 1 to 5 parameter, the EA reserves 5 magic numbers. If the magic number is equal to 1, do not use the next 4 numbers with this symbol. Instead, start from 6, etc.;
  • Max order 1 to 5 - maximum amount of opened positions but not greater than 5. Martingale is used;
  • Risk Money SL - amount of money, which can be lost if Stop Loss triggers;
  • Risk Percent Balans SL - risk percentage of the deposit balance. The risk is calculated as a maximum value between Risk_money_SL and Risk_Percent_Balans_SL and used to calculate an autolot;
  • Profit Percent Risk - percentage of targeted profit when closing positions from Risk_money_SL or Risk_Percent_Balans_SL;
  • CCI Period - CCI indicator period;
  • CCI Noise - CCI indicator noise level: upper _level=0+CCI_noise, lower _level=0-CCI_noise;
  • Period EnvBB - period of the Bollinger Bands and Envelopes indicators;
  • Filter Deviat BB - Bollinger Bands indicator deviation (0 - filter disabled);
  • Filter Deviat Env - Envelopes indicator deviation (0 - filter disabled);
  • Trailing Stop Points - trailing stop, in points;
  • Break Even Points - move an order to breakeven, in points;
  • SL Points - stop loss in points is calculated as a maximum value between SL_Daily_0_to_30 and SL_Points (if SL_Daily_0_to_30=0 and SL_Points=0, a stop loss is set by the BB or Env indicator parameters);
  • SL Daily 0 to 30 - stop loss by daily High and Low levels changes from 0 to 30 and is calculated as a maximum value between SL_Daily_0_to_30 and SL_Points (if SL_Daily_0_to_30=0 and SL_Points=0, a stop loss is set by the BB or Env indicator parameters);
  • Close Position Reverse - close positions regardless of the profit when a trend reversal signal appears.

Attention: The default settings are not universal ones. You should define an asset, a timeframe and the parameters to ensure the EA correct operation!

Matthew Todorovski
Matthew Todorovski 2018.06.25 07:29 

1 Star (20%) = Bad

2 Stars (40%) = Undecided (still testing)

3 Stars (60%) = Okay

4 Stars (80%) = Good

5 Stars (100%) = Excellente!

Andrey Litvichenko
Andrey Litvichenko 2017.10.27 08:29 

User didn't leave any comment to the rating

Oksana Machok
Oksana Machok 2017.02.08 14:06 

User didn't leave any comment to the rating

Ovidiu Caslariu
Ovidiu Caslariu 2016.05.07 23:48 

User didn't leave any comment to the rating

Version 1.8 - 2015.08.28
- Added new parameter Money_Minimum_Profit_Reverse, which closes an open position upon a reversal signal if the position profit exceeds the value specified in the parameter.
- Added new parameter Martingale_Trading_Signals, which activates martingale order trading based on CCI signals.
- Added a function of trading with all indicator signals disabled;
- Improved Martingale based position placing algorithm.
- Minor renaming of some parameters for better clarity.
Version 1.7 - 2015.08.17
1) Added trading signal function "Breakdown OR Rebound " if:
-EnvBB_Strategy_Breakdown = true;
-EnvBB_Strategy_Rebound = true.

Version 1.6 - 2015.08.14
-Added a new parameter: "Control_profit_martingale". Control over profitable positions placed by Martingale.
-Added parameters for selecting a trading strategy by Envelopes, Bollinger Bands and CCI;
-Removed the SL Daily 0 to 30 parameter;
-The TS_Percent_maxSL parameter is replaced by TS_Points, trailing stop in points;
-The BE_Percent_maxSL parameter is replaced by BE_Points, modifies stop loss into breakeven, points;
-Added a new function: if SL_Points=0, stop loss is placed by parameters of EnvBB indicators;
-Added a new function: if CCI_Period is greater than Period_EnvBB, the EnvBB period is set by parameters of CCI_Period.
Version 1.5 - 2015.06.29
New function Spread_Max allows the Expert Advisor to trade only if the current spread is below Spred_Max.
Version 1.4 - 2015.06.25
-Improved the filter of the first position entry for the bar Shift Back=1 by High and Low;
-The Trailing_Stop_Points parameter is replaced by the TS_Percent_maxSL parameter, which modifies stop loss as percentage of the stop loss parameter;
-The Break_Eve_Points parameter is replaced by the BE_Percent_maxSL parameter, which modifies stop loss into breakeven as percentage of the stop loss parameter;
-Deleted the function of placing stop loss by Env and BB (when SL_Daily_0_to_30=0 and SL_Points=0);
-Optimized for M30 EURUSD 0.00001 2010-2015 by open prices (recommended to re-optimize for your broker and timeframe).
Version 1.3 - 2015.06.19
- Added new Independent_Trade function which activates a mode of simultaneous independent trading for Buy and Sell.
- The Magic_index is changed to the Magic_uses_10 parameter. It reserves 10 magic numbers. If magic number is 1, do not use next 9 numerals for this pair in the terminal but start from 10 etc.
Version 1.2 - 2015.06.17
Added the new Trade_Opening_Prices function that enables trading by Open prices. Otherwise, trading is performed at every tick.
Version 1.1 - 2015.06.15
Improved algorithm of placing orders by Martingale, control by profit is implemented instead of control by points.