Entry master RSI pullback

adampeterthompson · study · 30 行 · 点赞 2,015 · TradingView 原页

本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。

Pine Script

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © adampeterthompson
 
//@version=4
study(title = "Entry master RSI pullback", shorttitle = "Entry master RSI pullback", overlay = true)
 
rsi = rsi(high, 14)
 
rsiSource = input(title="RSI Source", type=input.source, defval=high)
rsiLength = input(title="RSI Length", type=input.integer, defval=14)
rsiValue = rsi(rsiSource, rsiLength)
plot(na)
 
long = crossover (rsi, 50) and barssince(crossunder (rsi, 80))<=30
short= crossunder (rsi, 50) and barssince(crossover (rsi, 20))<=30
 
 
// Position Management Tools
pos = 0.0
pos:= long? 1 : short? -1 : pos[1]
 
longCond  = long  // and pos[1]!= 1
shortCond = short // and pos[1]!=-1
 
 
// Chart Plot & Alerts
plotshape(longCond==true, color=#00FF00, style=shape.triangleup, text="Buy" , location=location.belowbar, transp=0, offset=0, size=size.small)
plotshape(shortCond==true, color=#FF0000, style=shape.triangledown, text="Sell", location=location.abovebar, transp=0, offset=0, size=size.small)
alertcondition(longCond==true, title="BUY Alert" )
alertcondition(shortCond==true, title="SELL Alert")

← 返回列表