• 概述
  • 评论
  • 评论 (18)
  • 新特性

Break MA Channel Martingale

Break MA Channel Martingale Expert Advisor is a part of the series "Simple trade strategies based on moving averages". Here you can find a short description of it. For more detailed description please refer to my blog TRADING WAY.

All operations are performed according to formed bars on the current timeframe. Two modified Moving Averages are used for forming the signal, one of them is shifted upward as specified in the parameters and the other one is shifted downwards. A download ling for the indicator is given below.

This version of the Expert Advisor additionally includes the possibility to move Stop Loss to breakeven zone. There is also a possibility to enable the martingale like function for managing positions volume - the volume of a deal coming after a losing deal is calculated as the volume of the losing deal multiplied by a coefficient specified in the input parameters.

The Expert Advisor can be used for semi-automated trading. Positions can be closed manually but trailed by the EA. Since the martingale method can be dangerous, you can close the position manually when the current profit becomes greater than previous losses.


The list of Expert Advisor parameters:

  • Indicator Period – period of the Moving Average indicator.
  • Vertical Shift – his parameter sets a vertical shift up and down for two Moving Averages (in points) relative to the main Moving Averages.
  • Mode Break – breakthrough mode. You can set up a breakthrough inside the channel (BREAK IN) and out of the channel (BREAK OUT).
  • Take Profit – distance in points from an entry point to the level of fixing a profit. If you set a zero value, the level of fixing a profit will not be set.
  • Stop Loss – distance in points from an entry point to the protection level. If you set a zero value, the protection level will not be set.
  • Trailing Stop – step in points used for modification of the protection level in the profitable direction. The level is calculated using maximums (High) for Sell positions and minimums (Low) for Buy positions. If you set a zero value, modification of the protection level will not be performed.
  • Reverse – in this parameter, one can specify if positions will be reversed in case an opposite signal appears.
  • Break Even Stop Loss - distance in points the price should go before Stop Loss is moved to breakeven. Zero value disables this function.
  • Break Even Offset - distance from the current price in points at which Stop Loss will be placed in the breakeven zone.
  • Lot – position volume.
  • Martingale Coefficient - if a position is losing, the volume of the next one will be multiplied by this coefficient. If the values is less than or equal to 1, the volume of the positions will be equal to the one specified in Lot parameter.
  • Initial Deposit - in this parameter, one should specify a value of the deposit starting from which the volume for positions will be calculated dynamically. This allows the EA increasing the profit faster. Zero value disabled the dynamic lot.
  • Maximum Lot Size - here one should specify the maximum value for positions opened. Probably, once you reach a certain size of the deposit it is better stop calculating the lot proportionally. Some traders use this tactics for aggressive increasing of deposit starting with a small amount of money, but then switching to a more conservative trading keeping the risk a low level.


Conditions:

A signal to open a position is true if the following conditions are fulfilled:

For a BUY position:

  • Crossing the lower border of the channel upward.

For a BUY position:

  • Crossing the upper border of the channel downward.

Exit from a Buy position if the price crosses the lower border downward or in case  Stop Loss/Take Profit triggers.

Exit from a SELL position if the price crosses the upper border upward or in case Stop Loss/Take Profit triggers


Additional parameters and features:

The Expert Advisor has two additional parameters:

  • On/Off Info Panel – enables/disables the informational and trading panel on the chart.
  • Setting "On The Fly" – enables/disables the possibility to adjust parameters using the informational and trading panel.

Several Expert Advisors from this series can be attached to different charts (symbols) without causing any conflicts in their operation.


Download link:

  •   Modified indicator - Moving Average (put it in the folder \MQL5\Indicators and compile).
  •   Library - SmoothAlgorithms (put it in the directory \MQL5\Include).

The image shows one of the results of testing of Break MA Channel Martingale. There is a possibility to use custom optimization criterion (Custom Max). The formula for it is not going to be disclosed for the moment.

You can get the same result on EURUSD H1 with default parameters.
无评论
版本 2.0 - 2014.06.20
Added two input parameters to extend the money management capabilities:

- Initial Deposit - in this parameter, one should specify a value of the deposit starting from which the volume for positions will be calculated dynamically. This allows the EA increasing the profit faster. Zero value disabled the dynamic lot.
- Maximum Lot Size - here one should specify the maximum value for positions opened. Probably, once you reach a certain size of the deposit it is better stop calculating the lot proportionally. Some traders use this tactics for aggressive increasing of deposit starting with a small amount of money, but then switching to a more conservative trading keeping the risk a low level.