TradingView strategy guides

How to Create a Trading Strategy on TradingView

Define entry rules, exits, and position size before writing a strategy. Use this free planner to prepare a rule summary, then recreate it in the Pineify Visual Pine Script Editor and copy the generated code into TradingView.

This page creates a draft only. It does not generate code, run a backtest, or transfer your rules to the editor. No account is needed for the planner; the editor has separate account and plan limits.

Strategy Settings

Define when to enter a trade. All conditions must be met simultaneously.

Strategy Summary

Review your trading strategy configuration

Strategy Name

My Trading Strategy

Direction

Long Only

Timeframe

1day

Entry Conditions (1)

  • RSI Crosses Below 30

Exit Conditions (1)

  • RSI Crosses Above 70

Risk Management

Stop Loss

2%

Take Profit

4%

Position Size

10%

Record this summary before leaving. Recreate the rules in Visual Pine Script Editor; this link does not transfer your draft.

Explore Visual Pine Script Editor

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.

Example strategy rules and implementation decisions
DecisionRule to specify
Market and evaluationChoose 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.
EntryLong 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 exitRSI(14) crosses below 70. Put this in Exit Conditions. Additional exit rows use OR, so any one is sufficient.
Protective exitsDraft a 2% stop and 4% target measured from the entry fill. Configure their actual price references and linked entry order in the editor.
Position sizeAllocate 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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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

Strategy builder questions

Is this trading strategy builder free?

The planner on this page is free and does not require an account. It produces an on-screen summary. Pineify Visual Pine Script Editor is a separate product with limited free access and paid plans for expanded features. Your draft is not transferred automatically.

Can I create a strategy in TradingView without coding?

You can define supported rules in Pineify Visual Pine Script Editor, copy its generated Pine Script, and add it to a TradingView chart. You still need to check that the script implements your intended rules and inspect simulated trades. This planner itself does not produce executable code.

Can I combine any indicator conditions?

This planner records an AND list for entries and an OR list for exits. It has no nested groups, separate long and short rule sets, or adjustable indicator periods. Values are free text, not validated expressions. More detailed rules must be configured and checked in the editor.

Does a 10% position size mean I risk 10% of my account?

No. Position size describes capital allocated to a trade. Loss also depends on the stop distance, leverage, contract value, fees, and fill price. A stop order does not guarantee the requested exit price.

Will this strategy make money or place live orders?

The planner does neither. It records your rules without market data or performance calculations. A TradingView strategy simulates trades; any live execution setup is separate. No result or profit is promised.

Build the strategy in Visual Pine Script Editor

Use your saved rule summary to configure indicators, conditions, and strategy orders. The editor requires an account and has plan limits. Your planner draft is not transferred automatically.

Explore Visual Pine Script Editor