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)
//  ||--------------------------------------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------||
//  ||--------------------------------------------------------------------------------------||