Skip to content

Guide

How do I convert a TradingView indicator to a strategy for Nyria?

Swap indicator() for strategy() and turn each arrow or alertcondition into a strategy.entry or strategy.close call. Then create one Order fills only alert per ticker. TradingView fills in the action and position, so one alert covers every entry and exit.

Official documentation

Convert an indicator script to a strategy

  1. 1

    Change the declaration

    Replace indicator(...) with strategy(...). Add process_orders_on_close=true and calc_on_every_tick=false.

  2. 2

    Turn arrows into orders

    Where the script drew an arrow, call strategy.entry() to open a position.

  3. 3

    Add the exits

    Close with strategy.close(), or enter the opposite side to flip.

  4. 4

    Delete the old alerts

    Remove the alertcondition() and alert() calls. The order fills alert replaces them.

  5. 5

    Create one alert per ticker

    In the Nyria alert wizard pick Strategy, copy the message, and choose Order fills only.

Why convert at all

  • An indicator traded on 4 sides across 5 tickers needs 20 alerts.
  • The same script as a strategy needs 5 alerts, one per ticker.
  • A strategy also runs in the Strategy Tester.

What stays the same

  • The math behind your entries stays as it is.
  • EMAs, RSI and crossovers need no change.
  • Only the outputs change, from drawings to orders.

Choose an exit pattern

  • Long-only: strategy.entry, then strategy.close.
  • Flip: entering one side closes the other.
  • Price exits in Pine run inside your script.
  • Nyria places no stop or target order at your broker.

Who sets the size

  • Nyria reads the action and direction from the alert.
  • It sizes the order from the budget per entry on the bot.
  • Any qty of 1 or more works in the script.

Repainting still applies

  • Converting doesn't fix repainting.
  • Keep process_orders_on_close=true.
  • Read higher-timeframe data as close[1].
  • Test on Nyria Paper before you go live.

Questions

Can I use an indicator() script with Nyria?
Not for order fills. Use strategy(), or write the side into each alert.
How many alerts does a strategy need?
One Order fills only alert per ticker.
Does the math in my script change?
No. Only the outputs change, from arrows to orders.
Does Nyria place my Pine stop orders?
No. A Pine exit closes inside your script, and Nyria treats its fill as an exit.
Does conversion stop repainting?
No. Keep process_orders_on_close=true and read higher timeframes as close[1].
Where do I get the alert message?
Pick Strategy in the Nyria alert wizard and copy the default message.

Next

Try a paper bot first

No card required. Paper is free. Live trading from $15 a month.