Skip to content
Robot de trading
Interfaces
Trader depuis une stratégie

Automatiser vos stratégies Pine Script de TradingView

La traduction française de cette page est en cours.

With OctoBot, you can listen to TradingView Pine Script strategies signals to automate your trades.

Créer une alerte de strategie

To send alerts from a strategy, use the alert_message parameter from Pine Script strategy functions which can generate order.

  1. Define the content of your alert before any strategy.entry, strategy.exit or strategy.close call:
    • example: messageBuy = "EXCHANGE=binance\nSYMBOL=SOLUSDT\nVOLUME=100a%\nSIGNAL=BUY"

    Note: when defining your alert, don’t forget to add \n at the end of each value. This simulates a return to the next line to comply with to the Octobot alert format.

  2. In the strategy section, add alert_message = messageBuy to your strategy entry, exit or close calls:
    • example: strategy.entry("Buy", strategy.long, comment = "Buy Signal Triggered", alert_message = messageBuy)
  3. When creating a new alert (right-click on the strategy / add new alert) make sure that you:
    • Select the name of your strategy as the condition
    • Name the alert (the name can be whatever you want)
    • Replace ALL the message content with exactly {{strategy.order.alert_message}} adding a TradingView strategy alert
  • Et voilà ! This alert will automatically notify your OctoBot each time your strategy executes entry, exit or close calls.

Tips:

  • For multi-coin, simply edit the strategy and modify the SYMBOL entry in the messageBuy definition. You can thus vary the parameters according to the assets.
  • It can be easier to define multiple messages such as messageBuy, messageBuyWithATakeProfit, messageSellor even messageCancel and use the appropriate message later on (with the alert_message parameter) when calling entry, exit or close.

Special thanks to @KidCharlemagne for creating the basis of this guide !

Format de l’alerte

Learn more about how to create your TradingView alerts on the TradingView alert format guide.

Configuration de TradingView

Wondering how to make your OctoBot listen to TradingView signals ? Checkout our TradingView integration guide.