Maximize Your Trading with Bands 2: An Expert Advisor for MetaTrader 5

Mike 2018.06.18 18:49 23 0 0
Attachments

Idea by: Scriptor.

MQL5 Code by: Vladimir Karputov.

Are you looking to enhance your trading strategy? The Bands 2 Expert Advisor (EA) for MetaTrader 5 is designed to make your trading experience smoother and more profitable. This strategy leverages the power of Bollinger Bands (BB) by analyzing the indicator values at the latest bar in relation to its closing price.

When the closing price of the current bar is inside the Bollinger Bands and no pending orders exist, the EA will automatically place three Buy Stop and three Sell Stop orders. The spacing between these orders is determined by the Step between pending orders parameter.

You can customize each order with your desired Take Profit levels, labeled as First Take Profit, Second Take Profit, and Third Take Profit. As for Stop Loss, you have the option to set it based on either the Bollinger Bands or a Moving Average, which can be adjusted via the Stop loss trailing parameter.

Order placement is restricted to a specific timeframe, defined by Hour start and Hour end. For example, if you set Hour end to 23, all pending orders will be automatically deleted at 11 p.m. Additionally, every new bar triggers the EA to place Buy Stop and Sell Stop orders based on the updated Bollinger Bands prices.

Enabling the trailing feature can further optimize your trading, provided that the Trailing Stop parameter is set above zero. You can even use the trailing feature to adjust your Stop Loss to breakeven by selecting StopLoss NONE for the Stop loss type. However, be mindful of any positions that may be left hanging at a loss, as those will need to be closed manually.


Input Parameters

  • Lots - Volume for pending orders;
  • Hour start - Starting hour for order placement;
  • Hour end - Ending hour for order placement;
  • Stop loss type - Choose how to set the Stop Loss (Moving Average, Bollinger Bands, or none);
  • First Take Profit - Take Profit for the first order in the series;
  • Second Take Profit - Take Profit for the second order in the series;
  • Third Take Profit - Take Profit for the third order in the series;
  • Trailing Stop - Enable trailing;
  • Trailing Step - Step for trailing;
  • Step between pending orders - Spacing between pending orders;
  • Magic number - Unique identifier for the EA.

Moving Average Indicator Parameters:

  • Moving Average: Averaging period - Period for averaging;
  • Moving Average: Horizontal shift - Shift of the indicator;
  • Moving Average: Smoothing type - Method of averaging;
  • Moving Average: Type of price - Price type used for the calculation;

Bollinger Bands Indicator Parameters:

  • Bands: Period for average line calculation - Calculation period for the average line;
  • Bands: Horizontal shift of the indicator - Shift of the Bollinger Bands indicator;
  • Bands: Number of standard deviations - Standard deviations for the bands;
  • Bands: Type of price - Price type for the bands.
List
Comments 0