xmd79

Matrix Series and Vix Fix with VWAP CCI and QQE Signals

Dec 9th, 2023
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.95 KB | None | 0 0
  1. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
  2. // © OskarGallard
  3.  
  4. //@version=5
  5. indicator('Matrix Series and Vix Fix with VWAP CCI and QQE Signals', shorttitle='Matrix', precision=2)
  6.  
  7. // Function to select the type of source
  8. get_src(Type) =>
  9. switch Type
  10. "VWAP" => ta.vwap
  11. "Close" => close
  12. "Open" => open
  13. "HL2" => hl2
  14. "HLC3" => hlc3
  15. "OHLC4" => ohlc4
  16. "HLCC4" => hlcc4
  17. "High" => high
  18. "Low" => low
  19. "TR" => ta.tr
  20. "vwap(Close)" => ta.vwap(close)
  21. "vwap(Open)" => ta.vwap(open)
  22. "vwap(High)" => ta.vwap(high)
  23. "vwap(Low)" => ta.vwap(low)
  24. "AVG(vwap(H,L))" => math.avg(ta.vwap(high), ta.vwap(low))
  25. "AVG(vwap(O,C))" => math.avg(ta.vwap(open), ta.vwap(close))
  26. //__________________________________________________________________
  27. // Based on "Matrix Series" - Author: @glaz
  28. // https://www.tradingview.com/script/2X2cVLhb-Matrix-Series/
  29. // https://www.wisestocktrader.com/indicators/2739-flower-indicator
  30. //__________________________________________________________________
  31. alert_Buy_Matrix = input.bool(false, "◁ Alert: [Buy - Matrix]", inline="alertMatrix")
  32. alert_Sell_Matrix = input.bool(false, "◁ Alert: [Sell - Matrix]", inline="alertMatrix")
  33. show_buy_signal = input.bool(true, "Show buy signal", inline="show_signal")
  34. show_sell_signal = input.bool(true, "Show sell signal", inline="show_signal")
  35. show_dot = input.bool(true, "Show Watch/Warning Point", inline="show_signal")
  36. //--- Trend Bought/Sold Detail
  37. dynamic = input.bool(true, "Show Dynamic Zones ᚛ᚔ᚜ ", inline="show_limit")
  38. OBOS = input.bool(false, "Show OB/OS", inline="show_limit")
  39. show_candles = input.bool(true, "Show Matrix Candles ᚛ᚔ᚜ ", inline="s_matrix")
  40. show_hist = input.bool(false, "Show Matrix Histogram", inline="s_matrix")
  41. //--- Sup/Res Detail
  42. PricePeriod = input.int(16, "Price Period", 1, inline="period")
  43. Smoother = input.int(5, "Smoother", 2, inline="period")
  44. SupResPeriod = input.int(50, "Superior Resolution Period", 1, inline="Superior Resolution")
  45. SupResPercentage = input.int(100, "Percentage", 1, inline="Superior Resolution")
  46. //--- Line Detail
  47. ob = input.int(200, "OverBought Above", inline="line")
  48. os = input.int(-200, "OverSold Bellow", inline="line")
  49.  
  50. ys1 = (high + low + close * 2) / 4
  51. rk3 = ta.ema(ys1, Smoother)
  52. rk4 = ta.stdev(ys1, Smoother)
  53. rk5 = (ys1 - rk3) * 200 / rk4
  54. rk6 = ta.ema(rk5, Smoother)
  55. up = ta.ema(rk6, Smoother)
  56. down = ta.ema(up, Smoother)
  57. Oo = up < down ? up : down
  58. Hh = Oo
  59. Ll = up < down ? down : up
  60. Cc = Ll
  61. sell_matrix = ta.cross(up, ob) == 1 and up[1] > up
  62. buy_matrix = ta.cross(up, os) == 1 and up[1] < up
  63.  
  64. coral = #FF8080
  65. lavender = #8080FF
  66. amber = color.new(#FFE500, 60)
  67. vcolor = show_candles and (Oo > Cc) ? coral : show_candles and (up > down) ? lavender : show_candles ? coral : na
  68.  
  69. plotcandle(Oo, Hh, Ll, Cc, "Matrix Candles", color = vcolor, wickcolor = vcolor, bordercolor = vcolor)
  70. plotshape(show_sell_signal and sell_matrix, "Sell", shape.triangledown, location.top, coral)
  71. bgcolor(show_sell_signal and sell_matrix ? color.new(coral, 70) : na, title="Sell")
  72. plotshape(show_buy_signal and buy_matrix, "Buy", shape.triangleup, location.bottom, lavender)
  73. bgcolor(show_buy_signal and buy_matrix ? color.new(lavender, 70) : na, title="Buy")
  74.  
  75. //-------S/R Zones------
  76. Lookback = SupResPeriod
  77. PerCent = SupResPercentage
  78.  
  79. Value1 = ta.cci(close, PricePeriod)
  80. Value2 = ta.highest(Value1, Lookback)
  81. Value3 = ta.lowest(Value1, Lookback)
  82. Value4 = Value2 - Value3
  83. Value5 = Value4 * (PerCent / 100)
  84. ResistanceLine = Value3 + Value5
  85. SupportLine = Value2 - Value5
  86. plot(dynamic ? ResistanceLine : na, "Resistance Line", color.new(coral, 5))
  87. plot(dynamic ? ResistanceLine : na, "Resistance Line", color.new(coral, 90), 7)
  88. plot(dynamic ? SupportLine : na, "Support Line", color.new(lavender, 5))
  89. plot(dynamic ? SupportLine : na, "Support Line", color.new(lavender, 90), 7)
  90.  
  91. //--Overbought/Oversold/Warning Detail
  92. h01 = ta.highest(up, 1) + 20
  93. h02 = ta.highest(down, 1) + 20
  94. l01 = ta.lowest(down, 1) - 20
  95. l02 = ta.lowest(up, 1) - 20
  96. UPshape = up > ob and up > down ? h01 : up > ob and up < down ? h02 : na
  97. DOWNshape = down < os and up > down ? l01 : down < os and up < down ? l02 : na
  98.  
  99. plot(show_dot ? UPshape : na, "UP Shape", amber, 4, plot.style_circles)
  100. plot(show_dot ? DOWNshape : na, "DOWN Shape", amber, 4, plot.style_circles)
  101. hline(OBOS ? ob : na, "OverBought")
  102. hline(OBOS ? os : na, "OverSold")
  103.  
  104. AccumulationColor = color.new(#FFA07A, 60) //"Accumulation Zone"
  105. WarningColor = color.new(color.white, 60) //"Warning/Watch Signal"
  106. DistributionColor = color.new(#3CB371, 60) //"Distribution Zone"
  107.  
  108. rk5_210 = ( ys1 - rk3 ) * 210 / rk4
  109. rk6_210 = ta.ema(rk5_210, Smoother)
  110. UP_210 = ta.ema(rk6_210, Smoother)
  111. DOWN_210 = ta.ema(UP_210, Smoother)
  112. UPColor = (UP_210 >= 210 ? DistributionColor : (UP_210 <= -210 ? AccumulationColor : WarningColor))
  113. plot(show_hist ? UP_210 : na, "UP", UPColor, 1, plot.style_columns)
  114. plot(show_hist ? DOWN_210 : na, "Signal(UP)", color.aqua)
  115.  
  116. if alert_Buy_Matrix and buy_matrix
  117. alert('Symbol = (' + syminfo.tickerid + ') \n TimeFrame = (' + timeframe.period + ') \n Current Price (' + str.tostring(close) + ') \n Buy [Matrix Series].-', alert.freq_once_per_bar_close)
  118.  
  119. if alert_Sell_Matrix and sell_matrix
  120. alert('Symbol = (' + syminfo.tickerid + ') \n TimeFrame = (' + timeframe.period + ') \n Current Price (' + str.tostring(close) + ') \n Sell [Matrix Series].-', alert.freq_once_per_bar_close)
  121.  
  122. //_____________________________________________________________________________________________
  123. // Based on "Williams Vix Fix" - Author: @ChrisMoody
  124. // https://www.tradingview.com/script/pJpXG5JH-CM-Williams-Vix-Fix-V3-Ultimate-Filtered-Alerts/
  125. // https://www.ireallytrade.com/newsletters/VIXFix.pdf
  126. //_____________________________________________________________________________________________
  127. shows_Vix_Fix = input(false, 'Show Vix Fix Histogram ᚛ᚔ᚜', inline="histVF", group='Williams Vix Fix')
  128. swvfm = input.float(1.0, "Multiplier (Values 0.5 to 2)", minval = 0.5, maxval = 2, inline="histVF", group='Williams Vix Fix')
  129. sbcFilt = input.bool(true, 'Show Signal For Filtered Entry [▲ FE ]', group='Williams Vix Fix') // Use FILTERED Criteria
  130. sbcAggr = input.bool(true, 'Show Signal For AGGRESSIVE Filtered Entry [▲ AE ]', group='Williams Vix Fix') // Use FILTERED Criteria
  131. alert_AE = input.bool(false, '◁ Alert: [AGGRESSIVE Entry]', inline='AlertVF', group='Williams Vix Fix')
  132. alert_FE = input.bool(false, '◁ Alert: [Filtered Entry]', inline='AlertVF', group='Williams Vix Fix')
  133. pd = input.int(22, 'LookBack Period Standard Deviation High', 1, group='Williams Vix Fix')
  134. bbl = input.int(20, 'Bolinger Band Length', 1, group='Williams Vix Fix')
  135. mult = input.float(2.0, 'Bollinger Band Standard Devaition Up', minval=1, maxval=5, group='Williams Vix Fix')
  136. lb = input.int(50, 'Look Back Period Percentile High', 1, group='Williams Vix Fix')
  137. ph = input.float(.85, 'Highest Percentile - 0.90=90%, 0.95=95%, 0.99=99%', minval=.05, maxval=1, group='Williams Vix Fix')
  138. ltLB = input.int(40, minval=25, maxval=99, title='Long-Term Look Back Current Bar Has To Close Below This Value OR Medium Term--Default=40', group='Williams Vix Fix')
  139. mtLB = input.int(14, minval=10, maxval=20, title='Medium-Term Look Back Current Bar Has To Close Below This Value OR Long Term--Default=14', group='Williams Vix Fix')
  140. str = input.int(3, minval=1, maxval=9, title='Entry Price Action Strength--Close > X Bars Back---Default=3', group='Williams Vix Fix')
  141.  
  142. // Williams Vix Fix Formula
  143. wvf = (ta.highest(close, pd) - low) / ta.highest(close, pd) * 100
  144. sDev = mult * ta.stdev(wvf, bbl)
  145. midLine = ta.sma(wvf, bbl)
  146. lowerBand = midLine - sDev
  147. upperBand = midLine + sDev
  148. rangeHigh = ta.highest(wvf, lb) * ph
  149.  
  150. // Filtered Criteria
  151. upRange = low > low[1] and close > high[1]
  152. upRange_Aggr = close > close[1] and close > open[1]
  153. // Filtered Criteria
  154. filtered = (wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and wvf < upperBand and wvf < rangeHigh
  155. filtered_Aggr = (wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and not(wvf < upperBand and wvf < rangeHigh)
  156.  
  157. // Alerts Criteria
  158. alert1 = wvf >= upperBand or wvf >= rangeHigh ? 1 : 0
  159. alert2 = (wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and wvf < upperBand and wvf < rangeHigh ? 1 : 0
  160. cond_FE = upRange and close > close[str] and (close < close[ltLB] or close < close[mtLB]) and filtered
  161. alert3 = cond_FE ? 1 : 0
  162. cond_AE = upRange_Aggr and close > close[str] and (close < close[ltLB] or close < close[mtLB]) and filtered_Aggr
  163. alert4 = cond_AE ? 1 : 0
  164.  
  165. color_VF = alert1 ? color.new(color.lime, 60) : alert2 ? color.new(color.teal, 60) : color.new(color.silver, 80)
  166. swvfm_precent = swvfm * (ResistanceLine - SupportLine) / (2.2 * rangeHigh)
  167.  
  168. plot(shows_Vix_Fix ? wvf * -1 * swvfm_precent : na, 'Williams Vix Fix', color_VF, 4, plot.style_columns)
  169.  
  170. plotshape(sbcAggr and alert4 ? alert4 : na, 'Aggressive Entry', shape.triangleup, location.bottom, color.new(#80FF00, 0), text='AE', textcolor=color.new(#80FF00, 0))
  171. bgcolor(sbcAggr and alert4 ? color.new(#80FF00, 80) : na, title='Aggressive Entry')
  172. plotshape(sbcFilt and alert3 ? alert3 : na, 'Filtered Entry', shape.triangleup, location.bottom, color.new(#15FF00, 0), text='FE', textcolor=color.new(#15FF00, 0))
  173. bgcolor(sbcFilt and alert3 ? color.new(#15FF00, 80) : na, title='Filtered Entry')
  174.  
  175. if alert_AE and cond_AE
  176. alert('Symbol = (' + syminfo.tickerid + ') \n TimeFrame = (' + timeframe.period + ') \n Current Price (' + str.tostring(close) + ') \n Aggressive Entry [VixFix].-', alert.freq_once_per_bar_close)
  177.  
  178. if alert_FE and cond_FE
  179. alert('Symbol = (' + syminfo.tickerid + ') \n TimeFrame = (' + timeframe.period + ') \n Current Price (' + str.tostring(close) + ') \n Filtered Entry [VixFix].-', alert.freq_once_per_bar_close)
  180.  
  181. //_____________________________________________________________
  182. // Based on "QQE signals" - Author: @colinmck
  183. // https://www.tradingview.com/script/7R6ZxyZu-QQE-signals/
  184. //_____________________________________________________________
  185. shows_QQE = input.bool(false, "═════════ Show QQE Signals ═════════")
  186. alert_Long_QQE = input.bool(false, "◁ Alert: [Long - QQE]", inline="alertQQE")
  187. alert_Short_QQE = input.bool(false, "◁ Alert: [Short - QQE]", inline="alertQQE")
  188. RSI_Period = input.int(14, "RSI Length", 1)
  189. SF = input.int(5, "RSI Smoothing", 2)
  190. QQE = input.float(4.238, "Fast QQE Factor", 1)
  191.  
  192. Wilders_Period = RSI_Period * 2 - 1
  193. longband = 0.0
  194. shortband = 0.0
  195. trend = 0
  196.  
  197. Rsi = ta.rsi(close, RSI_Period)
  198. RSIndex = ta.ema(Rsi, SF)
  199. AtrRsi = math.abs(RSIndex[1] - RSIndex)
  200. MaAtrRsi = ta.ema(AtrRsi, Wilders_Period)
  201.  
  202. DeltaFastAtrRsi = ta.ema(MaAtrRsi, Wilders_Period) * QQE
  203. newshortband = RSIndex + DeltaFastAtrRsi
  204. newlongband = RSIndex - DeltaFastAtrRsi
  205. longband := RSIndex[1] > longband[1] and RSIndex > longband[1] ? math.max(longband[1], newlongband) : newlongband
  206. shortband := RSIndex[1] < shortband[1] and RSIndex < shortband[1] ? math.min(shortband[1], newshortband) : newshortband
  207. cross_1 = ta.cross(longband[1], RSIndex)
  208. trend := ta.cross(RSIndex, shortband[1]) ? 1 : cross_1 ? -1 : nz(trend[1], 1)
  209. FastAtrRsiTL = trend == 1 ? longband : shortband
  210.  
  211. // Find all the QQE Crosses
  212. QQExlong = 0
  213. QQExlong := nz(QQExlong[1])
  214. QQExshort = 0
  215. QQExshort := nz(QQExshort[1])
  216. QQExlong := FastAtrRsiTL < RSIndex ? QQExlong + 1 : 0
  217. QQExshort := FastAtrRsiTL > RSIndex ? QQExshort + 1 : 0
  218.  
  219. // Conditions
  220. qqeLong = QQExlong == 1 ? FastAtrRsiTL[1] - 50 : na
  221. qqeShort = QQExshort == 1 ? FastAtrRsiTL[1] - 50 : na
  222.  
  223. // Plotting
  224. redorange = color.new(#FF4000, 0)
  225. chartreuse = color.new(#80FF00, 0)
  226. plotshape(shows_QQE and qqeLong, "QQE Long", shape.labelup, location.bottom, color.new(chartreuse, 25), text="QQE", size=size.tiny, textcolor=color.new(#000000, 5))
  227. plotshape(shows_QQE and qqeShort, "QQE Short", shape.labeldown, location.top, color.new(redorange, 25), text="QQE", size=size.tiny, textcolor=color.new(color.white, 5))
  228.  
  229. if alert_Long_QQE and qqeLong
  230. alert('Symbol = (' + syminfo.tickerid + ') \n TimeFrame = (' + timeframe.period + ') \n Current Price (' + str.tostring(close) + ') \n Long [Quantitative Qualitative Estimation (QQE)].-', alert.freq_once_per_bar_close)
  231.  
  232. if alert_Short_QQE and qqeShort
  233. alert('Symbol = (' + syminfo.tickerid + ') \n TimeFrame = (' + timeframe.period + ') \n Current Price (' + str.tostring(close) + ') \n Short [Quantitative Qualitative Estimation (QQE)].-', alert.freq_once_per_bar_close)
  234.  
  235. //___________________________________________________________________________
  236. // VWAP CCI Signals
  237. //___________________________________________________________________________
  238. shows_VCCI = input.bool(false, "═════════ Show VWAP CCI Signals ═════════")
  239. len_cci = input.int(21, "Length", 1, inline="cci")
  240. Type_cci = input.string("vwap(Close)", "Source", inline="cci", options=["vwap(Close)", "vwap(Open)", "vwap(High)", "vwap(Low)", "AVG(vwap(H,L))", "AVG(vwap(O,C))", "VWAP", "Close", "Open", "HL2", "HLC3", "OHLC4", "HLCC4", "High", "Low", "TR"])
  241. alert_Long_cci = input.bool(false, "◁ Alert: [Long - CCI]", inline="alertCCI")
  242. alert_Short_cci = input.bool(false, "◁ Alert: [Short - CCI]", inline="alertCCI")
  243.  
  244. // ALMA - Arnaud Legoux Moving Average of @kurtsmock
  245. enhanced_alma(_series, _length, _offset, _sigma) =>
  246. length = int(_length) // Floating point protection
  247. numerator = 0.0
  248. denominator = 0.0
  249. m = _offset * (length - 1)
  250. s = length / _sigma
  251. for i=0 to length-1
  252. weight = math.exp(-((i-m)*(i-m)) / (2 * s * s))
  253. numerator := numerator + weight * _series[length - 1 - i]
  254. denominator := denominator + weight
  255. numerator / denominator
  256.  
  257. // Calculate vwap cci
  258. src_cci = get_src(Type_cci)
  259. cci = (src_cci - enhanced_alma(src_cci, len_cci, 0.85, 6.0)) / (0.015 * ta.dev(src_cci, len_cci))
  260.  
  261. // Define long and short entry signal
  262. long_cci = ta.crossover(cci, -200)
  263. short_cci = ta.crossunder(cci, 200)
  264.  
  265. plotshape(shows_VCCI and long_cci, "VWAP CCI Long", shape.labelup, location.bottom, color.new(chartreuse, 25), text="CCI", size=size.tiny, textcolor=color.new(#000000, 5))
  266. plotshape(shows_VCCI and short_cci, "VWAP CCI Short", shape.labeldown, location.top, color.new(redorange, 25), text="CCI", size=size.tiny, textcolor=color.new(color.white, 5))
  267.  
  268. if alert_Long_cci and long_cci
  269. alert('Symbol = (' + syminfo.tickerid + ') \n TimeFrame = (' + timeframe.period + ') \n Current Price (' + str.tostring(close) + ') \n Long [Commodity Channel Index (CCI)].-', alert.freq_once_per_bar_close)
  270.  
  271. if alert_Short_cci and short_cci
  272. alert('Symbol = (' + syminfo.tickerid + ') \n TimeFrame = (' + timeframe.period + ') \n Current Price (' + str.tostring(close) + ') \n Short [Commodity Channel Index (CCI)].-', alert.freq_once_per_bar_close)
  273.  
  274. //___________________________________________________________________________________________
  275. // Based on "Squeeze Momentum Indicator" - Author: @LazyBear
  276. // @KivancOzbilgic: https://www.tradingview.com/script/NVzKGYFJ/
  277. // @capissimo: https://www.tradingview.com/script/Ejx2tEHY-Squeeze-Momentum-Indicator-mod-3/
  278. // Indicator description: http://www.forextrading-pips.com/squeeze-indicator/
  279. //___________________________________________________________________________________________
  280. show_SMI = input.bool(false, "Show Squeeze Momentum Indicator", group = "Squeeze Momentum Indicator")
  281. alert_Buy = input.bool(false, "◁ Alert: [Buy - Mom]", inline = "alertMom", group = "Squeeze Momentum Indicator")
  282. alert_Sell = input.bool(false, "◁ Alert: [Sell - Mom]", inline = "alertMom", group = "Squeeze Momentum Indicator")
  283. Type_src = input.string("Close", "Source", inline = "s1", group = "Squeeze Momentum Indicator", options = ["VWAP", "Close", "Open", "HL2", "HLC3", "OHLC4", "HLCC4", "High", "Low", "vwap(Close)", "vwap(Open)", "vwap(High)", "vwap(Low)", "AVG(vwap(H,L))", "AVG(vwap(O,C))", "TR"])
  284. src0 = get_src(Type_src)
  285. show_sb = input.bool(false, "Show buy/sell signal", inline = "s1", group = "Squeeze Momentum Indicator")
  286. lengthMom = input.int(20, "Momentum Length", 1, inline = "mom", group = "Squeeze Momentum Indicator")
  287. siglen = input.int(5, "Signal", 2, inline = "mom", group = "Squeeze Momentum Indicator")
  288. lengthSQZ = input.int(20, "KC/BB Length", 1, inline = "sqz", group = "Squeeze Momentum Indicator")
  289. multBB = input.float(2.0, "BB MultFactor", 0.5, step=0.05, inline = "sqz", group = "Squeeze Momentum Indicator")
  290. multKC = input.float(1.3, "KC MultFactor", 0.5, step=0.05, inline = "kc", group = "Squeeze Momentum Indicator")
  291. use_tr = input.bool(true, "Use TrueRange (KC)", inline = "kc", group = "Squeeze Momentum Indicator")
  292.  
  293. // Calculate BB
  294. basis = ta.sma(src0, lengthSQZ)
  295. dev = ta.stdev(src0, lengthSQZ)
  296. upperBB = basis + multBB * dev
  297. lowerBB = basis - multBB * dev
  298.  
  299. // Calculate KC
  300. maKC = ta.sma(src0, lengthSQZ)
  301. range_1 = use_tr ? ta.tr : high - low
  302. rangema = ta.sma(range_1, lengthSQZ)
  303. upperKC = maKC + rangema * multKC
  304. lowerKC = maKC - rangema * multKC
  305.  
  306. // When both the upper and lower Bollinger Bands go inside the Keltner Channel, the squeeze is on.
  307. // When the Bollinger Bands (BOTH lines) start to come out of the Keltner Channel, the squeeze has been released (off).
  308. // When one of the Bollinger Bands is out of Keltner Channel, no highlighting is done.
  309. sqzOn = lowerBB > lowerKC and upperBB < upperKC
  310. sqzOff = lowerBB <= lowerKC and upperBB >= upperKC
  311. noSqz = sqzOn == false and sqzOff == false
  312.  
  313. mom = ta.linreg(src0 - math.avg(math.avg(ta.highest(high, lengthMom), ta.lowest(low, lengthMom)), ta.sma(close, lengthMom)), lengthMom, 0)
  314. sig = ta.sma(mom, siglen)
  315.  
  316. longSM = ta.crossover(mom, sig)
  317. shortSM = ta.crossunder(mom, sig)
  318. sqz_pos = (sqzOff and mom >= sig)
  319. sqz_neg = (sqzOff and mom < sig)
  320.  
  321. plotshape(show_sb and longSM, "Long Momentum", shape.triangleup, location.bottom, #05FFA6, text='M', textcolor=#05FFA6)
  322. plotshape(show_sb and shortSM, "Short Momentum", shape.triangledown, location.top, #FF0AE2, text='M', textcolor=#FF0AE2)
  323. plotshape(show_SMI and (sqzOn or noSqz) ? true : na, "In Squeeze", shape.circle, location.top, color.silver)
  324. plotshape(show_SMI and sqz_pos ? true : na, "Squeeze Release", shape.triangleup, location.top, #05FFA6)
  325. plotshape(show_SMI and sqz_neg ? true : na, "Squeeze Release", shape.triangledown, location.top, #FF0AE2)
  326.  
  327. if alert_Buy and longSM
  328. alert('Symbol = (' + syminfo.tickerid + ') \n TimeFrame = (' + timeframe.period + ') \n Current Price (' + str.tostring(close) + ') \n Buy [Momentum].-', alert.freq_once_per_bar_close)
  329.  
  330. if alert_Sell and shortSM
  331. alert('Symbol = (' + syminfo.tickerid + ') \n TimeFrame = (' + timeframe.period + ') \n Current Price (' + str.tostring(close) + ') \n Sell [Momentum].-', alert.freq_once_per_bar_close)
  332.  
  333. squeeze_ON = '{"content": "@everyone" ,"embeds": [{"title": "{{ticker}} ","description": "In Squeeze | Price ${{close}}", "color": "2092045","author": {"name":null},"timestamp": "{{timenow}}"}],"username": "Alertbot"}'
  334. squeeze_Long = '{"content": "@everyone" ,"embeds": [{"title": "{{ticker}} ","description": "Squeeze Release Long | Price ${{close}}", "color": "2092045","author": {"name":null},"timestamp": "{{timenow}}"}],"username": "Alertbot"}'
  335. squeeze_Short = '{"content": "@everyone" ,"embeds": [{"title": "{{ticker}} ","description": "Squeeze Release Short | Price ${{close}}", "color": "2092045","author": {"name":null},"timestamp": "{{timenow}}"}],"username": "Alertbot"}'
  336.  
  337. alertcondition(sqzOn or noSqz, title="In Squeeze", message=squeeze_ON)
  338. alertcondition(sqz_pos, title="Squeeze Release | Long", message=squeeze_Long)
  339. alertcondition(sqz_neg, title="Squeeze Release | Short", message=squeeze_Short)
Add Comment
Please, Sign In to add comment