Novelty_ua

Help for reddit

Nov 5th, 2025
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.23 KB | Fixit | 0 0
  1. //@version=5
  2. indicator("ZEEDAN", overlay=true, shorttitle="ZEEDAN ")
  3.  
  4. // --- Note on Point & Figure ---
  5. // The `pointfigure()` function and its related logic from the "London_Underground_V0" script are not available in Pine Script v5 and have been commented out below.
  6.  
  7. //=============Hull MA-----------------------------
  8. show_hma = input.bool(true, title=" Display Centre Band")
  9. hma_src = input.source(close, title=" Centre Band Source:")
  10. hma_base_length = input.int(1, minval=1, title=" Centre Band Base Length:")
  11. hma_length_scalar = input.int(6, minval=0, title=" Centre Band length Scalar:")
  12.  
  13. hullma(src, length) =>
  14. wma1 = ta.wma(src, length / 2)
  15. wma2 = ta.wma(src, length)
  16. ta.wma(2 * wma1 - wma2, math.round(math.sqrt(length)))
  17.  
  18. plot(not show_hma ? na : hullma(hma_src, hma_base_length + hma_length_scalar * 6), color=color.black, linewidth=4, title="Centre Band")
  19.  
  20. //====================channel 1 (ZEEDAN)==========================
  21. len = input.int(34, minval=1, title=" Length 1")
  22. src = input.source(close, title=" Source 1")
  23. out = ta.ema(src, len)
  24. plot(out, title="EMA 1", color=color.blue, style=plot.style_circles, linewidth=1)
  25.  
  26. last8h = ta.highest(close, 13)
  27. lastl8 = ta.lowest(close, 13)
  28.  
  29. plot(last8h, color=color.red, linewidth=2, title=" Upper channel 1")
  30. plot(lastl8, color=color.green, linewidth=2, title=" Lower channel 1")
  31.  
  32. // Signals (calculated but not plotted)
  33. // Note: close > close is always false, likely intended for identifying bars where a cross happens and the *prior* close was higher/lower.
  34. bearish = ta.crossunder(close, out) // Simplified to just the cross logic
  35. bullish = ta.crossover(close, out)
  36.  
  37. //======================channel 2 (ZEEDAN)==================================
  38. len2 = input.int(34, minval=1, title=" Length 2")
  39. src2 = input.source(close, title=" Source 2")
  40. out2 = ta.ema(src, len) // Uses 'src' and 'len' from Channel 1 inputs, which matches original v4 code
  41. plot(out2, title="EMA 2", color=color.maroon, style=plot.style_circles, linewidth=1)
  42.  
  43. last8h2 = ta.highest(close, 34)
  44. lastl82 = ta.lowest(close, 34)
  45.  
  46. plot(last8h2, color=color.black, style=plot.style_line, linewidth=1, title=" Upper channel 2")
  47. plot(lastl82, color=color.black, style=plot.style_line, linewidth=1, title=" Lower channel 2")
  48.  
  49. bearish2 = ta.crossunder(close, out)
  50. bullish2 = ta.crossover(close, out)
  51.  
  52. //======================Pivot Channel (ZEEDAN)==================================
  53. length1 = input.int(13, minval=1, title=" Pivot Channel upper length")
  54. length2 = input.int(13, minval=1, title=" Pivot Channel lower length")
  55.  
  56. // Fix: highest/lowest needs a source series and a length integer.
  57. upper = ta.highest(high, length1)
  58. lower = ta.lowest(low, length2)
  59.  
  60. basis = math.avg(upper, lower)
  61.  
  62. l = plot(lower, style=plot.style_circles, linewidth=2, color=color.green, title="Pivott Channel lower")
  63. u = plot(upper, style=plot.style_circles, linewidth=2, color=color.red, title="Pivott Channel upper")
  64.  
  65. fill(u, l, color=color.new(color.black, 100), title="Fill Channel")
  66.  
  67. //========={RS} spike hunter (ZEEDAN)================================================================================//
  68. // Note: 'n' variable was redefined as 'bar_index' for V5 compliance.
  69. n = bar_index < 4000 ? bar_index : 4000
  70. tr = ta.tr(true)
  71. _atr = math.sum(tr, n + 1) / (n + 1)
  72.  
  73. top = (high - math.max(close, open)) > tr * 0.5 and tr > _atr
  74. bot = (math.min(close, open) - low) > tr * 0.5 and tr > _atr
  75.  
  76. plotchar(top, color=color.blue, text="", title="Top Spike")
  77. plotchar(bot, location=location.belowbar, color=color.blue, text="", title="Bottom Spike")
  78.  
  79. //------Moddified [RS]Fractals V2 (ZEEDAN)
  80. length_f = input.int(22, title=" Fractal Length")
  81. filterFractals = input.bool(true, title=" Signal filter")
  82.  
  83. // Original V4 logic translated to V5 syntax.
  84. ftop = high[2] > high[3] and high[2] > high[4] and high[2] > high[1] and high[2] > high[0]
  85. fbot = low[2] < low[3] and low[2] < low[4] and low[2] < low[1] and low[1] < low[0]
  86.  
  87. topf = ftop and high[2] >= ta.highest(high, length_f)
  88. botf = fbot and low[2] <= ta.lowest(low, length_f)
  89.  
  90. filteredtopf = filterFractals ? topf : ftop
  91. filteredbotf = filterFractals ? botf : fbot
  92.  
  93. plotshape(filteredtopf, style=shape.triangledown, location=location.abovebar, color=color.gray, text="..........", offset=-2, title="Filtered Top Fractal")
  94. plotshape(filteredbotf, style=shape.triangleup, location=location.belowbar, color=color.gray, text="..........", offset=-2, title="Filtered Bottom Fractal")
  95.  
  96. //================================================================================//
  97. // START OF London_Underground_V0 SCRIPT LOGIC
  98. //================================================================================//
  99. len_lu = input.int(21, minval=1, title="[LU] Length")
  100. src_lu = input.source(close, title="[LU] Source")
  101. out_lu = ta.ema(src_lu, len_lu)
  102. plot(out_lu, title="[LU] EMA", color=color.blue)
  103. last8h_lu = ta.highest(close, 13)
  104. lastl8_lu = ta.lowest(close, 13)
  105.  
  106. plot(last8h_lu, color=color.black, style=plot.style_line, linewidth=3, title="[LU] Upper channel")
  107. plot(lastl8_lu, color=color.black, style=plot.style_line, linewidth=3, title="[LU] Lower channel")
  108.  
  109. bearish_lu = ta.crossunder(close, out_lu)
  110. bullish_lu = ta.crossover(close, out_lu)
  111.  
  112. //======{RS} Point and Figure (Removed due to v5 incompatibility) =======================================================//
  113. // These inputs remain in the script, but the logic using them is commented out as the 'pointfigure' function is gone in V5.
  114. tf = input.timeframe('240', title="[LU] P&F Timeframe")
  115. M = input.string('ATR', title="[LU] P&F Method")
  116. P = input.float(14.00, title="[LU] P&F P")
  117. W = input.int(1, title="[LU] P&F W")
  118. // pf = pointfigure(syminfo.tickerid, 'close', M, P, W) // Function not available in v5
  119. // spfc = request.security(pf, tf, close)
  120. // p2 = plot(spfc, color=color.red, linewidth=4, title="[LU] Central Line (P&F - Disabled)")
  121.  
  122. //============================Ichomku (London Underground)---------------------------------------------//
  123. show_cloud_lu = input.bool(true, title="[LU] Display Ichimoku Cloud:")
  124. // Renamed input variables to avoid conflicts with function arguments
  125. conversionPeriods_lu = input.int(34, minval=1, title="[LU] Conversion Periods")
  126. basePeriods_lu = input.int(26, minval=1, title="[LU] Base Periods")
  127. laggingSpan2Periods_lu = input.int(52, minval=1, title="[LU] Lagging Span 2 Periods")
  128. displacement_lu = input.int(26, minval=1, title="[LU] Displacement")
  129.  
  130. donchian_lu(len) => math.avg(ta.lowest(len), ta.highest(len))
  131.  
  132. conversionLine = donchian_lu(conversionPeriods_lu)
  133. baseLine = donchian_lu(basePeriods_lu)
  134. leadLine1 = math.avg(conversionLine, baseLine)
  135. leadLine2 = donchian_lu(laggingSpan2Periods_lu)
  136.  
  137. plot(not show_cloud_lu ? na : conversionLine, color=color.green, linewidth=3, style=plot.style_line, title="[LU] Mid line resistance levels")
  138. plot(baseLine, color=color.maroon, linewidth=4, title="[LU] Base Line")
  139.  
  140. p1_lu = plot(not show_cloud_lu ? na : leadLine1, offset = displacement_lu, color=color.white, linewidth=1, title="[LU] Lead 1")
  141. p3_lu = plot(not show_cloud_lu ? na : leadLine2, offset = displacement_lu, color=color.blue, linewidth=4, title="[LU] Lead 2")
  142.  
  143. fill(p1_lu, p3_lu, color=color.new(color.blue, 100))
  144. //----------------------------------------------------------------------------////
Advertisement
Add Comment
Please, Sign In to add comment