> For the complete documentation index, see [llms.txt](https://tv-connector.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tv-connector.gitbook.io/docs/setup/test-tradingview-strategy-alert.md).

# Test Tradingview strategy alert

1. On the Tradingview website, select BINANCE:BTCPERP(or whatever ticker your want) and set the time interval to 1 minute.

![](/files/qsXlMtEh39zFo0cv9BSi)

2\. Open "Pine Editor" tab and paste the following script after deleting shown original script. Then click "Add to chart"

```
//@version=5
strategy("My test strategy")

_TestPeriod() =>
    time >= timenow - 10000000 ? true : false
    
if _TestPeriod()
    if (bar_index % 2 == 0)
        strategy.entry("My Long Entry Id", strategy.long)
    else
        strategy.entry("My Short Entry Id", strategy.short)
```

![](/files/uZjRYv42BF2G2wakTx5o)

3\. Click Alert button

![](/files/VQ9SjTxOG8vhrZZnLpw5)

4\. At Create alert popup, Set “Webhook URL” and “Message” and click “Create”

**Webhook URL:** HTTPS endpoint URL got in [Running on local PC](/docs/setup/run-on-local-pc.md) or [Run on cloud service](https://tv-connector.gitbook.io/docs/setuup/run-on-cloud-service)

**Message:**  paste the following code

dYdX v4:

```
{
"exchange": "dydxv4",
"strategy":"testStrategy",
"market":"BTC_USD",
"size":"0.0001",
"reverse":false,
"order":"{{strategy.order.action}}",
"position":"{{strategy.market_position}}",
"price":"{{strategy.order.price}}"
}
```

Perpetual Protocol:

```
{
"exchange": "perpetual",
"strategy":"testStrategy",
"market":"BTC_USD",
"size":"0.001",
"reverse":false,
"order":"{{strategy.order.action}}",
"position":"{{strategy.market_position}}",
"price":"{{strategy.order.price}}"
}
```

GMX:

```
{
"exchange": "gmx",
"strategy":"testStrategy",
"market":"BTC_USD",
"sizeUsd":"3",
"reverse":false,
"order":"{{strategy.order.action}}",
"position":"{{strategy.market_position}}",
"price":"{{strategy.order.price}}"
}
```

<img src="/files/QKdLDrCqBowEqn3tjuVm" alt="" data-size="original">

This alert is triggered every minute and creates a buy/sell order alternately.&#x20;

You can check if an order is executed on the exchange you selected after the first alert is triggered.
