This is an old revision of the document!


Dynamic Trend Duo Expert Advisor


The alphaheim Dynamic Trend Duo (DTD) is a fully automated trading expert advisor (EA) based upon two proprietary price action determinants. The first metric inspects the behaviour of the trend depth and assigns one of three biases, namely, bullish, bearish or ranging. The second metric determines the trend based upon recent close prices relative to specific highs and lows. The EA allows initial trade triggers to be determined by a single metric, with a confirmation of the alternate metric, with the order of precedence interchangeable.

Our DTD EA grows the account utilising dynamic risk management, with a strong factoring of current market volatility. The EA will inspect the reading of the ATR and set the initial trading lot size accordingly.

There are no stop losses used within this EA, but can be set manually if desired. The ideal utilisation allures to allowing multiple trades, and lowering the target price level, in the case of an incorrect signal. This means that when the maximum number of trades is set to higher than 1, there will be an omni-directional grid forming. The target for the grid will be based on the average buying price plus the user defined target (in pips). For our US clients, we have added functionality to allow for FIFO compliant trading.

  • Each trade associated with the current instance of the EA will have this unique number associated with it.
  • For trading to be compliant with FIFO regulations, this input must be set to true when the “Max. # Open Trades” is greater than 1. When activated, the initial lot size will assume the identical lot size to standard operation, but for each additional trade the minimum lot size for the given symbol will be added.
  • For example, assume the minimum lot size is 0.01, and the base lot size is 1.00, with 4 maximum trades. The 1st trade will be for 1.00, with the 2nd at 1.01, 3rd at 1.02 and 4th at 1.03.
  • For any given signal, this is the maximum number of trades for a single signal.
  • The spacing of additional trades will depend on the ATR settings defined below.
  • If you would like to hide the Take Profit from your broker, set to true.
  • When enabled, lines will be drawn on the chart to indicate profit targets.
  • Please note, hidden TPs automatically account for the spread. In the case of a short position, the symbol’s Ask price must be below the TP, rather than just the Bid price, as shown by default on MetaTrader.
  • Isolate trading to a single direction.
  • When set to “Dynamic Balance Risk”, the EA will auto-calculate the lot size, based upon the “Balance Risk % (Dynamic)” and ATR settings defined below. This is only an augmented calculation – meaning the drawdown for a given basket will not be restricted to the defined “Balance Risk % (Dynamic)”.
  • When set to “Fixed”, the EA will use the “Lot Size (Fixed)” input to determine the trading lot size. In the case of FIFO disabled, every trade will assume this size.
  • When “Position Size Method” is set to “Dynamic Balance Risk”, the base lot size will be calculated upon this value. The EA will take the current account balance, and take the Balance Risk, as a percentage. Then, dependent on the current ATR reading, the trading lot size will be adjusted accordingly.
  • The average target for a given basket of trades, defined in pips.
  • Examples of long trading baskets, with input set at 12
    • 1 Trade, entered at 1.000
      • Target = 1.012
    • 2 Trades, entered at 1.000 and 0.900
      • Target = (1.000+0.900)/2 + 0.012 = 0.962
    • 3 Trades, entered at 1.000, 0.900 and 0.800
      • Target = (1.000+0.900+0.800)/3 + 0.012 = 0.912
  • Only used when “Max. # Open Trades” greater than 1.
  • Input defines the minimum gap between trades. This acts as a safety net if the ATR reading, combined with the “ATR Multiplier” is too low.
  • Volatility assessment (ATR) from the defined timeframe.
  • Averaging period for the ATR indicator.
  • When utilising basket trading, this multiplier is used.
  • For example, if in a long position at 1.000, the price must drop to 1.000- (ATR[current]*Multiplier).
  • Please note, this multiplier is not used when determining the trading lot.
  • As all positions are entered at market prices, the slippage should not be a significant factor. Please adjust based on the average slippage for your broker.
  • The default value of 3 is set for ECN brokers with Forex.
  • If trading on an Index, or similar, it would be wise to adjust up to 30-300.
  • Receive Pop-Up alerts within the terminal.
  • Receive alerts within all connected mobile devices.
  • For this feature to operate, you must have the MetaTrader mobile app installed on your device, and you must enter the device’s MetaQuotes ID into the main MetaTrader terminal, under Tools→Options→Notifications.
  • Receive alerts at the specified email address.
  • For this feature to operate, you must define email settings into the main MetaTrader terminal, under Tools→Options→Email.
  • Determines the order in which indicators are logically checked for a potential trade.
  • “Trend Depth Change”
    • The trade is triggered when a change in trend depth is detected.
    • The depth change is confirmed with the direction of the price action Shackle.
  • “Shackle Change”
    • The trade is triggered when a change in price action shackle is detected.
    • The shackle change is confirmed with the bias of the trend depth.
  • When set to true, and “Position Size Method” is set to “Dynamic Balance Risk”, there is an additional check for the initial trading lot.
  • After inspection of the ATR reading, if the ATR is below the “Minimum Step (Pips)”, the minimum step is used to calculate the lot size, rather than ATR.
  • Show profit on the upper left information panel.
  • Show EA magic number on the upper left information panel.
  • Create button to close all trades within specific instance of EA with a single click.
  • This will not close all trades for the account. It will only close trades related to the specific EA, for which profit is currently being tracked.
  • If the information panel on the top left is unreadable, this scaling option increases readability.
  • Allows usage of the trading restrictions based on day/time below.
  • Restricts trade entry to the days specified.
  • Restricts trade entry to the strike times defined below.
  • The starting trading time for a specified zone.
  • Please note, the dates for the start do not need to be defined, and are not looked at.
  • For example, if “Zone 1 Start” is set to “1990.01.01 00:45”, Zone 1 will activate at 12:45am for every trading day which is permitted.
  • The ending trading time for a specified zone.
  • Please note, the dates for the end do not need to be defined, and are not looked at.
  • For example, if “Zone 1 End” is set to “1990.01.01 06:00”, Zone 1 will terminate at 6:00am for every trading day which is permitted.
  • Closes all positions on Friday, x hours before specified “Zone 3 End” time.
  • Where x is “Weekend Close Shift (Hours vs Zone 3)”
  • The trend depth will be derived from the specified timeframe.
  • The internal depth for the calculation.
  • A depth of 1 is equivalent to a 1 bar fractal.
  • It is recommended to keep this input as 1, but may be adjusted to 2.
  • When set at higher depths, the sensitivity is heavily reduced. We do not recommend setting the value higher than 3.
  • The Price Action Trend Shackle will be derived from the specified timeframe.
  • The length for which close prices should be compared against highs and lows to attain the Trend Shackle Bias.
  • There is sufficient flexibility in this input, and can be set at any value. We do not recommend values less than 10, or greater than 250.

