Sending Signals - Trading View Integration

For Fund Managers

You link your TradingView alerts to Zignaly using the Webhook URL option. It's available in your TradingView alert box.

You can also apply TradingView strategy integrations & studies.


Check out this article in order to connect your Profit Sharing 2.0 with Zignaly first:


Please note you must have a paid TradingView account to use webhooks on their platform. TradingView does not give access to this feature with Trial accounts.

Develop your Syntax

Alerts syntax example:

For ENTRY

This example is a primary alert to send us a buy signal from your TradingView account. In JSON format:

*Syntax for Spot:
We want to buy 100 USDT in ADA coins at the market price.

{"key":"YOURKEY",
"type":"entry",
"exchange":"zignaly",
"orderType":"market",
"pair":"adausdt",
"positionSize":"100",
"signalId":"YOURSIGNALID"}

*Syntax for Futures:
We want to buy 100 USDT in ADA coins at the market price.

{"key":"YOURKEY",
"type":"entry",
"exchange":"zignaly",
"orderType":"market",
"pair":"adausdt",
"positionSize":"100",
"side":"long",
"leverage":"123",
"signalId":"YOURSIGNALID"}

The signalId is optional (only required if you are going to send sell signals later).

For EXITING

The signalId must match the signalId of a previous entry signal.

*Syntax for Spot and Futures:
We want to close the position at the market price.

{"key":"YOURKEY",
"type":"exit",
"exchange":"zignaly",
"orderType":"market",
"pair":"adausdt",
"signalId":"YOURSIGNALID"}

Optionally, you can add a lot more parameters within the alerts. Please review all the available options in our SIGNALS document.

To build your Signals Syntax, we will establish the four components:

  1. First, you need to have your Signal Key

  2. Which type of Signal

  3. Mandatory parameters

  4. Optional parameters

Key

The key is what connects the signal with your service. To get your key, go to your connected API exchange from PS2. You will find the Signal Key in Settings.

Attention! Please ensure you don't share the URL containing your key. Anyone with that key could manage your account.

Type

Every signal you send will need to specify the type of signal and enter this into your syntax:

"type":"entry",
"type":"exit",

As well as other options:


"type":"update"
"type":"cancelEntry"
"type":"reverse"

Please click on the type to view the definition and conditions in our Signals article.

Mandatory Fields

You will see the mandatory fields applied to this type of Signal in each kind.
(Check the mandatory fields for each Type of Signal in thesignals’ article.)

Now we can build our Syntax off of this information:
(Key, Type, plus mandatory fields > Exchange, pair, positionSize & signalId)

Let's create a Type ‘entry’ signal (Example only):

Examples:

*Syntax for Spot:

{"key":"YOURKEY",
"type":"entry",
"exchange":"zignaly",
"orderType":"market",
"pair":"adausdt",
"positionSize":"100",
"takeProfitPercentage1":"3",
"takeProfitAmountPercentage1":"100",
"signalId":"YOURSIGNALID"}

*Syntax for Futures:

{"key":"YOURKEY",
"type":"entry",
"exchange":"zignaly",
"orderType":"market",
"pair":"adausdt",
"positionSize":"100",
"side":"long/short",
"leverage":"123",
"takeProfitPercentage1":"3",
"takeProfitAmountPercentage1":"100",
"signalId":"YOURSIGNALID"}

Other Parameters

If you would like to add additional parameters to this signal, please review the other options in our Signals documentation. Be sure these parameters are permissible with the signal you are using.


Example:

"stopLossPercentage" parameter can only go with signal type entry or update ("type":"update" or "type":"entry")

If trading futures, you will need to add 2 required parameters to this entry signal:

  • side (You must use this field to identify a Long or Short position)

  • leverage (Enter your leverage amount, if not using enter 1)

Now let's assemble our entry signal to have our final completed Syntax (Example only):

For Spot

For Futures

{"key":"YOURKEY",
"type":"entry",
"exchange":"zignaly",
"orderType":"market",
"pair":"adausdt",
"positionSize":"100",
"stopLossPercentage":"-3",
"signalId":"YOURSIGNALID"}
{"key":"YOURKEY",
"type":"entry",
"exchange":"zignaly",
"orderType":"market",
"pair":"adausdt",
"positionSize":"100",
"side":"long/short",
"leverage":"5",
"stopLossPercentage":"-3",
"signalId":"YOURSIGNALID"}

These are examples of an entry Syntax you would enter into your Tradingview alert box.
Here is a good resource recommended by the community to use to verify that your syntax is correct > JSON format: https://jsonformatter.curiousconcept.com/

Now, link your TradingView:

On your TradingView account, open the corresponding chart (for example BTC/USDT on Binance) & click ‘create an alert’:

(For simplicity, the conditions of your alert are up to you. In this example, we will use a basic price crossing condition.)

You use the Webhook URL option in your TradingView alert box to link your TV to Zignaly.

Check the option and enter our signal endpoint: https://zignaly.com/api/trading_signals.php

If you're using the PS1 interface and you have not migrated your service to the new interface, you should enter this signal endpoint instead: https://zignaly.com/api/signals.php


Something that usually makes it difficult to send signals is the format of the webhook text. The way to avoid having problems with this is:

  • Copy it directly from the browser bar, as seen in this image:

  • After that, paste it on this alert box TV webhook URL. (Do not let the browser autocomplete the field).


Enter your Signal Syntax into the message field.

(If you are using pine scripts or TradingView strategy alerts we will provide some additional resources at the end of this article)


Once you have filled in your alert box, click ‘Create’.
When your alert is triggered, your position will open on Zignaly.


Look at this quick video to view how to send signals to your service:


TV uses your strategy entry and exit to trigger the alert instead of the alert condition, like in a study.
Here is an example:

if (longCondition)
strategy.entry("LongEntry", strategy.long ,alert_message = entry_long_message)

longCondition would be the cross that triggers the long position

entry_long_message would be the signals syntax when entering a Long position

Once you complete your alert_message, you can create an alert. Then, enter this as the message: ##{{strategy.order.alert_message}}​

You can find more information in the TradingView documentation: https://www.tradingview.com/support/solutions/43000481368-strategy-alerts/

For the placeholders:
https://www.tradingview.com/support/solutions/43000531021-how-to-use-a-variable-value-in-alert/

If you need any guidance on pine script programming here is a telegram community support group: https://t.me/pinescripters

Did this answer your question?