---
title: TradingView JSON Alert Configuration – Full Guide
slug: tradingview-json-alert-configuration
date: 2025-03-18
modified: 2026-06-15
author: Bhavishya Goyal
excerpt: ""
meta_description: "Learn how to create and use TradingView JSON alert configuration for automated buy/sell execution. Includes examples for strategies, indicators, and pyramid mode."
focus_keyword: TradingView JSON alert configuration
canonical_url: "https://docs.pickmytrade.trade/docs/tradingview-json-alert-configuration/"
og_title: TradingView JSON Alert Configuration – Full Guide
og_description: "Learn how to create and use TradingView JSON alert configuration for automated buy/sell execution. Includes examples for strategies, indicators, and pyramid mode."
og_image: ""
schema_type: FAQPage
categories: []
tags: []
reading_time: 6
word_count: 1398
robots: "index, follow"
lang: en-US
---

# Generate Alert – JSON Configuration for TradingView

**Last Updated:** June 15, 2026  |  **Published:** March 18, 2025

## Introduction

This guide covers the full setup of **TradingView JSON alert configuration** for automated trading. You’ll learn how to use JSON to send buy, sell, and close signals directly from TradingView strategies or indicators to your broker platform.

**For a visual walkthrough, refer to the accompanying video: **

---

## What is JSON?

JSON (JavaScript Object Notation) is a simple text format that tells PickMyTrade **exactly what trade to place** when an alert triggers.

Think of JSON as a **recipe for your trade**:

- **What** to trade (symbol)
- **Which direction** (buy, sell, or close)
- **How much** (quantity)
- **How to manage risk** (take profit, stop loss, breakeven)

When TradingView sends this JSON through a webhook, PickMyTrade reads it and places the trade automatically.

---

## Where This JSON Is Used

- Paste the JSON into the **Alert Message** field in TradingView
- Make sure the **Webhook URL** is enabled
- When the alert fires, the trade is sent to PickMyTrade instantly

---

## **1. Strategy JSON**

This JSON configuration is used for executing strategy-based automated trades in TradingView. Trades are executed based on predefined conditions within a TradingView strategy.

### **1.1 JSON Configuration**

```

```

```
{
    "symbol": "NQ",
    "date": "{{timenow}}",
    "data": "{{strategy.order.action}}",
    "quantity": "{{strategy.order.contracts}}",
    "risk_percentage": 0,
    "price": "{{close}}",
    "tp": 0,
    "percentage_tp": 0,
    "dollar_tp": 0,
    "sl": 0,
    "dollar_sl": 0,
    "percentage_sl": 0,
    "trail": 0,
    "trail_stop": 0,
    "trail_trigger": 0,
    "trail_freq": 0,
    "update_tp": false,
    "update_sl": false,
    "breakeven": 0,
    "token": "your_token_here",
    "pyramid": true,
    "reverse_order_close": false,
    "account_id": "your_account_id",
    "multiple_accounts": [
        {
            "token": "your_token_here",
            "account_id": "FFFF",
            "risk_percentage": 0,
            "quantity_multiplier": 1
        }
    ]
}
```

### **1.2 Parameter Explanation**

#### **symbol**

- Represents the trading instrument (e.g., `"NQ"` for Nasdaq futures).
- If using TradingView, ensure the symbol is mapped correctly, especially for continuous contracts.

#### **date**

- The timestamp when the order is sent (`"{{timenow}}"`).

#### **data**

- Determines the action: `"buy"`, `"sell"`, or `"close"`.
- For a strategy, this should be `{{strategy.order.action}}`.

#### **quantity**

- Defines the trade size.
- Can be an absolute value (e.g., `quantity: 2`) or a percentage-based risk calculation.
- If `risk_percentage` is specified and `quantity` is not provided, the system calculates the quantity based on the stop loss and account balance.

#### **risk_percentage**

- Percentage of risk allocated to the trade.
- If specified, the system calculates the quantity based on the stop loss and account balance.