Our internally calculated Trend Depth bias forms 50% of the trigger for the DTD EA. The Trend Depth analyses the behaviour of fractals with specified depth. The formation of a single Higher High (HH) or Lower High (LH) does not automatically shift the Trend Depth bias to bullish. The reverse logic for Lower Lows (LL) and Higher Lows (HL) has a similar irrelevance for a bearish bias. Our proprietary algorithm uses the key points relative to other critical metrics, and then assigns a bias of bullish, bearish or ranging.

Please note, due to the proprietary nature of the determinant, it will not be visible on the chart during testing or live operation.

The remaining 50% of the DTD trade trigger is derived from the Price Action Trend Shackle. The shackle inspects the close price, or current price in the case of the current candle, relative to the behaviour of highs and lows within the defined Shackle Length.

Please note, due to the proprietary nature of the determinant, it will not be visible on the chart during testing or live operation.  

Once an EA has been applied to a specific chart, for a specific timeframe, the EA will only continue for as long as the conditions remain. If the chart timeframe is changed altered when an EA is active, the EA will de-initialise, then reinitialize as if new. This will also occur if the EA settings are altered after it has already applied. If the EA has placed a trade, and any of the above occur, the EA will no longer track the trades that have been opened. This circumstance will extend where your VPS/machine restarts during an open grid.

For simplicity, and workability across symbols, the definition of a pip has been simplified.
For 5-Digit symbols, a pip is classified as 0.00010.
For 3-Digit symbols, or less, a pip is defined as 0.010.
Please take this into careful consideration when applying the EA to metals and equities.
For example

  • If EURUSD is defined similar to 1.18581, i.e. has 5 digits, a single pip is 0.00010.
  • If USDJPY is defined similar to 103.834, i.e. has 2 digits, a single pip is 0.010.
  • If Gold (XAUUSD) is defined similar to 1870.91, i.e. has 2 digits, a single pip is 0.01.

It is highly recommended to utilise this EA on MetaTrader 5, where possible.

For this EA, the main advantages of MT5 can be utilised due to the higher number of available timeframes. Both trade triggers and volatility assessment have effective use on timeframes not available on MT4, such as H6 and H12.

Please note, the EA will not function on MetaTrader 5 Netting Accounts. Currently, we only support MetaTrader 5 accounts which are structured as Hedging Accounts. We aim to provide support for Netting accounts in the near future. All MetaTrader 4 accounts are supported.

When utilising the strategy tester on MT4, please be aware of the draw-down limitation. The reported draw-down figure is maximal, and does not reflect the maximum relative draw-down, a feature which is included in MT5. For an EA such as this, the maximum relative DD is likely to be higher than the result reported in MT4.

Under certain configurations, our DTD EA can return very high returns. Please be aware that under these conditions, there is a high maximal relative draw-down.