TradingView Alerrt Message Question - (alertcondition custom message question)

强颜欢笑 提交于 2021-01-29 14:22:33

问题


I am hoping someone help me.I know this is probably really simple, but I couldn't figure it out.

In a pivots script , it has the user can input the pivot type:

pivotType = input(title="Pivot Type", options=["Daily", "Intraday", "Weekly"], defval="Daily")

In the alert message, I want it to state the pivot type hit when the alert goes off. I want the message to say "Daily Pivot level hit", or "Weekly Pivot level hit". I tried the following below, but it didn't appear to work.:

alertcondition(condition=cross(close, r1), title="All Pivots Alert", message="A {{pivotType}} Pivot level hit")

I tried the format above, but it didn't appear to work. What do I need code in to have the pivotType be displayed as part of the message?

Thank you very much for your help!!


回答1:


It's not currently possible to include dynamic text in alertcondition() message text. See Is it possible to use a string that varies as an argument to the alertcondition() function’s message= parameter? for more details.

You could use this technique to plot a varying numeric value corresponding to each of your conditions: How can I include values that change in my alerts?



来源:https://stackoverflow.com/questions/62938813/tradingview-alerrt-message-question-alertcondition-custom-message-question

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!