#### **price**

- Sets the order execution price.
- If provided, the order will be placed as a **limit order**.
- If not provided, the latest **close price** will be used.

#### **tp / percentage_tp / dollar_tp**

- **Take Profit settings**:
  - If `tp` is provided, it is used directly.
  - If not specified, the system checks predefined settings and applies them automatically.

#### **sl / percentage_sl / dollar_sl**

- **Stop Loss settings**:
  - If `sl` is provided, it is used directly.
  - If not specified, the system checks predefined settings and applies them automatically.

#### **update_tp**

- `true`: Updates an existing take profit order instead of placing a new one.
- `false`: A new TP order will be created.

#### **update_sl**

- `true`: Updates an existing stop loss order instead of placing a new one.
- `false`: A new SL order will be created.

#### **reverse_order_close**

- `true`: Closes any existing opposite position before executing the new trade.
- `false`: No position closure before execution.

#### **account_id**

- Defines the specific **Tradovate account** to be used.
- If not provided, the system defaults to the **primary linked account**.

---

## **2. Indicator JSON**

This JSON configuration is used for indicator-based trading signals. When a TradingView indicator generates a buy or sell signal, this JSON executes the trade.

![TradingView JSON alert configuration example with chart, alert panel, and code editor for automated trading
](https://docs.pickmytrade.trade/wp-content/uploads/2025/03/20250624_1704_TradingView-Alert-Configuration_simple_compose_01jygvd5effqsvpzwmxnjg9j56-1024x683.png)

### **2.1 JSON Configuration**

```

```

```
{
    "symbol": "NQ",
    "date": "{{timenow}}",
    "data": "buy",
    "quantity": 10,
    "risk_percentage": 0,
    "price": "{{close}}",
    "tp": 0,
    "percentage_tp": 0,
    "dollar_tp": 10,
    "sl": 0,
    "percentage_sl": 0,
    "dollar_sl": 5,
    "trail": 1,
    "trail_stop": 3.75,
    "trail_trigger": 5,
    "trail_freq": 1.25,
    "update_tp": false,
    "update_sl": false,
    "breakeven": 3.75,
    "token": "your_token_here",
    "pyramid": false,
    "reverse_order_close": true,
    "order_type": "MKT",
    "account_id": "your_account_id",
    "multiple_accounts": [
        {
            "token": "your_token_here",
            "account_id": "df3321",
            "risk_percentage": 0,
            "quantity_multiplier": 1
        }
    ]
}
```

### **2.2 Parameter Explanation**

#### **symbol**

- Represents the trading instrument (e.g., `"NQ"` for Nasdaq futures).

#### **date**

- The timestamp when the order is sent (`"{{timenow}}"`).

#### **data**

- Determines the action: `"buy"`, `"sell"`, or `"close"`.
- For an indicator, `"buy"` or `"sell"` must be explicitly set.

#### **quantity**

- Defines trade size.
- If `risk_percentage` is set and `quantity` is omitted, the system automatically calculates the quantity based on SL and available account balance.

#### **price**

- Sets the entry price.
- If passed, the system treats the order as a **limit order**.
- If not passed, the system defaults to the latest **close price**.

#### **tp / percentage_tp / dollar_tp**

- **Take Profit settings**:
  - If `tp` is provided, it is used directly.
  - If not specified, the system checks predefined settings and applies them automatically.

#### **sl / percentage_sl / dollar_sl**

- **Stop Loss settings**:
  - If `sl` is provided, it is used directly.
  - If not specified, the system checks predefined settings and applies them automatically.

#### **update_tp**

- `true`: Modifies the existing TP order instead of creating a new one.

#### **update_sl**

- `true`: Modifies the existing SL order instead of creating a new one.

#### **reverse_order_close**

- `true`: If a position exists in the opposite direction, it is closed before executing the new order.

#### **account_id**

- Defines the **Tradovate account** for execution.
- If not specified, the system uses the **default account**

## **3. Pyramid Mode (Multiple Positions)**

### **3.1 How Pyramid Mode Works**

- **pyramid: false** (default behavior):
  - If a **buy alert** is received while a buy or sell position is open, the existing position is closed before opening a new one.
  - If a **sell alert** is received while a buy or sell position is open, the existing position is closed before opening a new one.
- **pyramid: true** (enabled mode):
  - **Buy alerts** will **not** cancel existing buy positions (allows stacking multiple buy trades).
  - **Sell alerts** will **not** cancel existing sell positions (allows stacking multiple sell trades).

This allows traders to scale into a trade instead of closing and reopening positions.

### **3.2 Pyramid Mode and Reverse Order Close**

| Reverse Order Close | Pyramid | What Happens to the Existing Position (Same Signal)? | What Happens to the Existing Position (Opposite Signal)? | What Happens to a New Signal? |
| --- | --- | --- | --- | --- |
| True | False | It will be closed | It will be closed | A new trade opens if not a close signal. |
| True | True | It will not be closed | It will be closed | A new trade opens if not a close signal. |
| False | N/A | It will not close the trade | It will not close the trade | A new trade opens if not a close signal. |

---

## **4. Take Profit (TP) &amp; Stop Loss (SL) Settings**

### **4.1 Take Profit (TP)**

A predefined price level where a position is closed to secure profits.  
**Example:** If TP is set at 15,500, and the market price reaches this level, the trade is automatically closed to lock in profits.

### **4.2 Stop Loss (SL)**

A predefined price level where the position is closed to limit losses.  
**Example:** If SL is set at 15,450, and the price drops to this level, the trade closes to prevent further losses.

### **4.3 TP1 &amp; TP2 (Partial Profit Levels)**

- **TP1:** First exit level (e.g., 50% of the position closes at 15,500).
- **TP2:** Second exit level (remaining position closes at 15,550).

This strategy helps lock in partial profits while letting the rest of the trade run.

---

## Common Mistakes to Avoid

- Using the wrong symbol format
- Leaving extra commas or missing brackets in tradingview alert messagebox
- Forgetting to enable Webhook URL
- Using unsupported TradingView plans

---

## Before You Save Your Alert

Double-check everything before clicking **Create**:

- Symbol matches your Tradovate symbol exactly
- Quantity is a positive number
- TP and SL values make sense for your strategy
- Webhook URL is copied correctly
- Account ID matches your Risk Settings

---

## FAQ’s

**What is a TradingView JSON alert in PickMyTrade?** 

A TradingView JSON alert is a structured message sent through a webhook that tells PickMyTrade what trade to execute, including symbol, side, quantity, and risk settings.

 
 
**Which actions can JSON alerts trigger?** 

JSON alerts can typically trigger **buy**, **sell**, and **close** actions depending on how the message is configured inside TradingView.

 
 
**Can I include stop loss and take profit in the JSON?** 

Yes. The guide explains that risk controls such as stop loss, take profit, and breakeven can be included directly in the JSON payload for automated execution.

 
 
**Do I need coding experience to use JSON alerts?** 

No. Most users can copy a PickMyTrade-generated template and only edit key fields like symbol, quantity, or order direction.

 
 

---

## More Resources {#41-toc-title}

Want to automate trades on platforms beyond Rithmic, such as Interactive Brokers, TradeLocker, TradeStation, or ProjectX?  
[Explore all PickMyTrade setup guides](https://docs.pickmytrade.io/docs/)

Using Tradovate instead?  
[View the Tradovate automation guide](https://docs.pickmytrade.trade/docs/)

[Get PickMyTrade → Automate Your TradingView Strategies](https://pickmytrade.trade "PickMyTrade - Automated Trading")

Last updated: **June 15, 2026**

For AI tools &amp; developers:[View Markdown →](https://docs.pickmytrade.trade/docs/tradingview-json-alert-configuration.md)