ruckard

Zignaly Tutorial

This strategy serves as a beginner's guide to connect TradingView signals to Zignaly Crypto Trading Platform.

It was originally tested at BTCUSDT pair and 1D timeframe.

Before using this documentation it's recommended that you:
  • Use default TradingView strategy script or another script and setup its associated alert manually. Just make the alert pop-up in the screen.
  • Create a 'Copy-Trader provider' (or Signal Provider) in Zignaly and send signals to it either thanks to your browser or with some basic programming.

SETTINGS
__ SETTINGS - Capital
  • (CAPITAL) Capital quote invested per order in USDT units {100.0}. This setting is only used when '(ZIG) Provider type' is set to 'Signal Provider'.
  • (CAPITAL) Capital percentage invested per order (%) {25.0}. This setting is only used when '(ZIG) Provider type' is set to 'Copy Trader Provider'.

__ SETTINGS - Misc
  • (ZIG) Enable Alert message {True}: Whether to enable alert message or not.
  • (DEBUG) Enable debug on order comments {True}: Whether to show alerts on order comments or not.
  • Number of decimal digits for Prices {2}.
  • (DECIMAL) Maximum number of decimal for contracts {3}.
__ SETTINGS - Zignaly
  • (ZIG) Integration type {TradingView only}: Hybrid: Both TradingView and Zignaly handle take profit, trailing stops and stop losses. Useful if you are scared about TradingView not firing an alert. It might arise problems if TradingView and Zignaly get out of sync. TradingView only: TradingView sends entry and exit orders to Zignaly so that Zignaly only buys or sells. Zignaly won't handle stop loss or other settings on its own.
  • (ZIG) Zignaly Alert Type {WebHook}: 'Email' or 'WebHook'.
  • (ZIG) Provider type {Copy Trader Provider}: 'Copy Trader Provider' or 'Signal Provider'. 'Copy Trader Provider' sends a percentage to manage. 'Signal Provider' sends a quote to manage.
  • (ZIG) Exchange: 'Binance' or 'Kucoin'.
  • (ZIG) Exchange Type {Spot}: 'Spot' or 'Futures'.
  • (ZIG) Leverage {1}. Set it to '1' when '(ZIG) Exchange Type' is set to 'Spot'.
__ SETTINGS - Strategy
  • (STRAT) Strategy Type: 'Long and Short', 'Long Only' or 'Short Only'.
  • (STOPTAKE) Take Profit? {false}: Whether to enable Take Profit.
  • (STOPTAKE) Stop Loss? {True}: Whether to enable Stop Loss.
  • (TRAILING) Enable Trailing Take Profit (%) {True}: Whether to enable Trailing Take Profit.
  • (STOPTAKE) Take Profit % {3.0}: Take profit percentage. This setting is only used when '(STOPTAKE) Take Profit?' setting is set to true.
  • (STOPTAKE) Stop Loss % {2.0}: Stop loss percentage. This setting is only used when '(STOPTAKE) Stop Loss?' setting is set to true.
  • (TRAILING) Trailing Take Profit Trigger (%) {2.5}: Trailing Stop Trigger Percentage. This setting is only used when '(TRAILING) Enable Trailing Take Profit (%)' setting is set to true.
  • (TRAILING) Trailing Take Profit as a percentage of Trailing Take Profit Trigger (%) {25.0}: Trailing Stop Distance Percentage. This setting is only used when '(TRAILING) Enable Trailing Take Profit (%)' setting is set to true.
  • (RECENT) Number of minutes to wait to open a new order after the previous one has been opened {6}.

DEFAULT SETTINGS

By default this strategy has been setup with these beginner settings:
  • '(ZIG) Integration type' : TradingView only
  • '(ZIG) Provider type' : 'Copy Trader Provider'
  • '(ZIG) Exchange' : 'Binance'
  • '(ZIG) Exchange Type' : 'Spot'
  • '(STRAT) Strategy Type' : 'Long Only'
  • '(ZIG) Leverage' : '1' (Or no leverage)
but you can change those settings if needed.


FIRST STEP
  • For both future of spot markets you should make sure to change '(ZIG) Zignaly Alert Type' to match either WebHook or Email. If you have a non paid account in TradingView as in October 2020 you would have to use Email which it's free to use.

RECOMMENDED SETTINGS
__ RECOMMENDED SETTINGS - Spot markets
  • '(ZIG) Exchange Type' setting should be set to 'Spot'
  • '(STRAT) Strategy Type' setting should be set to 'Long Only'
  • '(ZIG) Leverage' setting should be set to '1'
__ RECOMMENDED SETTINGS - Future markets
  • '(ZIG) Exchange Type' setting should be set to 'Futures'
  • '(STRAT) Strategy Type' setting should be set to 'Long and Short'
  • '(ZIG) Leverage' setting might be changed if desired.
