← Back to Help Center
Trading

TradingView alerts

Send your TradingView strategy alerts to PIPFORGE so they become broker orders.

Set up the webhook

  • Create a TradingView webhook connection in /brokers and copy the URL.
  • In TradingView, create an alert and enable the Webhook URL option.
  • Paste the PIPFORGE webhook URL.

Alert message format

The alert message must be JSON. PIPFORGE supports these fields:

  • ticker or symbol — the instrument code.
  • action or side — buy, sell, long or short.
  • close, price or entry — the entry price.
  • stopLoss, stop_loss or sl.
  • takeProfit, take_profit or tp.
  • riskPercent — optional, defaults to 1%.

Example Pine Script

Add an alert() call in your Pine Script strategy. When the condition fires, TradingView sends the JSON to PIPFORGE and PIPFORGE forwards it to your connected broker.

//@version=5
strategy("PIPFORGE webhook", overlay=true)
longCondition = ta.crossover(ta.sma(close, 14), ta.sma(close, 28))
shortCondition = ta.crossunder(ta.sma(close, 14), ta.sma(close, 28))

if longCondition
    alert('{"ticker":"' + syminfo.ticker + '","action":"buy","close":' + str.tostring(close) + ',"stopLoss":' + str.tostring(close*0.99) + ',"takeProfit":' + str.tostring(close*1.02) + '}', alert.freq_once_per_bar_close)

if shortCondition
    alert('{"ticker":"' + syminfo.ticker + '","action":"sell","close":' + str.tostring(close) + ',"stopLoss":' + str.tostring(close*1.01) + ',"takeProfit":' + str.tostring(close*0.98) + '}', alert.freq_once_per_bar_close)