In this tutorial, you’ll learn how to correctly use the Primary (TFParam1) and Secondary (TFParam2) parameters of FxMagnetic Trade Filters to fine-tune your trading strategies. Understanding these parameters helps you customize filters like Moving Average, Bollinger Bands, PSAR, and others for better strategy performance and more accurate trade signals.

In this tutorial, we’ll use TFParam1 to refer to the Primary parameter of the Trade Filter and TFParam2 to refer to the Secondary parameter.

  • TFParam1 (Primary) = the main setting of the filter (e.g., period, step, which levels to use).

  • TFParam2 (Secondary) = a “helper” setting. It’s -1 by default so you can ignore it unless you want more control. When TFParam2 = -1, the filter auto-uses a sensible default (varies by filter, see below).


How the -1 default works

We added the Secondary parameter later to keep older templates compatible.

  • If you leave TFParam2 = -1, the filter uses its built-in default (e.g., Close price for MA, 2.0 deviations for Bollinger, 0.2 max for PSAR, level 30 for ADX, etc.).

  • Set a real value only when you want to override that default.


Filter list with IDs, meanings, defaults & recommendations

Legend:
ID = internal filter ID in FxMagnetic
TFParam1 = Primary parameter (meaning & default)
TFParam2 = Secondary parameter (meaning & default)
Tip = practical guidance

Directional filters (FxMagnetic indicators)

  • FxMagnetic TrendID 1

    • TFParam1: Period (default 14)

    • TFParam2: Not used

    • Tip: Good baseline trend gate on Daily timeframe.

  • FxMagnetic Daily CompassID 50

    • TFParam1/2: Not used

    • Tip: Day-bias filter; aligns entries with the daily candle direction.

  • FxMagnetic Hull ShieldID 60

    • TFParam1: Smoothing period (e.g., 14–60, pick per timeframe)

    • TFParam2: MA mode for internal calc; when -1EMA (valid: 0–3)

      • Common modes: EMA, SMA, SMMA, LWMA

    • Tip: For choppier markets, lengthen period.

  • FxMagnetic SR LevelsID 120

    • TFParam1: Which levels to use: 0=All(H/L/O/C), 1=High/Low, 2=Open/Close

    • TFParam2: Distance from level (in %). 0.1 = 0.1% of price.

      • Default suggestion: 0.1. Larger than 0.1 is usually too far.

    • Tip: Start with TFParam1=0, TFParam2=0.1; narrow to 0.05–0.08% on tight instruments.


Moving Averages

  • SMA (Above=Only Buy / Below=Only Sell)ID 10

  • SMA (Above=Only Sell / Below=Only Buy)ID 11

  • EMA (Above=Only Buy / Below=Only Sell)ID 20

  • EMA (Above=Only Sell / Below=Only Buy)ID 21

    • TFParam1: MA Period (typical 20/50/100/200)

    • TFParam2: Applied price; when -1Close.

      • Map: 0=Close, 1=Open, 2=High, 3=Low, 4=Median, 5=Typical, 6=Weighted

    • Tips:

      • Intraday momentum: EMA 20–50.

      • Swing bias: SMA/EMA 50–200.

      • Keep TFParam2=-1 unless you have a reason to use High/Low.


Bollinger Bands

  • Inside bandsID 30

  • Outside bandsID 31

  • Buy below lower / Sell above upperID 32

  • Buy above upper / Sell below lowerID 33

    • TFParam1: Period (default 20)

    • TFParam2: Deviation; when -12.0

    • Tips:

      • For tighter assets, try dev 2.2–2.5 to reduce noise.

      • For mean-reversion entries, ID 32 with dev 2.0–2.5 and period 20–40 works well.


PSAR (Parabolic SAR)

  • Above=Only Buy / Below=Only SellID 40

  • Above=Only Sell / Below=Only BuyID 41

    • TFParam1: Step (default 0.02)

    • TFParam2: Max; when -10.2

    • Tips:

      • More sensitive: step 0.01–0.02; Smoother: 0.03–0.05.

      • Keep max 0.2 unless you know why to change it.


MACD Histogram

  • Above zero=Buy / Below zero=SellID 90

    • TFParam1: Fast period (default 12)

    • TFParam2: Slow period (default 26)

    • Tip: Classic 12/26 is robust; you can quicken MACD with 8/21 for scalping.


ADX (strength gate)

  • Trade only when ADX ≥ levelID 100

    • TFParam1: Period (default 14)

    • TFParam2: Level; when -130

    • Tips:

      • Trendy: 25–30; Very selective: 30–35.

      • If you’re missing too many trades, try level 20–25.


ATR (volatility slope)

  • ATR RisingID 110

  • ATR FallingID 111

    • TFParam1: Period (default 14)

    • TFParam2: Not used

    • Tips:

      • Rising helps avoid dead markets.

      • Combine with ADX for clean trend days (when multi-filters will be available in FxMagnetic).


Practical setup recipes

  • Simple trend gate (intraday):

    • EMA filter (ID 20) with TFParam1=50, TFParam2=-1 (Close).

    • Optionally add ADX (ID 100) with TFParam1=14, TFParam2=25–30 (when multi-filters will be available in FxMagnetic).

  • Mean-reversion guardrail:

    • Bollinger Inside (ID 30) with TFParam1=20, TFParam2=2.0 to avoid chasing extremes.

  • Breakout day bias:

    • Daily Compass (ID 50) (no params) + ATR Rising (ID 110) (TFParam1=14).

  • Level-aware entries:

    • SR Levels (ID 120) with TFParam1=0 (All), TFParam2=0.1 (% distance).

    • Tight instruments: 0.05–0.08; volatile (XAU/indices): 0.1–0.15 max.


Full ID reference (for quick lookup)

0 None
1 FxMagnetic Trend
10 SMA (Above=Buy / Below=Sell)
11 SMA (Above=Sell / Below=Buy)
20 EMA (Above=Buy / Below=Sell)
21 EMA (Above=Sell / Below=Buy)
30 Bollinger Inside
31 Bollinger Outside
32 Bollinger Buy Below / Sell Above
33 Bollinger Buy Above Upper / Sell Below Lower
40 PSAR (Above=Buy / Below=Sell)
41 PSAR (Above=Sell / Below=Buy)
50 FxMagnetic Daily Compass
60 FxMagnetic Hull Shield
90 MACD Histogram (Above/Below Zero)
100 ADX (Trade Only Above Level)
110 ATR Rising
111 ATR Falling
120 FxMagnetic SR Levels


Quick defaults (copy/paste starter)

  • SMA/EMA: TFParam1=50, TFParam2=-1 (Close)

  • BB: TFParam1=20, TFParam2=-1 (2.0)

  • PSAR: TFParam1=0.02, TFParam2=-1 (0.2)

  • MACD: TFParam1=12, TFParam2=26

  • ADX: TFParam1=14, TFParam2=-1 (30)

  • ATR: TFParam1=14

  • SR Levels: TFParam1=0 (All), TFParam2=0.1 (%)

  • FxMagnetic Trend: TFParam1=14

  • Daily Compass: (no params)

  • Hull Shield: TFParam1=14–60, TFParam2=-1 (EMA mode)


Pro tip: Start with defaults, run a small optimization window (tight bounds around TFParam1; keep TFParam2 at -1 unless you’re targeting a clear behavior), then expand only what shows consistent lift in your backtests (SignalCount ≥ 50, stable RDR, acceptable MaxDD).