Advertisement
Guest User

hugo original+

a guest
Nov 15th, 2019
511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. //@version=3
  2. study(title="HUGO-Original", shorttitle="scalp_test", overlay=true)
  3.  
  4. MA = sma(close, 102)
  5. plot(MA, color =#DF01A5, title="102", linewidth=3, transp=0)
  6.  
  7. //..................................................................Hugo Scalp
  8. len5 = input(title="1st Length", type=integer, defval=20, minval=1)
  9. src5 = input(title="1st Source", type=source, defval=close)
  10.  
  11. len6 = input(title="2nd Length", type=integer, defval=50, minval=1)
  12. src6 = input(title="2nd Source", type=source, defval=close)
  13.  
  14. len7 = input(title="3rd Length", type=integer, defval=80, minval=1)
  15. src7 = input(title="3rd Source", type=source, defval=close)
  16.  
  17. hma1 = wma(2 * wma(src5, len5 / 2) - wma(src5, len5), round(sqrt(len5)))
  18. hma2 = wma(2 * wma(src6, len6 / 2) - wma(src6, len6), round(sqrt(len6)))
  19. hma3 = wma(2 * wma(src7, len7 / 2) - wma(src7, len7), round(sqrt(len7)))
  20.  
  21. plot(hma1, title="1", linewidth=2, color= #01fff7, transp=0)
  22. plot(hma2, title="2", linewidth=3, color= blue, transp=0)
  23. plot(hma3, title="3", linewidth=3, color= red, transp=0)
  24.  
  25.  
  26. //plot(cross(hma1, hma2) ? hma2 : na, color = (hma1 - hma2 > 0 ? lime : red) , style = circles, linewidth = 5, transp=0)
  27. plot(cross(hma2, hma3) ? hma3 : na, color = (hma2 - hma3 > 0 ? lime : red) , style = cross, linewidth = 5, transp=0)
  28. //plot(cross(hma1, hma3) ? hma3 : na, color = (hma1 - hma3 > 0 ? lime : red) , style = circles, linewidth = 5, transp=0)
  29.  
  30.  
  31.  
  32. //------------------------------------------------------ Pablo Picasso
  33.  
  34.  
  35. emaBase = input(60, minval=1, title="EmaB")
  36. emaConversion = input(120, minval=1, title="EmaC")
  37.  
  38. leadLine1 = ema(close, emaBase)
  39. leadLine2 = ema(close, emaConversion)
  40.  
  41.  
  42. p1 = plot(leadLine1, color=green, transp=0,
  43. title="Lead 1")
  44. p2 = plot(leadLine2, color=red, transp=0,
  45. title="Lead 2")
  46. fill(p1, p2, color = leadLine1 > leadLine2 ? green : red)
  47.  
  48. plot(cross(leadLine1, leadLine2) ? leadLine2 : na, color = (leadLine1 - leadLine2 > 0 ? lime : red) , transp=0)
  49.  
  50. //.....................................................................
  51.  
  52. length=input(21)
  53. src=close
  54. ema1=ema(src, length)
  55. ema2=ema(ema1, length)
  56. d=ema1-ema2
  57. zlema=ema1+d
  58. plot(zlema, title="4", linewidth=1, color= white, transp=0)
  59.  
  60.  
  61. plot(cross(zlema, hma2) ? hma2 : na, color = (zlema - hma2 > 0 ? lime : red) , style = circles, linewidth = 5, transp=0)
  62. plot(cross(zlema, hma3) ? hma3 : na, color = (zlema - hma3 > 0 ? lime : red) , style = circles, linewidth = 5, transp=0)
  63.  
  64. //............................................................. Strategie Sell - Buy
  65.  
  66. //longCond=crossover(hma2,hma3)
  67. //shortCond=crossover(hma3,hma2)
  68. //strategy.entry("LONG", strategy.long, when=longCond)
  69. //strategy.entry("SHORT", strategy.short, when=shortCond)
  70. //strategy.exit("EXLONG", from_entry="LONG", when=shortCond)
  71. //strategy.exit("EXSHORT", from_entry="SHORT", when=longCond)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement