RicardoSantos

[RS]RSI Momentum Bands V0

EXPERIMENTAL: RSI Momentum Weighted Bands(cloud)
開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?
//  ||--------------------------------------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------||
study(title="[RS]RSI Momentum Bands V0", shorttitle="[RS]RSI.MB.V0", overlay=true)
//  ||--------------------------------------------------------------------------------------||
//  ||---   Inputs:     --------------------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------||
src = input(close)
length = input(14)
smooth = input(10)
//  ||--------------------------------------------------------------------------------------||
//  ||---   RSI Momentum Bands Function:    ------------------------------------------------||
//  ||--------------------------------------------------------------------------------------||
rsi_mom_bands(_src, _length, _smooth)=>
    _rsi = rsi(_src, _length)
    _dif = sma(change(_src, _length), _smooth)
    _selline = ema(_src[_length] + (_dif*(_rsi*0.01)), _smooth)
    _buyline = _selline + (_dif*(_rsi*0.01))
    [_selline, _buyline]
//  ||--------------------------------------------------------------------------------------||
//  ||---   RSI Momentum Bands Cast:  ------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------||
[sline, bline] = rsi_mom_bands(src, length, smooth)
//  ||--------------------------------------------------------------------------------------||
//  ||---   Output:     --------------------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------||
tb = plot(sline, color=maroon)
bb = plot(bline, color=green)
fill(tb, bb, color=blue, transp=85)
//  ||--------------------------------------------------------------------------------------||
//  ||---   Bar Color:     -----------------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------||
showBarColor = input(true)
Direction = bline > sline
isSqueeze = abs(sline-bline) < abs(sline[1]-bline[1])
BC_condition = Direction and not isSqueeze and src > sline ? lime :
        Direction and src > sline ? green :
        not Direction and not isSqueeze and src < bline ? red :
        not Direction and src < bline ? maroon : gray
barcolor(not showBarColor ? na : BC_condition)
//  ||--------------------------------------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------||