• API
• FAQ
• Tools
• Archive
SHARE
TWEET Untitled a guest May 25th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. //@version=3
2. study(title="Ichimoku Cloud", shorttitle="Ichimoku+BB+50EMA+200MA+Fractals", overlay=true)
3. showFractal = input(false, "Fractals Off")
4.
5. conversionPeriods = input(9, minval=1, title="Conversion Line Periods"),
6. basePeriods = input(26, minval=1, title="Base Line Periods")
7. laggingSpan2Periods = input(52, minval=1, title="Lagging Span 2 Periods"),
8. displacement = input(26, minval=1, title="Displacement")
9.
10. donchian(len) => avg(lowest(len), highest(len))
11.
12. conversionLine = donchian(conversionPeriods)
13. baseLine = donchian(basePeriods)
14. leadLine1 = avg(conversionLine, baseLine)
15. leadLine2 = donchian(laggingSpan2Periods)
16.
17. plot(conversionLine, color=#0496ff, title="Conversion Line")
18. plot(baseLine, color=#991515, title="Base Line")
19. plot(close, offset = -displacement, color=#459915, title="Lagging Span")
20.
21. p1 = plot(leadLine1, offset = displacement, color=green,
23. p2 = plot(leadLine2, offset = displacement, color=red,
25. fill(p1, p2, color = leadLine1 > leadLine2 ? green : red)
26.
27. //Bill cosby//
28. n = input(title="Fractal Periods", defval=2, minval=2, type=integer)
29.
30. //down fractal
31. dnFractal = (high[n-2] < high[n]) and (high[n-1] < high[n]) and (high[n+1] < high[n]) and (high[n+2] < high[n])
32.
33. //up fractal
34. upFractal = (low[n-2] > low[n]) and (low[n-1] > low[n]) and (low[n+1] > low[n]) and (low[n+2] > low[n])
35.
36. //shapes
37. plotshape(showFractal ? na : dnFractal, style=shape.triangledown, location=location.abovebar, offset=-2, color=#008000, transp=0) // Down Triangle above candles
38. plotshape(showFractal ? na : upFractal, style=shape.triangleup, location=location.belowbar, offset=-2, color=#000000, transp=0)  // Up Triangle below candles
39.
40. len = input(200, minval=1, title="Length")
41. src = input(close, title="Source")
42. out = sma(src, len)
43. plot(out, color=blue, title="200MA")
44.
45.
46. short = ema(close, 50)
47. plot(short, color = orange, title="50EMA")
48.
49. source = close
50. length = input(20, minval=1), mult = input(2.0, minval=0.001, maxval=50)
51. basis = sma(source, length)
52. dev = mult * stdev(source, length)
53. upper = basis + dev
54. lower = basis - dev
55. plot(basis, color=red)
56. a1 = plot(upper, color=blue)
57. a2 = plot(lower, color=blue)
58. fill(a1, a2)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top