Inquiries on how to label bar when MFI or RSI hline is breakthrough

南笙酒味 提交于 2020-06-29 03:47:13

问题


If MFI or RSI exceeds hline(80) or hline(20), I want to label the bar. Is there anyone who can tell me the script? Thank you ^^


回答1:


An example

//@version=4
study("My Script",overlay=true)
length = input(14),src = input(close)
//----
mfi = mfi(src,length)
rsi = rsi(src,length)
cnd = crossover(mfi,80) or crossover(rsi,80) or crossover(mfi,20) or crossover(rsi,20)
plotshape(cnd ? close : na,location=location.belowbar,text="Text")

You could also use label.new within an if statement but plotshape might be more appropriate in your case.



来源:https://stackoverflow.com/questions/62588280/inquiries-on-how-to-label-bar-when-mfi-or-rsi-hline-is-breakthrough

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