# AMA 3TF VI Martingale

**AMA 3TF VI Martingale** is an Expert Advisor from the series "Trading systems with increasing volume of position". Here you can find a short description of it. For more information on how to use this Expert Advisor please visit my blog TRADING WAY.

This EA version includes an option for moving the protective **Stop Loss** to the breakeven level. You an also enable the Martingale type position volume control position, i.e. if a trade is losing, the next one is opened with the volume of the loss trade multiplied by the factor specified in external parameters.

The EA can be used for semiautomatic trading. You can open a position manually and let the EA maintain it. Since martingale based trading can be dangerous, you can close the position manually when the current profit is more than past losses.

It uses one standard indicator **Adaptive Moving Average**. Signals for opening and modifying positions are produced according to formed bars of three timeframes specified in the parameters. Modification of the **Trailing Stop** level is performed according to maximums/minimums of the current timeframe. Usually, this is the minimum timeframe indicated in the parameters.

### The list of Expert Advisor parameters:

**Magic Number**– magic number (identifier of trade operations of the Expert Advisor).**Deviation**– price slippage in points.**Timeframe 1**– the first timeframe.**AMA Period**– period for calculation of the efficiency rate for the**first**timeframe. If you set a zero value, the indicator from this timeframe will not be considered.**Fast AMA Period**– fast period for calculation of the smoothing rate for the**first**timeframe when the market moves fast.**Slow AMA Period**– slow period for calculation of the smoothing rate for the**first**timeframe when there is no trend.**Timeframe 2**– the second timeframe.**AMA Period**– period for calculation of the efficiency rate for the**second**timeframe. If you set a zero value, this parameter will not be considered.**Fast AMA Period**– fast period for calculation of the smoothing rate for the**second**timeframe when the market moves fast.**Slow AMA Period**– slow period for calculation of the smoothing rate for the**second**timeframe when there is no trend.**Timeframe 3**– the third timeframe.**AMA Period**– period for calculation of the efficiency rate for the**third**timeframe. If you set a zero value, this parameter will not be considered.**Fast AMA Period**– fast period for calculation of the smoothing rate for the**third**timeframe when the market moves fast.**Slow AMA Period**– slow period for calculation of the smoothing rate for the**third**timeframe when there is no trend.**Take Profit**– level of fixing the profit, which is indicated in points from the position open price. If the value is set to zero, Take Profit will not be set.**Stop Loss**– protective level, which is indicated in points from the position open price. If the value is set to zero, Stop Loss 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) of bars for Sell positions and minimums (Low) of bars for Buy positions. If the value is set to zero, the protective level will not be modified.**Reverse**– in this parameter, one can specify if positions will be reversed in case an opposite signal appears. Value 'true' means that positions will be reversed if an opposite signal appears.**Break Even Stop Loss**- distance in points that a price should pass to set the**Stop Loss**to breakeven. A value of zero disables this feature.**Break Even Offset**- a distance in points at which**Stop Loss**will be placed in the breakeven level relative to the current position price.**Lot**– position volume (lot).**Martingale Coefficient**- if a position is losing, the next one will be opened with a volume multiplied by this coefficient. If the value is less than or equal to 1, then the position volume is equal to that specified in the**Lot**parameter.**Volume Increase**– the amount to increase the position volume by in case the condition is true. If you set a zero value, the volume will not be increased.**Volume Increase Step**– distance from the last deal in points the price should pass before the condition for increasing the volume is considered true.**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:

- The
**AMA**indicator grows on all timeframes. I.e. the previous value is lower than the current one. - If a position is opened, the model of increasing the volume starts its operation in the Expert Advisor. The volume is increased if the price goes in the profitable direction and reaches the level, which is calculated for Buy positions as the last deal price plus the number of points indicated in
**Volume Increase Step**. The close price of the formed bar must be above the calculated level.

For a SELL position:

- The
**AMA**indicator falls on all timeframes. I.e. the previous value is greater than the current one. - If a position is opened, the model of increasing the volume starts its operation in the Expert Advisor. The volume is increased if the price goes in the profitable direction and reaches the level, which is calculated for SELL positions as the last deal price minus the number of points indicated in
**Volume Increase Step**. The close price of the formed bar must be below the calculated level.

### Additional parameters and features:

The Expert Advisor additional parameters:

**On/Off Info Panel**– enables/disables the informational and trading panel in the left part of 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.

Find below one of the **AMA 3TF VI Martingale** testing results. You can also use a custom optimization criterion (**Custom Max**). I will not disclose its formula here.

You can have the same result on the H1 timeframe, EURUSD with the default settings.

**Version 2.0 - 2014.06.20**

- 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.