You can now set up TradingView strategies alerts and automate them through the WunderTrading platform.

Follow this guide to set up your first TradingView strategy bot alerts.

Step 1

Open your strategy in TradingView. In your pine script, you will have to add comments to your “strategy.entry()”; “strategy.order()”; “strategy.exit()”; “strategy.close()”. Copy your comments from your WunderTrading bot settings.

Example code

/// LONG
strategy.entry("long", true, when = entry_long, comment=" ***INSERT OPEN LONG COMMENT*** ")
strategy.exit("long", when=exit_long, stop=long_stop_level, limit=long_take_level, comment="***INSERT CLOSE LONG COMMENT***")
strategy.close("long", when=exit_long, comment = "***INSERT CLOSE LONG COMMENT***")

/// SHORT
strategy.entry("short", false, when = entry_short, comment="***INSERT OPEN SHORT COMMENT***")
strategy.exit("short", when=exit_short, stop=short_stop_level, limit=short_take_level, comment = "***INSERT CLOSE SHORT COMMENT***")
strategy.close("short", when=exit_short, comment = "***INSERT CLOSE SHORT COMMENT***")

Step 2

Create an alert. This time it would be a single alert that would be triggered, with the appropriate comment, each time when something will occur in your strategy (Entry / Exit / Trailing profits etc).

Step 3

Replace your alert message with a single piece of code: {{strategy.order.comment}} This will ensure that every time the alerts would be triggered the appropriate message would be sent to your WunderTrading bot.

Step 4

Launch your Alerts in TradingView and enable your WunderTrading Bot.


Important!

If you are trading on lower timeframes (1 to 5 minutes) your strategy may have the following error on execution: Error: Maximum number of orders reached (9000) was reached.

Solution: You will have to add a time interval or start date from which the backtest will be starting and put this code before strategy execution.


Code

/// PERIOD /// 
testStartYear = input(2019, "Backtest Start Year")
testStartMonth = input(1, "Backtest Start Month")
testStartDay = input(1, "Backtest Start Day")
testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,0,0)

testStopYear = input(2020, "Backtest Stop Year")
testStopMonth = input(12, "Backtest Stop Month")
testStopDay = input(31, "Backtest Stop Day")
testPeriodStop = timestamp(testStopYear,testStopMonth,testStopDay,0,0)

testPeriod() =>
time >= testPeriodStart and time <= testPeriodStop ? true : false

if testPeriod()
strategy.entry()
strategy.close()

Note

You need a TradingView Pro subscription to be able to receive Webhook notifications on WunderTrading. Sign up to TradingView now.


Problems with Strategy alert

  1. Errors with swing trade signals. If you have Exit Long and Entry Short at the same time, TV sometimes will not send one of these signals.

    Solution: Set separate alerts for your long position and short position.

  2. Error with a log of alerts. Sometimes TV will not show the alert in the log file on TV, however, if you open the script on the graph you would be able to see this signal. Thus, it may appear that WunderTrading would open a position whereas TV does not show it in the log.


Hint: Every change you make on either the code or the alerts. You need to delete the alert and create a brand new one.

Did this answer your question?