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.
- 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!
- 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.
-EnvBB_Strategy_Breakdown = true;
-EnvBB_Strategy_Rebound = true.
-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.
-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).
- 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.