Skip to main content

Tom Demark FX System

Tom Demark FX System strategy behavior

Tom Demark FX System combines an EMA crossover, a normalized momentum reading, and algorithmic trendlines drawn through recent swing highs and lows. A long entry requires a recent bullish EMA cross, momentum above its neutral level, and a recent close above a valid descending swing-high trendline.

The strategy uses a fixed fee-aware target. Optional protection starts with a fixed stop, then raises it in profit steps and can tighten it further near the upper part of the recent trading range.

The default one-hour period is intended for structured trend breakouts rather than high-frequency noise.

warning

Swing trendlines are calculated approximations, not manually drawn Tom Demark lines. Protection is disabled by default; technical exits do not deliberately close below break-even.

Entry setup

A long entry needs three events:

  1. The fast EMA recently crossed above the slow EMA.
  2. Current momentum is above TDFX_MOMENTUM_LEVEL.
  3. Price recently crossed above a valid descending trendline through swing highs.

The EMA cross and trendline break are each searched within TDFX_SIGNAL_LOOKBACK_CANDLES. They do not have to occur on the exact same candle. A larger lookback allows the two confirmations to arrive farther apart; a smaller one demands tighter timing.

The strategy opens one position at a time and does not average down.

EMA and momentum confirmation

TDFX_EMA_FAST and TDFX_EMA_SLOW define the crossover. Keep the slow length above the fast length.

Momentum compares the current close with the close TDFX_MOMENTUM_LENGTH candles earlier and normalizes the result around 100:

  • above 100 means price is higher than the comparison close;
  • below 100 means it is lower.

TDFX_MOMENTUM_LEVEL changes that neutral or confirmation threshold. Raising it demands more positive movement for buys. If you change it away from 100, remember that the mirrored sell condition uses the same level in the opposite direction.

Swing trendlines

TDFX_SWING_STRENGTH defines how many candles on both sides must confirm a local high or low. Larger values identify more prominent but less frequent swings.

TDFX_TRENDLINE_SWINGS sets how many recent swing points must be available to build each line. The strategy requires at least three.

For a long setup, recent swing highs must support a flat or descending line. Price must cross from at or below that line to above it.

TDFX_MAX_TRENDLINE_SLOPE_PCT rejects lines whose per-candle slope is too steep relative to their average price. This filters unstable or unrealistic projections. Setting it too low can leave the strategy without a valid line; setting it too high admits sharp structures that may not behave like useful resistance.

The mirrored sell setup uses a flat or rising line through swing lows and a downward break.

Target

The target uses:

  • TDFX_TARGET_PIPS × TDFX_PIP_SIZE in pip mode;
  • TDFX_TARGET_PCT in percentage mode.

It is raised when necessary to satisfy estimated round-trip fee break-even and TDFX_MIN_NET_GAIN_PCT.

The target remains active whether or not protection is enabled.

Protective stop and stepping

Enable TDFX_USE_PROTECTION to activate the stop.

The initial distance uses TDFX_STOP_PIPS or TDFX_STOP_PCT. As price advances, the strategy counts completed TDFX_TRAIL_STEP_PIPS or TDFX_TRAIL_STEP_PCT increments above average buy price.

After the first completed step, the stop moves to average buy price. Each additional completed step raises it by one trail step. The stop never moves lower after it has been stored.

Recent-range tightening

The strategy finds the high and low over TDFX_DAILY_RANGE_CANDLES and measures where current bid sits inside that range.

When progress reaches TDFX_TIGHTEN_AT_RANGE_PCT, the stop can tighten to:

current bid - max(one trail step, 25% of target distance)

This tightening also ratchets upward. Although the setting uses “daily” in its name, it is simply a candle count. On a one-hour chart, 24 candles approximate a day; on another period, they represent a different duration.

Technical exits

A complete mirrored sell setup can exit at the fee-aware profitable level:

  • recent bearish EMA cross;
  • momentum below the configured level;
  • recent downward break of a valid rising swing-low trendline.

The strategy also has a broader momentum/EMA exit when momentum is below the level and the fast EMA is below the slow EMA. This exit does not require a trendline break.

Neither technical exit has a separate user switch, and neither deliberately realizes a loss. Use the protective stop when a defined loss exit is required.

Good market conditions

Tom Demark FX System generally works best when:

  • the pair is liquid and spread is small;
  • a recognizable descending swing-high line forms;
  • price breaks that line with a recent bullish EMA cross;
  • momentum is clearly above neutral;
  • the hourly range leaves room for the fixed target;
  • swing structure is stable enough to produce valid trendlines.

A good setup often follows a consolidation with lower swing highs, then a breakout accompanied by improving EMA direction and positive momentum.

Avoid noisy markets with poorly defined swings, extremely steep trendlines, or repeated breaks that immediately reverse. Also avoid setting swing strength so high that valid lines rarely form.

Creating the strategy

Create a spot strategy and choose Tom Demark FX System as the buy and sell method. Start with backtesting or paper trading on the default one-hour period.

A practical setup sequence is:

  1. Select a liquid pair.
  2. Keep the default 9/30 EMA and momentum settings initially.
  3. Inspect whether detected swing lines match visible structure.
  4. Tune signal lookback before changing all indicator lengths.
  5. Choose pip or percentage risk values.
  6. Decide whether to enable the stepped protective stop.
  7. Review recent-range tightening on the chosen period.
  8. Test false breakouts, ranges, and sustained trends.

