EA Inputs Reference
Every configurable input on TradeJournalEA.mq4 and TradeJournalEA.mq5. Both files share the same input set.
› Connection
| Input | Default | What it does |
|---|---|---|
API_URLstring | https://tradejournalpro.net | Your TradeJournal Pro server URL. Leave as-is unless self-hosted. |
API_TOKENstring | (required) | Your EA token from Account → Cloud Setup. The EA refuses to start without it. |
POLL_INTERVAL_SECint | 30 | How 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.
| Input | Default | What it does |
|---|---|---|
SYMBOL_PREFIXstring | (empty) | Added before every symbol (e.g. 'oct.' → 'oct.GBPJPY'). Common on prop firm brokers. |
SYMBOL_SUFFIXstring | (empty) | Added after every symbol (e.g. '.m' → 'GBPJPY.m'). Common on cent/ECN accounts. |
SYMBOL_MAPstring | (empty) | Manual per-pair overrides for when prefix/suffix isn't enough. Format: 'GOLD:XAUUSD,XAUUSD:XAUUSDm'. |
SKIP_SUFFIX_PAIRSstring | (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_PAIRSstring | (empty) | Blacklist — these pairs are never traded even if a signal arrives. e.g. 'BTCUSD,ETHUSD'. |
ALLOWED_PAIRSstring | (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).
| Input | Default | What it does |
|---|---|---|
RISK_MODEFIXED_LOT | MONEY | PERCENT_BALANCE | FIXED_LOT | How to size lots. FIXED_LOT uses DEFAULT_LOT, MONEY uses MONEY_RISK_AMOUNT $, PERCENT_BALANCE uses RISK_PERCENT %. |
MONEY_RISK_AMOUNTdouble | 50.0 | Dollars to risk per trade when RISK_MODE=MONEY. Lot = risk / (slPips × tickValue). |
RISK_PERCENTdouble | 1.0 | % of balance to risk when RISK_MODE=PERCENT_BALANCE. |
BALANCE_FOR_RISKdouble | 0.0 | Override 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_LOTdouble | 0.01 | Lot size when RISK_MODE=FIXED_LOT (or as a fallback). |
MAX_LOT / MIN_LOTdouble | 2.0 / 0.01 | Hard caps on computed lot size. |
USE_RISK_PERCENTbool [LEGACY] | false | If true, forces RISK_MODE to be treated as PERCENT_BALANCE regardless of the RISK_MODE input. |
› Multi-TP Lot Splitting
| Input | Default | What it does |
|---|---|---|
USE_MULTI_TPbool | true | Open one position per TP level (TP1..TP5), sized by the percentages below. |
TP1_PERCENT..TP5_PERCENTdouble | 40/30/20/7/3 | % of total lot assigned to each TP position. |
EQUAL_SPLIT_TPbool | false | Override the percentages above — divide the lot equally across all active TPs. |
USE_INDIVIDUAL_TP_RISKbool | false | Use TPn_RISK_PERCENT per leg instead of splitting one total lot. |
TP1_RISK_PERCENT..TP5_RISK_PERCENTdouble | 1/1/1/0.5/0.5 | When 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.
| Input | Default | What it does |
|---|---|---|
SL_OVERRIDE_MODEOFF | ALWAYS | IF_MISSING | OFF | OFF: never override. ALWAYS: replace the signal's SL with predefined pips. IF_MISSING: only if signal has no SL. |
SL_FALLBACK_PIPSdouble | 50.0 | Default SL pip distance when override fires (used if per-TP value below is -1). |
SL_FALLBACK_PIPS_TP1..TP5double | -1.0 | Per-TP predefined SL pips. -1 = inherit SL_FALLBACK_PIPS. Lets each TP have its own SL distance. |
TP_OVERRIDE_MODEOFF | ALWAYS | IF_MISSING | OFF | Same logic for TP. |
TP_FALLBACK_PIPSdouble | 100.0 | Default TP pip distance. |
TP_FALLBACK_PIPS_TP1..TP5double | -1.0 | Per-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.
| Input | Default | What it does |
|---|---|---|
RR_MODEDISABLED | FOR_SL | FOR_TP | DISABLED | FOR_SL: compute missing SL from TP distance × ratio. FOR_TP: fill missing TPs from SL distance × ratio. |
RR_RATIOdouble | 2.0 | Default ratio applied when per-TP value is -1. |
RR_RATIO_TP1..TP5double | -1.0 | Per-TP RR ratio. Lets TP1=1.0, TP2=2.0, TP3=3.0, etc. with one config. |
USE_RR_MODEbool [LEGACY] | false | If true, forces RR_MODE to FOR_TP. |
› Signal Modifications
| Input | Default | What it does |
|---|---|---|
REVERSE_SIGNALbool | false | Flip BUY↔SELL on every signal. Useful for fading a bad provider. |
REVERSE_USE_PIPSbool | false | When reversing, preserve SL/TP pip distances from entry instead of swapping prices. Matches the pro-copier semantic. |
ENTRY_ADJUST_PIPSdouble | 0.0 | Add/subtract pips to/from the entry price (direction-aware). |
SL_ADJUST_PIPSdouble | 0.0 | Widen/tighten the SL by N pips. |
TP_ADJUST_PIPSdouble | 0.0 | Shift all TPs by N pips. |
INCLUDE_SPREADbool | false | Widen the SL away from entry by the broker spread (avoids early stop-out on wide-spread brokers). |
› Pending Orders
| Input | Default | What it does |
|---|---|---|
USE_PENDINGbool | false | Use limit/stop orders when price differs from signal entry by more than PENDING_PIPS_THRESHOLD. |
PENDING_PIPS_THRESHOLDdouble | 10.0 | Min pip gap between current price and entry to trigger a pending order. |
PENDING_EXPIRY_MINint | 0 | Minutes until a pending order auto-cancels. 0 = never expire. |
FORCE_MARKET_PIPSdouble | 7.0 | Pips tolerance for forcing market execution. If current price is within N pips of entry, execute market (don't wait). |
› Filtering
| Input | Default | What it does |
|---|---|---|
IGNORE_NO_SLbool | false | Skip signals that arrive without a stop-loss. |
IGNORE_NO_TPbool | false | Skip signals without a take-profit. |
CHECK_DUPLICATEbool | true | Skip if same pair+direction already open with our magic number. |
BLOCK_DUPLICATE_ENTRYbool | false | Stricter: block if entry price is within 3 pips of an existing open position. |
MULTI_TRADE_MODEALLOWED | HEDGE_ONLY | NOT_ALLOWED | ALLOWED | Controls when a new trade is permitted for a pair. |
SAME_PAIR_CHECK_SCOPEALL_TIME | TODAY | ALL_TIME | Window for the duplicate-pair check. TODAY = only count today's trades. |
AUTO_CLOSE_OPPOSITEbool | false | When an opposite-direction signal arrives, close existing trades first. |
› Trade Management — Breakeven & Trailing
| Input | Default | What it does |
|---|---|---|
USE_BREAKEVENbool | true | Move SL to entry when price reaches halfway to TP. |
BREAKEVEN_PIPSdouble | 3.0 | Place BE N pips above entry (covers commission/spread). |
BREAKEVEN_RRdouble | 0.0 | Alt trigger: move BE when profit ≥ X × SL distance. 0 = off. |
BREAKEVEN_MONEYdouble | 0.0 | Alt trigger: move BE when unrealized profit ≥ $X. 0 = off. |
USE_TRAILINGbool | false | Price-based trailing stop. |
TRAILING_STARTdouble | 30.0 | Profit pips required before trailing kicks in. |
TRAILING_STEPdouble | 15.0 | Profit pips required between SL moves (rate-limits SL adjustments). |
TRAILING_DISTANCEdouble | 0.0 | Gap (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_TPbool | false | Advance 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.
| Input | Default | What it does |
|---|---|---|
MOVE_SL_TRIGGEROFF | PIPS | RR | MONEY | TP_HIT | OFF | What triggers the action. TP_HIT counts hits across sibling TPs. |
MOVE_SL_TYPEMOVE_ONLY | CLOSE_HALF_ONLY | BOTH | MOVE_ONLY | What action to take when triggered. |
MOVE_SL_AFTER_Xdouble | 0.0 | Threshold value. Meaning depends on trigger: pips, RR multiplier, dollars, or # of TPs hit. |
HALF_CLOSE_PERCENTdouble | 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.
| Input | Default | What it does |
|---|---|---|
USE_TRAILING_TPbool | false | Enable TP-chain trailing. |
TRAILING_TP_STARTint | 1 | Which TP-hit number starts the chain (1 = chain from TP1). |
USE_TP_CASCADEbool | false | Simpler variant — any TP hit moves all remaining SLs to break-even (not to the previous TP). |
SMART_PROFIT_LOCKdouble | 0.0 | When a TP closes, close X% of all sibling same-direction positions. |
› Partial Close
| Input | Default | What it does |
|---|---|---|
USE_PARTIAL_CLOSEbool | false | Close part of the position at a trigger level. |
PARTIAL_CLOSE_TRIGGERdouble | 50.0 | % of the way to TP that triggers the close. |
PARTIAL_CLOSE_PERCENTdouble | 50.0 | % of lot to close at the trigger. |
› Time Filter
| Input | Default | What it does |
|---|---|---|
USE_TIME_FILTERbool | false | Restrict trading to a time window + day-of-week pattern. |
TRADE_START_HOUR / TRADE_END_HOURint | 8 / 20 | Server-time hour bounds. End is exclusive. Set start > end to wrap midnight. |
TRADE_MONDAY..TRADE_SUNDAYbool | Mon-Fri true | Per-day toggles. |
› News Filter
| Input | Default | What it does |
|---|---|---|
USE_NEWS_FILTERbool | false | Block signals near high-impact economic events (ForexFactory calendar). |
NEWS_BLOCK_BEFORE_MIN / NEWS_BLOCK_AFTER_MINint | 30 / 15 | Block N minutes before and after each event. |
NEWS_IMPACT_LEVELHigh | Medium | All | High | Severity threshold. |
› Edit Messages & Per-Symbol Risk
| Input | Default | What it does |
|---|---|---|
EDIT_MESSAGE_ENABLEDbool | true | Apply SL/TP edits sent by the server when a provider edits their original signal message. Disable to ignore edits. |
SPECIAL_RISKstring | (empty) | Per-symbol risk% override: 'XAUUSD:1.5,EURUSD:0.5'. |
SYMBOL_LOTstring | (empty) | Per-symbol lot override: 'XAUUSD:0.01,EURUSD:0.05'. |
› Prop Firm Mode
| Input | Default | What it does |
|---|---|---|
PROP_FIRM_MODEbool | false | Enable all prop-firm safety features below. |
STEALTH_MIN_SEC / STEALTH_MAX_SECint | 3 / 15 | Random delay before each execution — hides copier identity from firm monitoring. |
RANDOMIZE_COMMENTbool | true | Use random 8-char comments instead of 'TJ-TPn|signalId'. |
DAILY_LOSS_LIMITdouble | 5.0 | Stop trading when daily loss ≥ X% of balance. |
DRAWDOWN_LIMITdouble | 10.0 | Stop trading when current drawdown ≥ X% of balance. |
PROFIT_TARGETdouble | 0.0 | Stop trading once daily profit ≥ X% of balance. 0 = off. |
FIFO_MODEbool | false | Close oldest position first (US prop firm FIFO rule). |
› Comments & Notifications
| Input | Default | What it does |
|---|---|---|
USE_COMMENTbool | true | Attach a comment to each order. Disable for completely anonymous orders. |
COMMENT_TEXTstring | TJ | Base comment text when RANDOMIZE_COMMENT=false. Each TP leg appends '-TPn|signalId'. |
SEND_NOTIFICATIONbool | false | Send a push notification to MT4/MT5 mobile when a trade opens. |
› Execution & Retry
| Input | Default | What it does |
|---|---|---|
MAGIC_NUMBERulong | 20250101 | EA magic number. Don't share this with other EAs on the same chart. |
MAX_SLIPPAGEulong | 5 | Slippage tolerance in points (10 points ≈ 1 pip). |
MAX_RETRIESint | 3 | Retry OrderSend on transient errors (requote, off-quotes, etc.). |
RETRY_DELAY_MSint | 1000 | Milliseconds between retries. |
Found a bug or want a new input? Open a support ticket — we ship EA updates weekly.