20. Adding the AI Strategy to TradingView

Follow these steps inside TradingView to get your AI-generated strategy onto a chart:

  1. Open TradingView & your chart

    • Go to tradingview.com, log in and open the chart for any symbol (e.g. BTCUSDT).

  2. Open the Pine Script Editor

    • At the bottom of the screen, click the “Pine Editor” tab.

    • You’ll see a default example script in there (TradingView’s template).

  3. Create a new strategy script

    • In the Pine Editor:

      • Click the three dots (…) in the editor header.

      • Choose “New” → “New strategy”.

    • A new template strategy code will appear.

  4. Replace the template with your AI code

    • Select all of the template text and delete it.

    • Go back to your Perpbot Pine Script AI Assistant tab.

    • Copy the entire strategy it generated.

    • Paste the strategy into the Pine Editor in TradingView.

  5. Save the script

    • Click the Save icon.

    • Give it a clear name, e.g. Perpbot SMA Breakout Strategy or Perpbot BTC 15m.

  6. Add the strategy to your chart

    • Click “Add to Chart” at the top of the Pine Editor.

    • TradingView will compile the script and overlay the strategy on your current chart.

Last updated