Advertisement
Guest User

Untitled

a guest
Oct 20th, 2018
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. //@version=3
  2. //@author Jaqobs
  3. //Moving averages based on VWMA and Bitmex's leverage liquidation multipliers
  4. //Modified for trx/xrp/ada/bch/eos
  5.  
  6. study("Bitmex Shit Alts LLVWMA", overlay=true)
  7.  
  8. //Recommended settings:
  9. //M3: len = 300
  10. //M5: len = 150 / bitfinex = 200
  11. //M15: len = 50-75
  12. //m30: len = 35
  13. //h1: len = 13-25
  14. //h4: len = 7
  15. //h12: len = 3
  16.  
  17. // ===Inputs===
  18. len_inp = input(defval=50, title="Length", type=integer)
  19. offset_inp = input(defval=0, title="Offset", type= integer)
  20. highlightTouch20=input(true, title="Highlight touch of x20 leverage lines?", type=bool)
  21. highlightTouch10=input(true, title="Highlight touch of x10 leverage lines?", type=bool)
  22. highlightTouch5=input(true, title="Highlight touch of x5 leverage lines?", type=bool)
  23.  
  24. // ===MA's===
  25.  
  26. vwma = vwma(close, len_inp)
  27. long5 = vwma(close, len_inp) * 0.825
  28. plot(long5, color=#ff0000, offset=offset_inp, title="x5 Long Liquidation")
  29.  
  30. long10 = vwma(close, len_inp) * 0.925
  31. plot(long10, color=#ff0000, offset=offset_inp, title="x10 Long Liquidation")
  32.  
  33. long20 = vwma(close, len_inp) * 0.975
  34. plot(long20, color=#ff0000, offset=offset_inp, title="x20 Long Liquidation")
  35.  
  36. short20 = vwma(close, len_inp) * 1.025
  37. plot(short20, color=#30c149, offset=offset_inp, title="x20 Short Liquidation")
  38.  
  39. short10 = vwma(close, len_inp) * 1.1075
  40. plot(short10, color=#30c149, offset=offset_inp, title="x10 Short Liquidation")
  41.  
  42. short5 = vwma(close, len_inp) * 1.1175
  43. plot(short5, color=#30c149, offset=offset_inp, title="x5 Short Liquidation")
  44.  
  45. // ===Hghlight Line touches===
  46. bcolor1 = (crossover(high, short20)) ? color(#d69c38, 80) : (crossunder(low, long20)) ? color(#beed53, 80) : na
  47. bcolor2 = (crossover(high, short10)) ? color(#d66c38, 70) : (crossunder(low, long10)) ? color(#39d65b, 70) : na
  48. bcolor3 = (crossover(high, short5)) ? color(#d64538, 50) : (crossunder(low, long5)) ? color(#34c152, 50) : na
  49. bgcolor(highlightTouch20 ? bcolor1 : na)
  50. bgcolor(highlightTouch10 ? bcolor2 : na)
  51. bgcolor(highlightTouch5 ? bcolor3 : na)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement