EA Inputs Reference

Every configurable input on TradeJournalEA.mq4 and TradeJournalEA.mq5. Both files share the same input set.

Tip:Inputs are grouped in MetaTrader by section header (the "═══ ..." rows in the EA file). Use the F7 compile shortcut to confirm the EA loads without errors before attaching it to a chart.

Connection

InputDefaultWhat it does
API_URL
string
https://tradejournalpro.netYour TradeJournal Pro server URL. Leave as-is unless self-hosted.
API_TOKEN
string
(required)Your EA token from Account → Cloud Setup. The EA refuses to start without it.
POLL_INTERVAL_SEC
int
30How often the EA fetches new signals from the server. Commands (modify/close) poll every 5s independently.

Symbol Mapping

Get the broker symbol right — this is the #1 cause of 'symbol not found' errors. Set prefix/suffix once for your broker.

InputDefaultWhat it does
SYMBOL_PREFIX
string
(empty)Added before every symbol (e.g. 'oct.' → 'oct.GBPJPY'). Common on prop firm brokers.
SYMBOL_SUFFIX
string
(empty)Added after every symbol (e.g. '.m' → 'GBPJPY.m'). Common on cent/ECN accounts.
SYMBOL_MAP
string
(empty)Manual per-pair overrides for when prefix/suffix isn't enough. Format: 'GOLD:XAUUSD,XAUUSD:XAUUSDm'.
SKIP_SUFFIX_PAIRS
string
(empty)Comma list of pairs that should NOT get prefix/suffix applied. Useful when most pairs use a suffix but one or two don't (e.g. 'XAUUSD.Cash').
EXCLUDED_PAIRS
string
(empty)Blacklist — these pairs are never traded even if a signal arrives. e.g. 'BTCUSD,ETHUSD'.
ALLOWED_PAIRS
string
(empty)Whitelist — if set, ONLY these pairs are traded. Empty = trade all pairs.

Risk Management

Choose one risk mode. The 3-mode RISK_MODE supersedes the legacy USE_RISK_PERCENT bool (which still works for backwards compat).

InputDefaultWhat it does
RISK_MODE
FIXED_LOT | MONEY | PERCENT_BALANCE
FIXED_LOTHow to size lots. FIXED_LOT uses DEFAULT_LOT, MONEY uses MONEY_RISK_AMOUNT $, PERCENT_BALANCE uses RISK_PERCENT %.
MONEY_RISK_AMOUNT
double
50.0Dollars to risk per trade when RISK_MODE=MONEY. Lot = risk / (slPips × tickValue).
RISK_PERCENT
double
1.0% of balance to risk when RISK_MODE=PERCENT_BALANCE.
BALANCE_FOR_RISK
double
0.0Override the balance used for % calc. 0 = use real account balance. Set to 5000 if you want to size as if your account were $5000 (common for prop firm prep).
DEFAULT_LOT
double
0.01Lot size when RISK_MODE=FIXED_LOT (or as a fallback).
MAX_LOT / MIN_LOT
double
2.0 / 0.01Hard caps on computed lot size.
USE_RISK_PERCENT
bool [LEGACY]
falseIf true, forces RISK_MODE to be treated as PERCENT_BALANCE regardless of the RISK_MODE input.

Multi-TP Lot Splitting

InputDefaultWhat it does
USE_MULTI_TP
bool
trueOpen one position per TP level (TP1..TP5), sized by the percentages below.
TP1_PERCENT..TP5_PERCENT
double
40/30/20/7/3% of total lot assigned to each TP position.
EQUAL_SPLIT_TP
bool
falseOverride the percentages above — divide the lot equally across all active TPs.
USE_INDIVIDUAL_TP_RISK
bool
falseUse TPn_RISK_PERCENT per leg instead of splitting one total lot.
TP1_RISK_PERCENT..TP5_RISK_PERCENT
double
1/1/1/0.5/0.5When USE_INDIVIDUAL_TP_RISK=true, each TP gets its own risk amount.

SL/TP Overrides

Set predefined SL or TP pips when the signal is missing them (or always, depending on the mode). Per-TP variants override the global value.

InputDefaultWhat it does
SL_OVERRIDE_MODE
OFF | ALWAYS | IF_MISSING
OFFOFF: never override. ALWAYS: replace the signal's SL with predefined pips. IF_MISSING: only if signal has no SL.
SL_FALLBACK_PIPS
double
50.0Default SL pip distance when override fires (used if per-TP value below is -1).
SL_FALLBACK_PIPS_TP1..TP5
double
-1.0Per-TP predefined SL pips. -1 = inherit SL_FALLBACK_PIPS. Lets each TP have its own SL distance.
TP_OVERRIDE_MODE
OFF | ALWAYS | IF_MISSING
OFFSame logic for TP.
TP_FALLBACK_PIPS
double
100.0Default TP pip distance.
TP_FALLBACK_PIPS_TP1..TP5
double
-1.0Per-TP predefined TP pips. Useful for fixed ladders (e.g. 50/100/150/200/300).

Risk-Reward Mode

Derive SL from TP, or TP from SL, using a ratio. The 3-mode RR_MODE supersedes the legacy USE_RR_MODE bool.

InputDefaultWhat it does
RR_MODE
DISABLED | FOR_SL | FOR_TP
DISABLEDFOR_SL: compute missing SL from TP distance × ratio. FOR_TP: fill missing TPs from SL distance × ratio.
RR_RATIO
double
2.0Default ratio applied when per-TP value is -1.
RR_RATIO_TP1..TP5
double
-1.0Per-TP RR ratio. Lets TP1=1.0, TP2=2.0, TP3=3.0, etc. with one config.
USE_RR_MODE
bool [LEGACY]
falseIf true, forces RR_MODE to FOR_TP.

Signal Modifications

InputDefaultWhat it does
REVERSE_SIGNAL
bool
falseFlip BUY↔SELL on every signal. Useful for fading a bad provider.
REVERSE_USE_PIPS
bool
falseWhen reversing, preserve SL/TP pip distances from entry instead of swapping prices. Matches the pro-copier semantic.
ENTRY_ADJUST_PIPS
double
0.0Add/subtract pips to/from the entry price (direction-aware).
SL_ADJUST_PIPS
double
0.0Widen/tighten the SL by N pips.
TP_ADJUST_PIPS
double
0.0Shift all TPs by N pips.
INCLUDE_SPREAD
bool
falseWiden the SL away from entry by the broker spread (avoids early stop-out on wide-spread brokers).

Pending Orders

