Tom Demark FX System

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:
- The fast EMA recently crossed above the slow EMA.
- Current momentum is above
TDFX_MOMENTUM_LEVEL. - 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_SIZEin pip mode;TDFX_TARGET_PCTin 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:
- Select a liquid pair.
- Keep the default 9/30 EMA and momentum settings initially.
- Inspect whether detected swing lines match visible structure.
- Tune signal lookback before changing all indicator lengths.
- Choose pip or percentage risk values.
- Decide whether to enable the stepped protective stop.
- Review recent-range tightening on the chosen period.
- Test false breakouts, ranges, and sustained trends.
Strategy settings
Trading and execution
| Setting | Description |
|---|---|
BUY_ENABLED | Enables new buy orders. |
SELL_ENABLED | Enables target, technical, and protective sell orders. |
PERIOD | Candle period used for all calculations; the default is 60 minutes. |
TRADING_LIMIT | Compatibility 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_LIMIT | For USDT-BTC, the amount of USDT used for an entry. |
FUNDS_RESERVE | For USDT-BTC, the amount of USDT the bot must leave unused. |
KEEP_QUOTE | For USDT-BTC, the amount of BTC the strategy must not sell. |
MIN_VOLUME_TO_BUY | General minimum buy value. For USDT-BTC, this value is in USDT. |
MIN_VOLUME_TO_SELL | General minimum sell value. For USDT-BTC, this value is in USDT. |
TDFX_MIN_ORDER_VALUE | Strategy-specific minimum entry value. For USDT-BTC, this value is in USDT. |
TDFX_MIN_SELL_VALUE | Strategy-specific minimum exit value. For USDT-BTC, this value is in USDT. |
GAIN | General gain fallback retained in the configuration. |
TDFX_COOLDOWN_MS | Minimum delay in milliseconds between actions. |
TDFX_ENFORCE_COOLDOWN_IN_BACKTEST | Applies the cooldown during backtests as well as live trading. |
TDFX_MAX_SPREAD_PCT | Maximum permitted spread as a percentage. |
TDFX_MAX_SPREAD_ABSOLUTE | Optional maximum spread in USDT for a pair such as USDT-BTC. 0 disables it. |
TDFX_NEWS_BLOCK | Manually blocks new entries while existing positions remain manageable. |
TDFX_NEWS_BLOCK_UNTIL | Blocks entries until the configured time. |
EMA, momentum, and trendline signal
| Setting | Description |
|---|---|
TDFX_EMA_FAST | Fast EMA length. |
TDFX_EMA_SLOW | Slow EMA length; keep it above the fast length. |
TDFX_MOMENTUM_LENGTH | Candles between the current close and momentum comparison close. |
TDFX_MOMENTUM_LEVEL | Threshold above which momentum confirms buys and below which it confirms sells. |
TDFX_SWING_STRENGTH | Candles on each side required to confirm swing highs and lows. |
TDFX_TRENDLINE_SWINGS | Recent swing points required to build a trendline; minimum three. |
TDFX_SIGNAL_LOOKBACK_CANDLES | Recent window in which the EMA cross and trendline break may have occurred. |
TDFX_MAX_TRENDLINE_SLOPE_PCT | Maximum accepted absolute per-candle trendline slope percentage. |
Target and protection
| Setting | Description |
|---|---|
TDFX_USE_PIPS | Uses pip distances instead of percentage distances. |
TDFX_PIP_SIZE | For USDT-BTC, the USDT value represented by one pip. |
TDFX_STOP_PIPS | Initial stop distance in pip mode. |
TDFX_TARGET_PIPS | Target distance in pip mode. |
TDFX_TRAIL_STEP_PIPS | Profit-step and stop-step size in pip mode. |
TDFX_STOP_PCT | Initial stop distance in percentage mode. |
TDFX_TARGET_PCT | Target distance in percentage mode. |
TDFX_TRAIL_STEP_PCT | Profit-step and stop-step size in percentage mode. |
TDFX_USE_PROTECTION | Activates the initial, stepped, and range-tightened stop. |
TDFX_MIN_NET_GAIN_PCT | Minimum intended gain beyond estimated round-trip fee break-even. |
Recent-range tightening
| Setting | Description |
|---|---|
TDFX_DAILY_RANGE_CANDLES | Candles used to define the recent high-to-low range. |
TDFX_TIGHTEN_AT_RANGE_PCT | Position within that range at which stop tightening begins. |
Backtesting range
| Setting | Description |
|---|---|
BF_SINCE | Start of the selected backtesting period. |
BF_UNTIL | End of the selected backtesting period. |
DEEP_TESTING | Enables 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.