Turn a trading idea into a condition table
The example below is a rule-writing exercise. It has not been backtested and is not a trading recommendation. Complete the planner above, then resolve the details it cannot represent before generating code.
| Decision | Rule to specify |
|---|---|
| Market and evaluation | Choose the symbol and a 1-hour chart in TradingView. Evaluate the example on closed bars. The planner records a timeframe but loads no price data. |
| Entry | Long only: RSI(14) crosses above 30 AND ADX(14) is above 20 on the same bar. In Entry Conditions, add these as two rows. |
| Signal exit | RSI(14) crosses below 70. Put this in Exit Conditions. Additional exit rows use OR, so any one is sufficient. |
| Protective exits | Draft a 2% stop and 4% target measured from the entry fill. Configure their actual price references and linked entry order in the editor. |
| Position size | Allocate 10% of equity, allow one position, and disable additional entries while it is open. These are example assumptions, not recommended settings. |
Check combinations before generating a strategy
- A crossover is an event on one bar; an above/below comparison is a state that can persist. Requiring several crossovers on the same bar can exclude trades you intended to allow.
- Entry rows use AND and exit rows use OR as a drafting convention. The planner cannot express nested groups or a sequence such as a crossover followed by a pullback within five bars.
- Long & Short selects a label, not two independent rule sets. Specify short entries, exits, and reversal behavior separately in the editor.
- Indicator periods in the dropdown are fixed labels. Text such as a MACD signal line, price, or a range is a note; the planner does not resolve or validate it.
- The displayed reward-to-risk ratio divides target distance by stop distance only when their units match. It ignores fees, gaps, fill prices, and win rate. Position allocation is not account risk.
From the visual draft to TradingView
- Record the summary before leaving this page. The planner keeps edits in page state and does not save them across reloads or import them into another product.
- Open the Visual Pine Script Editor, sign in, create a strategy, and add the indicators and conditions. Configure entry orders, their direction and size, and exits linked to those entries. Free editor access is limited; expanded features require a paid plan. Check the account plan before building a larger rule set.
- Set strategy properties, including order size, pyramiding, commission, and slippage. Recreate the intended stop and target with the editor's supported price or tick settings. A percentage or ATR note in this planner is not an implemented order.
- Copy the generated code from the editor's code view. In TradingView, paste it into Pine Editor, save it, and select Add to chart. Resolve compilation errors before reviewing behavior.
- Use standard candles and inspect the strategy report and individual trades. Confirm that signals, order creation, and fills match your rules. Test a separate date range after changing parameters. Compilation alone cannot establish trading correctness or profitability.
Verify the trading assumptions
TradingView strategies use a broker emulator. With default settings, a market order created at a bar close normally fills at the next bar's open. Costs and fill assumptions affect results, and historical performance does not establish future returns.
Source: TradingView documentation on strategies and simulated orders. Reviewed October 16, 2026. This guide is educational, not investment advice.
Browse TradingView strategy guides