首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >RSI跟踪pinescript

RSI跟踪pinescript
EN

Stack Overflow用户
提问于 2020-06-21 00:58:16
回答 1查看 119关注 0票数 1

我需要帮助在RSI pinescript=假设'X‘的价格是6,000美元,它上升到7,000美元,RSI也高于band70。现在我希望警报在它跌到6980美元时被激活(即回落20美元)。如何在RSI pinescript中编写此跟踪脚本。

代码语言:javascript
复制
 //@version=4
study("rsi overbought", overlay=true)

rsiSource = input(title="RSI Source", type=input.source, defval=close)
rsiLength = input(title="RSI Length", type=input.integer, defval=14)
rsiOverbought = input(title="RSI Overbought Level", type=input.integer, defval=70)


rsiValue = rsi(rsiSource, rsiLength)
isRsiOB = rsiValue >= rsiOverbought


plotshape(isRsiOB, title="Overbought", location=location.abovebar, color=color.red, transp=0, style=shape.triangledown, text="Sell")

alertcondition(isRsiOB , title="RSI Signal!", message="RSI Signal Detected for {{ticker}}")  
EN

回答 1

Stack Overflow用户

发布于 2021-05-23 13:28:51

试试像这样的东西

代码语言:javascript
复制
trail_high = highest(high,20) //highest high of 20 bars

down_num = 20 //the trailing 20$

if( low < trail_high - down_num)
    alert_code 

PS这将在蜡烛关闭后触发

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62488922

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档