Troubleshooting
When Strategy Lab refuses to trade, goes quiet, or produces something different than you expected, start with the boring evidence. The diagnostics table, state tokens, and position tokens usually tell the story before...
Written By Axiom Admin
Last updated 1 day ago
Troubleshooting
When Strategy Lab refuses to trade, goes quiet, or produces something different than you expected, start with the boring evidence. The diagnostics table, state tokens, and position tokens usually tell the story before the trade list does.
First Check: Status
For code-level meanings, use Diagnostics & Error Codes.
Strategy Inactive
This means the engine is not allowed to trade. Common causes:
Fix the first blocking diagnostic first. Later errors may be side effects.
Active With Warnings
Warnings do not stop the strategy, but they are not decoration. They usually mean one of these:
If the warning is expected during early warmup, you may be fine. If it appears deep into the chart, fix it.
No Trades
Work the chain from outside to inside:
Is the strategy status active?
Is the direction enabled?
Does the setup reach
_ACTIVEor its shorthand aliasACT?Is the entry gate true?
Is the entry trigger true?
Has the entry already fired under
entry_one_shot?Did the setup hit
setup_max_entries_per_activation?Is a risk brake blocking new entries?
If it is a limit/stop entry, did price actually reach the order?
Did the order expire or cancel while still working?
The quickest test is to simplify:
Exampleentry_trigger_when: PRICE_CLOSE > 0
entry_order_type: MARKET
entry_allocation_percent: 100If that trades, the engine is alive. Add the real conditions back one at a time.
Entry Orders Appear But Do Not Fill
This usually means the order is working, not filled.
Check:
Remember that TradingView's broker emulator has its own fill assumptions. A limit order that looked close on the chart may still not fill depending on bar sequence, magnifier settings, and price path.
Exits Do Not Fire
Start with position state:
ExamplePOSITION_ACTIVE POSITION_REMAINING_QUANTITY POSITION_REMAINING_PERCENT POSITION_AVERAGE_PRICE
Then check the exit unit:
Multiple exits can each be set to 100% when they are alternative full exits. That is valid. If you expected a leg, make the allocation smaller and use POSITION_REMAINING_PERCENT to control what comes next.
Break-Even Stop Does Not Activate
The most reliable gate is usually remaining position:
Examplestop_loss_gate_condition:
POSITION_ACTIVE
&& POSITION_REMAINING_PERCENT <= 50
stop_loss_trigger_when: TRUEIf the stop never activates, check whether the partial take profit actually filled. A trigger being true is not the same as a fill. POSITION_REMAINING_PERCENT is the stronger evidence.
Expression Warns On Historical Values
A lookback token like PRICE_CLOSE[5] needs five previous bars. Early in the chart, that value is not there.
If you want the expression to stay quiet during warmup, use a fallback:
Exampleentry_trigger_when:
SAFE_DIV(
PRICE_CLOSE - NZ(PRICE_CLOSE[5], PRICE_CLOSE),
NZ(PRICE_CLOSE[5], PRICE_CLOSE),
0
) > 0.01Logical guards are useful, but do not rely on them as your only protection around unsafe function inputs.
Custom Tokens Look Correct But Rules Stay False
Check three things:
The token name is spelled exactly the same in the Inputs tab and YAML.
The token type matches the value: Number or True/False.
The source plot is actually moving and not stuck at zero or
NaN.
A token can exist and still feed bad data. The diagnostics will catch missing names; they cannot know whether you connected the wrong plot unless the values become unusable.
Results Changed After Reload
Common causes:
Backtests are simulations. If a result matters, re-run it across reloads, dates, and market conditions.
The Smallest Useful Debug Loop
Fix blocking diagnostics.
Decide whether warnings are expected or real problems.
Watch setup state tokens.
Watch entry/exit
_CONFIRMING,_WORKING, and_ACTIVEtokens, or the matchingCONF,WORK, andACTaliases.Watch position tokens.
Simplify the YAML until it trades.
Add complexity back one rule at a time.
There is no shame in making the strategy intentionally simple for five minutes. A simple strategy that trades tells you the machine is alive. Then you can find the exact rule that made it go quiet.