InputDefaultWhat it does
USE_PENDING
bool
falseUse limit/stop orders when price differs from signal entry by more than PENDING_PIPS_THRESHOLD.
PENDING_PIPS_THRESHOLD
double
10.0Min pip gap between current price and entry to trigger a pending order.
PENDING_EXPIRY_MIN
int
0Minutes until a pending order auto-cancels. 0 = never expire.
FORCE_MARKET_PIPS
double
7.0Pips tolerance for forcing market execution. If current price is within N pips of entry, execute market (don't wait).

Filtering

InputDefaultWhat it does
IGNORE_NO_SL
bool
falseSkip signals that arrive without a stop-loss.
IGNORE_NO_TP
bool
falseSkip signals without a take-profit.
CHECK_DUPLICATE
bool
trueSkip if same pair+direction already open with our magic number.
BLOCK_DUPLICATE_ENTRY
bool
falseStricter: block if entry price is within 3 pips of an existing open position.
MULTI_TRADE_MODE
ALLOWED | HEDGE_ONLY | NOT_ALLOWED
ALLOWEDControls when a new trade is permitted for a pair.
SAME_PAIR_CHECK_SCOPE
ALL_TIME | TODAY
ALL_TIMEWindow for the duplicate-pair check. TODAY = only count today's trades.
AUTO_CLOSE_OPPOSITE
bool
falseWhen an opposite-direction signal arrives, close existing trades first.

Trade Management — Breakeven & Trailing

InputDefaultWhat it does
USE_BREAKEVEN
bool
trueMove SL to entry when price reaches halfway to TP.
BREAKEVEN_PIPS
double
3.0Place BE N pips above entry (covers commission/spread).
BREAKEVEN_RR
double
0.0Alt trigger: move BE when profit ≥ X × SL distance. 0 = off.
BREAKEVEN_MONEY
double
0.0Alt trigger: move BE when unrealized profit ≥ $X. 0 = off.
USE_TRAILING
bool
falsePrice-based trailing stop.
TRAILING_START
double
30.0Profit pips required before trailing kicks in.
TRAILING_STEP
double
15.0Profit pips required between SL moves (rate-limits SL adjustments).
TRAILING_DISTANCE
double
0.0Gap (pips) from current price to SL. 0 = use TRAILING_STEP as the gap. Set this to get the spec's 3-param trailing.
TRAILING_MOVE_TP
bool
falseAdvance the TP forward as the trailing SL moves.

Trade Management — Move SL Trigger (new)

When a profit condition fires, optionally move SL to entry and/or close half of the position. 4 trigger types × 3 action types.

InputDefaultWhat it does
MOVE_SL_TRIGGER
OFF | PIPS | RR | MONEY | TP_HIT
OFFWhat triggers the action. TP_HIT counts hits across sibling TPs.
MOVE_SL_TYPE
MOVE_ONLY | CLOSE_HALF_ONLY | BOTH
MOVE_ONLYWhat action to take when triggered.
MOVE_SL_AFTER_X
double
0.0Threshold value. Meaning depends on trigger: pips, RR multiplier, dollars, or # of TPs hit.
HALF_CLOSE_PERCENT
double
50.0% of lot to close when MOVE_SL_TYPE includes CLOSE_HALF.

Trade Management — TP-Chain Trailing (new)

Cascade SL forward through your TP ladder. When TP1 hits, all remaining same-direction SLs move to entry. When TP2 hits, they move to TP1. Etc.

InputDefaultWhat it does
USE_TRAILING_TP
bool
falseEnable TP-chain trailing.
TRAILING_TP_START
int
1Which TP-hit number starts the chain (1 = chain from TP1).
USE_TP_CASCADE
bool
falseSimpler variant — any TP hit moves all remaining SLs to break-even (not to the previous TP).
SMART_PROFIT_LOCK
double
0.0When a TP closes, close X% of all sibling same-direction positions.

Partial Close

InputDefaultWhat it does
USE_PARTIAL_CLOSE
bool
falseClose part of the position at a trigger level.
PARTIAL_CLOSE_TRIGGER
double
50.0% of the way to TP that triggers the close.
PARTIAL_CLOSE_PERCENT
double
50.0% of lot to close at the trigger.

Time Filter

InputDefaultWhat it does
USE_TIME_FILTER
bool
falseRestrict trading to a time window + day-of-week pattern.
TRADE_START_HOUR / TRADE_END_HOUR
int
8 / 20Server-time hour bounds. End is exclusive. Set start > end to wrap midnight.
TRADE_MONDAY..TRADE_SUNDAY
bool
Mon-Fri truePer-day toggles.

News Filter

InputDefaultWhat it does
USE_NEWS_FILTER
bool
falseBlock signals near high-impact economic events (ForexFactory calendar).
NEWS_BLOCK_BEFORE_MIN / NEWS_BLOCK_AFTER_MIN
int
30 / 15Block N minutes before and after each event.
NEWS_IMPACT_LEVEL
High | Medium | All
HighSeverity threshold.

Edit Messages & Per-Symbol Risk

InputDefaultWhat it does
EDIT_MESSAGE_ENABLED
bool
trueApply SL/TP edits sent by the server when a provider edits their original signal message. Disable to ignore edits.
SPECIAL_RISK
string
(empty)Per-symbol risk% override: 'XAUUSD:1.5,EURUSD:0.5'.
SYMBOL_LOT
string
(empty)Per-symbol lot override: 'XAUUSD:0.01,EURUSD:0.05'.

Prop Firm Mode

InputDefaultWhat it does
PROP_FIRM_MODE
bool
falseEnable all prop-firm safety features below.
STEALTH_MIN_SEC / STEALTH_MAX_SEC
int
3 / 15Random delay before each execution — hides copier identity from firm monitoring.
RANDOMIZE_COMMENT
bool
trueUse random 8-char comments instead of 'TJ-TPn|signalId'.
DAILY_LOSS_LIMIT
double
5.0Stop trading when daily loss ≥ X% of balance.
DRAWDOWN_LIMIT
double
10.0Stop trading when current drawdown ≥ X% of balance.
PROFIT_TARGET
double
0.0Stop trading once daily profit ≥ X% of balance. 0 = off.
FIFO_MODE
bool
falseClose oldest position first (US prop firm FIFO rule).

Comments & Notifications

InputDefaultWhat it does
USE_COMMENT
bool
trueAttach a comment to each order. Disable for completely anonymous orders.
COMMENT_TEXT
string
TJBase comment text when RANDOMIZE_COMMENT=false. Each TP leg appends '-TPn|signalId'.
SEND_NOTIFICATION
bool
falseSend a push notification to MT4/MT5 mobile when a trade opens.

Execution & Retry

InputDefaultWhat it does
MAGIC_NUMBER
ulong
20250101EA magic number. Don't share this with other EAs on the same chart.
MAX_SLIPPAGE
ulong
5Slippage tolerance in points (10 points ≈ 1 pip).
MAX_RETRIES
int
3Retry OrderSend on transient errors (requote, off-quotes, etc.).
RETRY_DELAY_MS
int
1000Milliseconds between retries.

Found a bug or want a new input? Open a support ticket — we ship EA updates weekly.