Trying to setup a tradingview v5 strategy to send alerts to discord via webhook.
I found another user question and the code below was used. Similarly, I cannot get the alerts to go to TV. I can get it to work if I manually type into message window but then I am forced to label the message as either a long or a short. How do I go about making a Long and a Short alert with this strategy?
smaLong = ta.crossover(fastMa, slowMa)
smaShort = ta.crossunder(fastMa, slowMa)
//if trigger
SL = '{"content": "@everyone" ,"embeds": [{"title": "{{ticker}} 3M :chart_with_upwards_trend:","description": "SMA LONG\n Might want to look at BUY here!\n Price ${{close}}", "color": "2092045","author": {"name":null},"timestamp": "{{timenow}}"}],"username": "Alertbot"}'
SS = '{"content": "@everyone","embeds": [{"title": "{{ticker}} 3M :chart_with_downwards_trend:","description": "SMA SHORT\n Might want look at SELL here!\nPrice ${{close}}", "color": "14681898","author": {"name":null},"timestamp": "{{timenow}}"}],"username": "Alertbot"}'
alertcondition(condition=smaLong,title="Webhook SMA Long", message= SL)
alertcondition(condition=smaShort,title="Webhook SMA Short", message= SS)
See code used above.....