Strategy settings

Trading and execution

SettingDescription
BUY_ENABLEDEnables new buy orders.
SELL_ENABLEDEnables target, technical, and protective sell orders.
PERIODCandle period used for all calculations; the default is 60 minutes.
TRADING_LIMITCompatibility fallback only. It is ignored while the strategy-specific trading limit contains a positive value. Configure the strategy-specific setting for normal use. For USDT-BTC, this value is in USDT.
TDFX_TRADING_LIMITFor USDT-BTC, the amount of USDT used for an entry.
FUNDS_RESERVEFor USDT-BTC, the amount of USDT the bot must leave unused.
KEEP_QUOTEFor USDT-BTC, the amount of BTC the strategy must not sell.
MIN_VOLUME_TO_BUYGeneral minimum buy value. For USDT-BTC, this value is in USDT.
MIN_VOLUME_TO_SELLGeneral minimum sell value. For USDT-BTC, this value is in USDT.
TDFX_MIN_ORDER_VALUEStrategy-specific minimum entry value. For USDT-BTC, this value is in USDT.
TDFX_MIN_SELL_VALUEStrategy-specific minimum exit value. For USDT-BTC, this value is in USDT.
GAINGeneral gain fallback retained in the configuration.
TDFX_COOLDOWN_MSMinimum delay in milliseconds between actions.
TDFX_ENFORCE_COOLDOWN_IN_BACKTESTApplies the cooldown during backtests as well as live trading.
TDFX_MAX_SPREAD_PCTMaximum permitted spread as a percentage.
TDFX_MAX_SPREAD_ABSOLUTEOptional maximum spread in USDT for a pair such as USDT-BTC. 0 disables it.
TDFX_NEWS_BLOCKManually blocks new entries while existing positions remain manageable.
TDFX_NEWS_BLOCK_UNTILBlocks entries until the configured time.

EMA, momentum, and trendline signal

SettingDescription
TDFX_EMA_FASTFast EMA length.
TDFX_EMA_SLOWSlow EMA length; keep it above the fast length.
TDFX_MOMENTUM_LENGTHCandles between the current close and momentum comparison close.
TDFX_MOMENTUM_LEVELThreshold above which momentum confirms buys and below which it confirms sells.
TDFX_SWING_STRENGTHCandles on each side required to confirm swing highs and lows.
TDFX_TRENDLINE_SWINGSRecent swing points required to build a trendline; minimum three.
TDFX_SIGNAL_LOOKBACK_CANDLESRecent window in which the EMA cross and trendline break may have occurred.
TDFX_MAX_TRENDLINE_SLOPE_PCTMaximum accepted absolute per-candle trendline slope percentage.

Target and protection

SettingDescription
TDFX_USE_PIPSUses pip distances instead of percentage distances.
TDFX_PIP_SIZEFor USDT-BTC, the USDT value represented by one pip.
TDFX_STOP_PIPSInitial stop distance in pip mode.
TDFX_TARGET_PIPSTarget distance in pip mode.
TDFX_TRAIL_STEP_PIPSProfit-step and stop-step size in pip mode.
TDFX_STOP_PCTInitial stop distance in percentage mode.
TDFX_TARGET_PCTTarget distance in percentage mode.
TDFX_TRAIL_STEP_PCTProfit-step and stop-step size in percentage mode.
TDFX_USE_PROTECTIONActivates the initial, stepped, and range-tightened stop.
TDFX_MIN_NET_GAIN_PCTMinimum intended gain beyond estimated round-trip fee break-even.

Recent-range tightening

SettingDescription
TDFX_DAILY_RANGE_CANDLESCandles used to define the recent high-to-low range.
TDFX_TIGHTEN_AT_RANGE_PCTPosition within that range at which stop tightening begins.

Backtesting range

SettingDescription
BF_SINCEStart of the selected backtesting period.
BF_UNTILEnd of the selected backtesting period.
DEEP_TESTINGEnables deeper backtesting mode in the editor.

Practical tuning directions

For stricter breakout timing, reduce TDFX_SIGNAL_LOOKBACK_CANDLES. Increase it when the EMA and trendline confirmations legitimately arrive on adjacent candles.

Increase swing strength for cleaner, more important pivots. If lines rarely appear, reduce strength or review the number of required swings and slope limit.

Choose trail steps relative to normal candle movement. Steps that are too small can move the stop into ordinary noise; very large steps preserve more risk for longer.

On periods other than one hour, reinterpret TDFX_DAILY_RANGE_CANDLES explicitly rather than assuming it still represents one day.

Important limitations

  • Trendlines are algorithmic approximations through confirmed swings.
  • Swing confirmation introduces delay.
  • EMA cross and trendline break can occur on different candles within the lookback.
  • Technical exits do not deliberately realize a loss.
  • The stepped and tightened stop do nothing unless protection is enabled.
  • “Daily range” is a candle count, not a fixed calendar day.
  • Pip size must match the market’s price scale (USDT per BTC on USDT-BTC).
  • Backtests cannot perfectly reproduce live spread, slippage, latency, or liquidity.

Tom Demark FX System works best when three independent observations agree: trend direction changes, momentum is positive, and price breaks a credible descending swing line. If the trendline itself is unstable, loosening the other filters will not make the setup stronger.