RicardoSantos

[RS]Volatility Explosive Measure V0

EXPERIMENTAL:
Measures the volatility range of current price range, can help detect squeezes as well explosive moves
สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
//@version=2
study(title='[RS]Volatility Explosive Measure V0')
f_bullish_sequence()=>
    _output = 0
    _range = close - open
    _doji = _range == 0
    _up_bar = _range > 0 or _doji and _range[1] > 0
    _counter = barssince(not _up_bar)
    if (_up_bar)
        for _i = 0 to max(0, _counter - 1)
            _output := _output + _range[_i]
    _output

f_bearish_sequence()=>
    _output = 0
    _range = close - open
    _doji = _range == 0
    _up_bar = _range < 0 or _doji and _range[1] < 0
    _counter = barssince(not _up_bar)
    if (_up_bar)
        for _i = 0 to max(0, _counter - 1)
            _output := _output + _range[_i]
    _output

bull_seq = f_bullish_sequence()
bear_seq = f_bearish_sequence()

length = input(10)
bull_ma = ema(bull_seq, length)
bear_ma = ema(bear_seq, length)
width = bull_ma - bear_ma

plot(width, color=color(black, 0), style=area)
// plot(bull_seq, color=color(lime, 0), style=columns)
// plot(bear_seq, color=color(red, 0), style=columns)
// plot(bull_ma, color=color(purple, 25), style=area)
// plot(bear_ma, color=color(purple, 25), style=area)