FAQ
Quick answers to the questions that come up first. Each answer points to the page where the fuller explanation lives.
Written By Axiom Admin
Last updated 2 days ago
FAQ
Quick answers to the questions that come up first. Each answer points to the page where the fuller explanation lives.
I pasted my YAML and the strategy says "Inactive" - what went wrong?
The strategy is blocked by a required consent setting or by at least one ERROR diagnostic. Read the first error in the diagnostics table. It will usually point at a missing YAML field, removed field, unknown token, invalid expression, or invalid order price.
See Troubleshooting and Diagnostics & Error Codes.
What does "Strategy Active with Warns" mean?
The strategy is allowed to trade, but the engine recorded warnings. Warnings do not block trading. They often mean an early bar had missing history, a function received NaN, an unknown YAML field was ignored, or an OCA/cancel field has no practical effect.
Do not panic, but do not ignore it either. A warning can explain why a rule went quiet.
See Diagnostics & Error Codes.
Why does my strategy show zero trades?
Common causes: the setup never reaches active, the direction is disabled, the entry gate or trigger never becomes true, the entry already fired under one-shot rules, a custom token is connected wrong, a risk brake halted entries, or a limit/stop order never filled.
See Troubleshooting and Rules & Risk.
What is the difference between a setup and an entry?
A setup defines when a trading context is valid. An entry defines when to place an order inside that context. Entries can belong to setups, and an entry attached to a setup does not evaluate until that setup is active.
See Rules & Risk.
How do exits connect to entries now?
They do not use a separate entry-ID link. Take profits and stop losses are independent exit units against the current position. If you want an exit to behave as if it belongs to a specific setup, entry outcome, or state path, use *_belongs_to_setup, gate conditions, generated state tokens, and position tokens.
See YAML Reference and For The Geeks.
Can I have multiple take profits or stop losses set to 100%?
Yes, when they are alternative full-position exits. A fixed target at 100% and a momentum-failure market TP at 100% are not a 200% exit plan. They are two possible ways to close the same remaining position.
Use allocations below 100 when you want true scale-out legs.
See Rules & Risk.
How do I move my stop to break even after a partial TP?
Gate the break-even stop with position state, usually POSITION_REMAINING_PERCENT.
Examplestop_loss_gate_condition:
POSITION_ACTIVE
&& POSITION_REMAINING_PERCENT <= 50That checks whether the position has actually been reduced, not just whether a TP trigger became true.
See Default Tokens and Rules & Risk.
What does one-shot mean for entries?
entry_one_shot: true is the default. It means the entry fires once per setup activation. If you want the same entry to add more than once, set entry_one_shot: false and use entry_pyramiding_max_adds to control how many additional fills are allowed.
See YAML Reference.
How do I connect an external indicator to the strategy?
Add the indicator to your chart, then create a custom token in the Inputs tab with a unique name, the correct type, and the source set to the indicator's plot. Your YAML can then reference that token by name.
See Quick Start and Settings.
Why did my results change overnight?
TradingView recalculates strategies as new bars arrive. Results can also change when you use TIME_NOW, real-time bar-state tokens, repainting indicator outputs, different bar magnifier settings, revised data, or changed slippage/commission settings.
Can I automate this strategy?
Technically yes. TradingView strategy order events can feed alerts, and alerts can feed automation bridges. But a backtest, an alert, and a broker fill are three different models. Test brutally before letting live money touch it.
See Alerts & Automation.
My TP and SL are on the same bar - which one fills?
TradingView's broker emulator only has the bar data and its fill assumptions. If both sides are touched on the same bar, the simulated fill may not match the real market sequence.
How do I know my expressions are evaluating correctly?
Use the expression value label and the diagnostics table. If an expression is skipped, its setup or gate probably blocked it. If it evaluates but returns the wrong type, the diagnostic will point at the field.
See Expression Reference and Diagnostics & Error Codes.
What is the GLOBAL setup?
GLOBAL is the implicit setup context. It is useful for simple strategies. In complex strategies, naming your setup on entries and exits usually makes the YAML easier to reason about.
See Rules & Risk.
What tokens can I use?
The engine provides built-in price, bar/time, session, strategy, position, and generated state tokens. Custom tokens let you connect indicator plots from the chart. PRICE_NOW is available as a readability token alongside PRICE_CLOSE; both use Pine's current close value. PN and PC are the compact aliases.
See Default Tokens.
Can I use Swing Mode with multiple setups?
Yes, but test long and short sides separately first. In Swing Mode, a long entry can close or reverse a short position and vice versa. That interacts with pyramiding, OCA, exits, and position-cycle resets.
See Settings and Rules & Risk.
What does lock_prices do?
It captures an order price when the unit first triggers. Diagnostics may show the expression's current recalculated value, while the working order uses the latched value. That difference is normal.
See For The Geeks.
Why does my position size keep growing?
Usually pyramiding or repeated entries. Check TradingView's pyramiding setting, entry_one_shot, entry_pyramiding_max_adds, and whether your entry condition stays true for many bars.
See Settings and Troubleshooting.