Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=3
- //@author Jaqobs
- //Moving averages based on VWMA and Bitmex's leverage liquidation multipliers
- //Modified for trx/xrp/ada/bch/eos
- study("Bitmex Shit Alts LLVWMA", overlay=true)
- //Recommended settings:
- //M3: len = 300
- //M5: len = 150 / bitfinex = 200
- //M15: len = 50-75
- //m30: len = 35
- //h1: len = 13-25
- //h4: len = 7
- //h12: len = 3
- // ===Inputs===
- len_inp = input(defval=50, title="Length", type=integer)
- offset_inp = input(defval=0, title="Offset", type= integer)
- highlightTouch20=input(true, title="Highlight touch of x20 leverage lines?", type=bool)
- highlightTouch10=input(true, title="Highlight touch of x10 leverage lines?", type=bool)
- highlightTouch5=input(true, title="Highlight touch of x5 leverage lines?", type=bool)
- // ===MA's===
- vwma = vwma(close, len_inp)
- long5 = vwma(close, len_inp) * 0.825
- plot(long5, color=#ff0000, offset=offset_inp, title="x5 Long Liquidation")
- long10 = vwma(close, len_inp) * 0.925
- plot(long10, color=#ff0000, offset=offset_inp, title="x10 Long Liquidation")
- long20 = vwma(close, len_inp) * 0.975
- plot(long20, color=#ff0000, offset=offset_inp, title="x20 Long Liquidation")
- short20 = vwma(close, len_inp) * 1.025
- plot(short20, color=#30c149, offset=offset_inp, title="x20 Short Liquidation")
- short10 = vwma(close, len_inp) * 1.1075
- plot(short10, color=#30c149, offset=offset_inp, title="x10 Short Liquidation")
- short5 = vwma(close, len_inp) * 1.1175
- plot(short5, color=#30c149, offset=offset_inp, title="x5 Short Liquidation")
- // ===Hghlight Line touches===
- bcolor1 = (crossover(high, short20)) ? color(#d69c38, 80) : (crossunder(low, long20)) ? color(#beed53, 80) : na
- bcolor2 = (crossover(high, short10)) ? color(#d66c38, 70) : (crossunder(low, long10)) ? color(#39d65b, 70) : na
- bcolor3 = (crossover(high, short5)) ? color(#d64538, 50) : (crossunder(low, long5)) ? color(#34c152, 50) : na
- bgcolor(highlightTouch20 ? bcolor1 : na)
- bgcolor(highlightTouch10 ? bcolor2 : na)
- bgcolor(highlightTouch5 ? bcolor3 : na)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement