# Stochastic 3TF Martingale

The **Stochastic 3TF Martingale** Expert Advisor is a part of the series 'Multi-timeframe trade strategies'. Here you can find a short description of it. For more information on how to use this Expert Advisor, the test results and the analysis of its operation please refer to the corresponding article published in 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.

One standard indicator **Stochastic** is used. Signals for opening and modifying positions are produced according to formed bars of timeframes specified in the parameters (up to three timeframes can be enabled).

### The list of Expert Advisor parameters:

**Timeframe 1**- the first timeframe.**K% Period**- period of the K% curve of the Stochastic indicator for the**first**timeframe. If you set a zero value, the indicator from this timeframe will not be considered.**D% Period**- period of the D% curve of the Stochastic indicator for the**first**timeframe.**Slowing**- period of smoothing of the Stochastic indicator for the**first**timeframe.**Timeframe 2**– the second timeframe.**K% Period**- period of the K% curve of the Stochastic indicator for the**second**timeframe. If you set a zero value, this parameter will not be considered.**D% Period**- period of the D% curve of the Stochastic indicator for the**second**timeframe.**Slowing**- period of smoothing of the Stochastic indicator for the**second**timeframe.**Timeframe 3**- the third timeframe.**K% Period**- period of the K% curve of the Stochastic indicator for the**third**timeframe. If you set a zero value, this parameter will not be considered.**D% Period**- period of the D% curve of the Stochastic indicator for the**third**timeframe.**Slowing**- period of smoothing of the Stochastic indicator for the**third**timeframe.**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 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.**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.**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:

The signal for opening positions is true when:

For a BUY position:

- The K% curve of the Stochastic indicator is above the D% curve on all the specified timeframes.

For a SELL position:

- The K% curve of the Stochastic indicator is below the D% curve on all the specified timeframes.

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

Find below one of the **Stochastic 3TF 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.

**版本 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.