__ RECOMMENDED SETTINGS - Signal Providers
  • '(ZIG) Provider type' setting should be set to 'Signal Provider'
  • '(CAPITAL) Capital quote invested per order in USDT units' setting might be changed if desired.
__ RECOMMENDED SETTINGS - Copy Trader Providers
  • '(ZIG) Provider type' setting should be set to 'Copy Trader Provider'
  • '(CAPITAL) Capital percentage invested per order (%)' setting might be changed if desired.
  • Strategy Properties setting: 'Initial Capital' might be changed if desired.

INTEGRATION TYPE EXPLANATION
  • 'Hybrid': Both TradingView and Zignaly handle take profit, trailing stops and stop losses. Useful if you are scared about TradingView not firing an alert. It might arise problems if TradingView and Zignaly get out of sync.
  • 'TradingView only': TradingView sends entry and exit orders to Zignaly so that Zignaly only buys or sells. Zignaly won't handle stop loss or other settings on its own.

HOW TO USE THIS STRATEGY
  • Beginner: Copy and paste the strategy and change it to your needs. Turn off '(DEBUG) Enable debug on order comments' setting.
  • Medium: Reuse functions and inputs from this strategy into your own as if it was a library.
  • Advanced: Check Strategy Tester. List of trades. Copy and paste the different suggested 'alert_message' variable contents to your script.
  • Expert: I needed a way to pass data from TradingView script to the alert. Now I know it's the 'alert_message' variable. I can do this own my own.


ALERTS SETUP
This is the important piece of information that allows you to connect TradingView to Zignaly in a semi-automatic manner.
__ ALERTS SETUP - WebHook
  • Webhook URL: https : // zignaly . com / api / signals.php?key=MYSECRETKEY
  • Message: { {{strategy.order.alert_message}} , "key" : "MYSECRETKEY" }
__ ALERTS SETUP - Email
  • Setup a new Hotmail account
  • Add it as an 'SMS email' in TradingView Profile settings page.
  • Confirm your own the email address
  • Create a rule in your Hotmail account that 'Redirects' (not forwards) emails to 'signals @ zignaly . email' when (1): 'Subject' includes 'Alert', (2): 'Email body' contains string 'MYZIGNALYREDIRECTTRIGGER' and (3): 'From' contains 'noreply @ tradingview . com'.
  • In 'More Actions' check: Send Email-to-SMS
  • Message: ||{{strategy.order.alert_message}}||key=MYSECRETKEY||
    MYZIGNALYREDIRECTTRIGGER


'(DEBUG) Enable debug on order comments' is turned on by default so that you can see in the Strategy Tester. List of Trades. The different orders alert_message that would have been sent to your alert. You might want to turn it off it some many letters in the screen is problem.

STRATEGY ADVICE
  • If you turn on 'Take Profit' then turn off 'Trailing Take Profit'.

ZIGNALY SIDE ADVICE
  • If you are a 'Signal Provider' make sure that 'Allow reusing the same signalId if there isn't any open position using it?' setting in the profile tab is set to true.
  • You can find your 'MYSECRETKEY' in your 'Copy Trader/Signal' provider Edit tab at 'Signal URL'.

ADDITIONAL ZIGNALY DOCUMENTATION
  • docs . zignaly . com / signals / how-to -- How to send signals to Zignaly
  • 3 Ways to send signals to Zignaly
  • SIGNALS

FINAL REMARKS
  • This strategy tries to match the Pine Script Coding Conventions as best as possible.
Remove from Favorite Scripts Add to Favorite Scripts

Comments

Zignaly added around November 2020 an additional mode named Profit-Sharing Service or 'Copytrading V2'.

You can also generate your orders thanks to these settings:

* (ZIG) Provider type: 'Copy Trader Provider'
* (ZIG) Exchange: 'Binance'
* (ZIG) Exchange Type: 'Futures'

Finally just replace:

"exchange":"Binance"

to

"exchange":"Zignaly"

in the suggested signals.
Reply
so you use strategy type to send alerts to zygnaly bot ?
Reply
ruckard RafaelZioni
@RafaelZioni, Yes, I prefer strategies over indicators because I can backtest them and because the order goes in a single alert_message variable which I can write from the script itself in one go. No need to 'program' a lot in the alert message box.
Reply
hacktek ruckard
@ruckard, This looks excellent. Does it work accurately though? I tried to do something similar using one of @RafaelZioni 's scripts and did not have very good success. It wasn't nearly as sophisticated as this...I essentially hardcoded the alert messages into the entry and exit functions in a way that fit the strategy using Zignaly's API and, while it worked, I found that TV often failed to trigger alerts or skipped them for some reason. For example it would trigger a take-profit-1 alert before a buy alert and all sorts of weirdness like that. Reading the documentation on strategy alerts, an alert is supposed to trigger for each command generating an order (strategy.entry, strategy.exit or strategy.order) so I don't know why I didn't have that experience.

https://www.tradingview.com/support/solutions/43000481368-strategy-alerts/
Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Referred friends Coins My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out