Sending Signals - Trading View Integration
For Service Providers
|
Tradingview Integration WebhookSend your Signals from TradingView to Zignaly |
With this integration method, Link your TradingView alerts to Zignaly using the Webhook URL option in your TradingView alert box. Set up alerts to activate your signals and automatically open positions on Zignaly. You can also apply tradingview strategy integrations & studies. |
- 3 ways to send your Signals to Zignaly
- Develop your Syntax
- Video
*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
2. Develop your Syntax
Alerts syntax example
For ENTRY
This is an example of a basic alert to send us a buy signal from your TradingView account. In JSON format:
{"key":"77713ecef07230d14d4e5ffecXXXXXXX","pair":"xrpbtc","exchange":"zignaly","type":"entry","positionSizePercentage":"20","signalId":"xrpbtc"}
The signalId is optional (only required if you are gonna send sell signals later).
For EXITING
It's important that the signalId matches the signalId of a previous entry signal.
{"key":"77713ecef07230d14d4e5ffecXXXXXXX","pair":"xrpbtc","exchange":"zignaly","type":"exit","signalId":"xrpbtc"}
- Optionally, you can add a lot more parameters within the alerts. Check all the available options in our SIGNALS document.
To build your Signals Syntax, we will establish the four components:
- First you need to have your Key
- Which type of Signal
- Mandatory parameters
- Optional parameters
2.1. Key
The key is what connects the signal with your service, to get your key, go to your provider page, In the edit tab you will find your key in the SignalURL (key=xxxx)
- It's important that you don't share this key with anybody because it controls your service (sending buy/sell orders to the exchange)
2.2. 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":"stop"
"type":"start"
"type":"disableMarket"
"type":"enableMarket"
"type":"panicSell"
"type":"update"
"type":"cancelEntry"
"type":"reverse"
*For more details on each Type of signal, please select click on the specific type to view the definition and conditions in our Signals article.
2.3. Mandatory Fields
On each type you will see the mandatory fields applied to this type of Signal.
(Check in the ‘signals’ article what are the mandatory fields for each Type of Signal.)
Now we can build our Syntax off of this information:
(Key,Type, plus mandatory fields> exchange, pair,positionSizePercentage & signalId)
Lets create a Type ‘entry’ signal (Example only):
{"key":"XXXXXXX","type":"entry","exchange":"binance","pair":"ethusdt","positionSizePercentage":"10","signalId":"123"} |
positionSizePercentage The percentage is from the configured value in the allocated balance setting. It has to be a value between 1 and 100. As always if the resulting position size is below the minimum allowed by the exchange, it will fail.
signalId An ID that you can use to identify the positions that have been opened from a specific buy signal. Later, if you want to act against those positions (selling, rebuying), you need to use the same ID.
2.4. Additional Parameters
If you would like to add additional parameters to this signal please review the other options under ‘Parameters’ on our Signals documentation. Be sure these parameters are permissible with the type of signal you are using.
Example: "orderType":"market",
Other parameter options may include: stopLossPrice, takeProfitPercentage, takeProfitAmountPercentage...
If trading futures, you will need to add 3 required parameters to this entry signal:
|
Now let assemble our entry signal to have our final completed Syntax (Example only):
For Spot |
{"key":"XXXXXXX","type":"entry","exchange":"binance","pair":"ethusdt","orderType":"market", "positionSizePercentage":"10","signalId":"123"} |
For Futures |
{"key":"XXXXXXX","type":"entry","exchange":"binance","exchangeAccountType":"futures", "pair":"ethusdt","orderType":"market","side":"long","leverage":"2","positionSizePercentage":"10", "signalId":"123"} |
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 (example Eth/USDT on Binance) & click ‘create an alert’:
In order to link your TradingView account to Zignaly you need to use the Webhook URL option in your TradingView alert box.
Check the option and enter our signal endpoint: https://zignaly.com/api/signals.php
(The conditions of your alert is up to you, for simplicity, in this example, we will use a basic price crossing condition.)
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’
3. Video
Take a look at this quick video to view the signal being sent to your Zignaly Copytrading service:
TradingView strategy alerts
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 that you would like to send to zignaly when entering a Long position |
Once your alert_message is setup, you can create an alert and 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/
and for the place holders:
https://www.tradingview.com/support/solutions/43000531021-how-to-use-a-variable-value-in-alert/
If you need any guidance on pinescript programming here is a telegram community support group: https://t.me/pinescripters
Comments
0 comments
Please sign in to leave a comment.