Advertisement
Nick42_for_win

FREE ALGOs [AI Signals Gold]

Feb 13th, 2022
4,274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.14 KB | None | 0 0
  1. // 8888888888 8888888b. 8888888888 8888888888 d8888 888 .d8888b. .d88888b. As you
  2. // 888 888 Y88b 888 888 d88888 888 d88P Y88b d88P" "Y88b Can see
  3. // 888 888 888 888 888 d88P888 888 888 888 888 888 Are all
  4. // 8888888 888 d88P 8888888 8888888 d88P 888 888 888 888 888 .d8888b Basic free
  5. // 888 8888888P" 888 888 d88P 888 888 888 88888 888 888 88K tradingview
  6. // 888 888 T88b 888 888 d88P 888 888 888 888 888 888 "Y8888b. indicators
  7. // 888 888 T88b 888 888 d8888888888 888 Y88b d88P Y88b. .d88P X88 repackaged
  8. // 888 888 T88b 8888888888 8888888888 d88P 888 88888888 "Y8888P88 "Y88888P" 88888P' into one
  9. //
  10. // FAQ
  11. //
  12. // Why?
  13. // I want you to see what you are willing to pay hundereds of dollars a month
  14.  
  15. // Has the code been leaked/hacked?
  16. // No, this code has been created only using common sense and public information from the internet
  17.  
  18. // What's the accuracy I can expect from this version of the indicator?
  19. // I'd say it's about 90% the same as the one you would pay
  20.  
  21. // The indicator needs to be updated?
  22. // Write me a private message on TradingView (Nick42_for_win)
  23.  
  24. // Can I suggest an indicator to get a FREE ALGOs version?
  25. // Write me a private message on TradingView (Nick42_for_win)
  26.  
  27. // Do you get any monetary return from this project?
  28. // Nope, 0$
  29.  
  30. // Enjoy ;)
  31.  
  32. //@version=5
  33. indicator("FREE ALGOs [AI Signals Gold]", overlay=true, precision=0, explicit_plot_zorder=true, max_labels_count=500)
  34.  
  35. //------------------ AI Signals | https://www.getaisignals.com ---------------//
  36. // Get user input
  37. sensitivity = input.float(4, "  Sensitivity (0.5 - 4)", 0.5, 4, step=0.1)
  38. emaCloud = input.bool(false, "EMA Cloud")
  39. suppRes = input.bool(false, "Support & Resistance")
  40. breaks = input.bool(false, "Breaks")
  41. usePsar = input.bool(false, "PSAR")
  42. emaEnergy = input.bool(true, "EMA Energy")
  43. // Functions
  44. supertrend(_src, factor, atrLen) =>
  45. atr = ta.atr(atrLen)
  46. upperBand = _src + factor * atr
  47. lowerBand = _src - factor * atr
  48. prevLowerBand = nz(lowerBand[1])
  49. prevUpperBand = nz(upperBand[1])
  50. lowerBand := lowerBand > prevLowerBand or close[1] < prevLowerBand ? lowerBand : prevLowerBand
  51. upperBand := upperBand < prevUpperBand or close[1] > prevUpperBand ? upperBand : prevUpperBand
  52. int direction = na
  53. float superTrend = na
  54. prevSuperTrend = superTrend[1]
  55. if na(atr[1])
  56. direction := 1
  57. else if prevSuperTrend == prevUpperBand
  58. direction := close > upperBand ? -1 : 1
  59. else
  60. direction := close < lowerBand ? 1 : -1
  61. superTrend := direction == -1 ? lowerBand : upperBand
  62. [superTrend, direction]
  63. // Get Components
  64. ocAvg = math.avg(open, close)
  65. ema1 = ta.ema(high, 9)
  66. ema2 = ta.ema(high, 12)
  67. ema3 = ta.ema(high, 15)
  68. ema4 = ta.ema(high, 18)
  69. sma1 = ta.sma(close, 5)
  70. sma2 = ta.sma(close, 6)
  71. sma3 = ta.sma(close, 7)
  72. sma4 = ta.sma(close, 8)
  73. sma5 = ta.sma(close, 9)
  74. sma6 = ta.sma(close, 10)
  75. sma7 = ta.sma(close, 11)
  76. sma8 = ta.sma(close, 12)
  77. sma9 = ta.sma(close, 13)
  78. sma10 = ta.sma(close, 14)
  79. sma11 = ta.sma(close, 15)
  80. sma12 = ta.sma(close, 16)
  81. sma13 = ta.sma(close, 17)
  82. sma14 = ta.sma(close, 18)
  83. sma15 = ta.sma(close, 19)
  84. sma16 = ta.sma(close, 20)
  85. psar = ta.sar(0.02, 0.02, 0.2)
  86. [supertrend, direction] = supertrend(close, sensitivity, 11)
  87. barsL = 10
  88. barsR = 10
  89. pivotHigh = fixnan(ta.pivothigh(barsL, barsR)[1])
  90. pivotLow = fixnan(ta.pivotlow(barsL, barsR)[1])
  91. // Colors
  92. green = #2BBC4D, green2 = #00DD00
  93. red = #C51D0B, red2 = #DD0000
  94. emaCloudColor = emaCloud ? (close > supertrend ? #71CD6D : #D75131) : na
  95. emaEnergyColor(ma) => emaEnergy ? (close >= ma ? green : red) : na
  96. // Plots
  97. p1 = plot(ema1, "", na, editable=false)
  98. p2 = plot(ema2, "", emaCloudColor, editable=false)
  99. p3 = plot(ema3, "", emaCloudColor, editable=false)
  100. p4 = plot(ema4, "", na, editable=false)
  101. fill(p1, p2, emaCloud ? (ema2 > ema3 ? color.new(#D75131, 80) : color.new(#71CD6D, 80)) : na)
  102. fill(p4, p3, emaCloud ? (ema2 < ema3 ? color.new(#D75131, 80) : color.new(#71CD6D, 80)) : na)
  103. fill(p2, p3, emaCloud ? color.new(emaCloudColor, 35) : na)
  104. plot(sma1, "", emaEnergyColor(sma1), editable=false)
  105. plot(sma2, "", emaEnergyColor(sma2), editable=false)
  106. plot(sma3, "", emaEnergyColor(sma3), editable=false)
  107. plot(sma4, "", emaEnergyColor(sma4), editable=false)
  108. plot(sma5, "", emaEnergyColor(sma5), editable=false)
  109. plot(sma6, "", emaEnergyColor(sma6), editable=false)
  110. plot(sma7, "", emaEnergyColor(sma7), editable=false)
  111. plot(sma8, "", emaEnergyColor(sma8), editable=false)
  112. plot(sma9, "", emaEnergyColor(sma9), editable=false)
  113. plot(sma10, "", emaEnergyColor(sma10), editable=false)
  114. plot(sma11, "", emaEnergyColor(sma11), editable=false)
  115. plot(sma12, "", emaEnergyColor(sma12), editable=false)
  116. plot(sma13, "", emaEnergyColor(sma13), editable=false)
  117. plot(sma14, "", emaEnergyColor(sma14), editable=false)
  118. plot(sma15, "", emaEnergyColor(sma15), editable=false)
  119. plot(sma16, "", emaEnergyColor(sma16), editable=false)
  120. barcolor(close > supertrend ? #2BE300 : red2)
  121. p5 = plot(ocAvg, "", na, editable=false)
  122. p6 = plot(psar, "PSAR", usePsar ? (psar < ocAvg ? green : red) : na, 1, plot.style_circles, editable=false)
  123. fill(p5, p6, usePsar ? (psar < ocAvg ? color.new(green, 90) : color.new(red, 90)) : na, editable=false)
  124. y1 = low - (ta.atr(30) * 2)
  125. y2 = high + (ta.atr(30) * 2)
  126. bull = ta.crossover(close, supertrend) and close >= sma9
  127. bear = ta.crossunder(close, supertrend) and close <= sma9
  128. buy = bull ? label.new(bar_index, y1, "BUY", xloc.bar_index, yloc.price, #2BE300, label.style_label_up, color.white, size.normal) : na
  129. sell = bear ? label.new(bar_index, y2, "SELL", xloc.bar_index, yloc.price, red2, label.style_label_down, color.white, size.normal) : na
  130. plot(pivotHigh, "Resistance", not suppRes or ta.change(pivotHigh) ? na : red, 2, offset=-(barsR + 1), editable=false)
  131. plot(pivotLow, "Support", not suppRes or ta.change(pivotLow) ? na : green, 2, offset=-(barsR + 1), editable=false)
  132. plotshape(breaks and ta.crossover(close, pivotHigh), "Break", shape.labelup, location.belowbar, green, 0, "B", color.white, false, size.small)
  133. plotshape(breaks and ta.crossunder(close, pivotLow), "Break", shape.labeldown, location.abovebar, red, 0, "B", color.white, false, size.small)
  134. // Alerts
  135. alertcondition(bull or bear or ta.crossover(close, pivotHigh) or ta.crossunder(close, pivotLow), "Alert Any", "AI Signals Gold\nAlert Triggered on {{ticker}} @ {{close}}")
  136. alertcondition(bull, "Alert Buy", "AI Signals Gold\nBuy {{ticker}} @ {{close}}")
  137. alertcondition(bear, "Alert Sell", "AI Signals Gold\nSell {{ticker}} @ {{close}}")
  138. alertcondition(ta.crossover(close, pivotHigh), "Broke Resistance", "AI Signals Gold\nBroke Resistance on {{ticker}} @ {{close}}")
  139. alertcondition(ta.crossunder(close, pivotLow), "Broke Support", "AI Signals Gold\nBroke Support on {{ticker}} @ {{close}}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement