I'm trying to create alerts with variables. I've seen this thread and this article, but I believe because my condition comes from a Security function, I'm having problems with creating the alerts.
s01 = input('DOTSDT', type=input.symbol)
screenerFunc() => triggerA and triggerB
c01 = security(s01, res, screenerFunc())
alertcondition(c01, title="ALERT!", "Look at " + S01)
If I try the above, I get a:
Cannot call 'alertcondition' with arguments (series[bool], title=literal string, message=input string)
If I try the following...
alertcondition(c01, title="ALERT!", message="Look at: {{ticker}}")
...I get a
Cannot use a mutable variable as an argument of the security function.
UPDATE
In fact, the issue seems to be using the security function as a condition for alertcondition rather than the use of any variable. I've tried to simply use a static message, but still get the same error Cannot use a mutable variable as an argument of the security function.
UPDATE!!!
I've created another thread, hopefully a more clear one:
“alertcondition” fails when the condition comes from a security function
Appreciate your help :-)
question from:
https://stackoverflow.com/questions/65859751/how-to-add-variables-to-an-alertcondition-when-your-condition-is-a-security 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…