5. Setting Up TradingView Alerts

Configure alerts to trigger NinjaSync webhooks.

TradingView alerts are the mechanism that connects your GFREQ algo signals to NinjaSync for automated execution. When the algo generates a signal, the alert fires a webhook containing the order details as a JSON payload.

Creating an Alert

01

Open the Alert Dialog

Right-click on the chart and select Add Alert, or press Alt + A.

02

Select the Condition

In the Condition dropdown, select your GFREQ strategy. Set the condition to alert() function calls only.

03

Set Expiration

Set the alert expiration. Open-ended is recommended for continuous operation. Note: open-ended alerts require a paid TradingView plan.

04

Enable Webhook

In the Notifications tab, check Webhook URL and paste your NinjaSync ngrok URL:

Webhook URL
https://your-domain.ngrok-free.app/webhook

Alert Message (Payload)

GFREQ algos are invite-only (locked) Pine Script strategies. The alert message is built into the strategy — you do not need to write the JSON payload manually. The strategy's alert() function outputs the correct payload automatically.

If you need to customize the payload (e.g. change the account name or add auth_token), use the NinjaSync Payload Tester to generate templates, then paste into the TradingView alert's Message field.

Example Payload
{
  "alert": "OCO Market Long",
  "account": "Sim101",
  "ticker": "NQ MAR26",
  "qty": "1",
  "take_profit_price": "21500",
  "stop_loss_price": "21400"
}

Important

Webhook alerts require a paid TradingView plan (Pro, Pro+, or Premium). The free TradingView plan does not support webhook notifications.