Automate Tradingview Strategies

Watch the Video

Watch the Video

Click here to watch the full video on YouTube


Code Snippets

Code Shared In Video to set up tradingview alerts.

longstring = 'Input your custom alert message here. \n and put {{strategy.order.alert_message}} in Message box.'
shortstring = 'Input your custom alert message here. \n and put {{strategy.order.alert_message}} in Message box.'

long=input.text_area(title='Long Alert Message', defval='Long ', confirm=false, group='Alert Messages', tooltip=longstring)
short=input.text_area(title='Short Alert Message', defval='short ', confirm=false, group='Alert Messages', tooltip=shortstring)

if your_long_condition
    alert(long)
if your_short_condition
    alert(short)

For Strategy alert message.

{{strategy.order.alert_message}}