This indicator is intended to help identify reversals and attempt to anticiapate them.
Bull trends are identified by blue bars, while bear trades are identified by red. Points of reversal are indicated with yellow candles. //Bars change to yellow as bar close crosses the Tilson moving averages. Blue or red is confrimed as the two Tilson avergaes themselves cross.
Buy and sell signal is given on yellow bars
Psar helps identify reversals and provide stop loss values
Arrows appear above or below candles to incorporate a momentum aspect. This condition is based on a rising or falling TSI value while under or over the signal line. This can show momentum ‘headwinds’ or ‘tailwinds’ as TSI ‘curls’.
Description from original author: Bjorgum
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 |
//this script is intended to help identify reversals and attempt to anticiapate them. Psar and Tilson templates are from Chris Moody and TKP Trader //@Bjorgum on Stocktwits //Bull trends are identified by blue bars, while bear trades are identified by red. Points of reversal are indicated with yellow candles. //Bars change to yellow as bar close crosses the Tilson moving averages. Blue or red is confrimed as the two Tilson avergaes themselves cross. //Buy and sell signal is given on yellow bars //TURN CANDLE BORDERS OFF //Psar helps identify reversals and provide stop loss values //Arrows appear above or below candles to incorporate a momentum aspect. This condition is based on a rising or falling TSI value while under or over the signal line. //This can show momentum 'headwinds' or 'tailwinds' as TSI 'curls'. // TSI Inputs long = 25 short = 5 signal = 14 // -------------------- // Calculate TSI pc = close - close[1] // Calculate double smoothed PC firstsmooth = ExponentialAverage[long](pc) doublesmoothedpc = ExponentialAverage[short](firstsmooth) // Calculate double smoothed absolute PC abspc = abs(pc) firstsmoothabs = ExponentialAverage[long](abspc) doublesmoothedabspc = ExponentialAverage[short](firstsmoothabs) tsivalue = 100 * (doublesmoothedpc / doublesmoothedabspc) // Calculate Signals data = tsivalue > tsivalue[1] AND tsivalue < ExponentialAverage[signal](tsivalue) dtat = tsivalue < tsivalue[1] AND tsivalue > ExponentialAverage[signal](tsivalue) // Define ATR atr = AverageTrueRange[14](close) // Plot Upward-Pointing Triangle using drawtext for "Curl Up" with color "green" IF data THEN DRAWTEXT("▴", barindex, low - atr / 2, dialog, bold, 25) coloured(0, 255, 0, 255) ENDIF // Plot Downward-Pointing Triangle using drawtext for "Curl Down" with color "orange" IF dtat THEN DRAWTEXT("▾", barindex, high + atr / 2, dialog, bold, 25) coloured(255, 165, 0, 255) ENDIF // Parabolic Stop and Reverse startValue = 0.043 incrementValue = 0.043 maximumValue = 0.34 // Calculate PSAR sarUp = SAR[startValue, incrementValue, maximumValue] sarDown = SAR[startValue, incrementValue, maximumValue] // Define Colors colUpR = 100 colUpG = 181 colUpB = 246 colDownR = 239 colDownG = 83 colDownB = 80 // Condition to check if close is greater or equal to sarDown IF close >= sarDown THEN DRAWPOINT(barindex, sarUp, 3) coloured(colUpR, colUpG, colUpB, 255) ENDIF // Condition to check if close is less or equal to sarUp IF close <= sarUp THEN DRAWPOINT(barindex, sarDown, 3) coloured(colDownR, colDownG, colDownB, 255) ENDIF // T3 MA5 aLength = 5 AxPrice = close axe1 = ExponentialAverage[aLength](AxPrice) axe2 = ExponentialAverage[aLength](axe1) axe3 = ExponentialAverage[aLength](axe2) axe4 = ExponentialAverage[aLength](axe3) axe5 = ExponentialAverage[aLength](axe4) axe6 = ExponentialAverage[aLength](axe5) ab = 0.7 ac1 = -ab * ab * ab ac2 = 3 * ab * ab + 3 * ab * ab * ab ac3 = -6 * ab * ab - 3 * ab - 3 * ab * ab * ab ac4 = 1 + 3 * ab + ab * ab * ab + 3 * ab * ab anT3Average = ac1 * axe6 + ac2 * axe5 + ac3 * axe4 + ac4 * axe3 p2 = anT3Average colOne = anT3Average > anT3Average[1] colTwo = anT3Average < anT3Average[1] IF colOne THEN T3ColorR = 100 T3ColorG = 181 T3ColorB = 246 ELSIF colTwo THEN T3ColorR = 239 T3ColorG = 83 T3ColorB = 80 ELSE T3ColorR = undefined T3ColorG = undefined T3ColorB = undefined ENDIF // T3 MA8 Length = 8 xPrice = close xe1 = ExponentialAverage[Length](xPrice) xe2 = ExponentialAverage[Length](xe1) xe3 = ExponentialAverage[Length](xe2) xe4 = ExponentialAverage[Length](xe3) xe5 = ExponentialAverage[Length](xe4) xe6 = ExponentialAverage[Length](xe5) b = 0.7 c1 = -b * b * b c2 = 3 * b * b + 3 * b * b * b c3 = -6 * b * b - 3 * b - 3 * b * b * b c4 = 1 + 3 * b + b * b * b + 3 * b * b nT3Average = c1 * xe6 + c2 * xe5 + c3 * xe4 + c4 * xe3 p1 = nT3Average upCol = nT3Average > nT3Average[1] downCol = nT3Average < nT3Average[1] IF upCol THEN myColorR = 100 myColorG = 181 myColorB = 246 ELSIF downCol THEN myColorR = 239 myColorG = 83 myColorB = 80 ELSE myColorR = undefined myColorG = undefined myColorB = undefined ENDIF // T3 area fill fillData = nT3Average < anT3Average fillDtat = nT3Average > anT3Average IF fillData THEN FillColorR = 100 FillColorG = 181 FillColorB = 246 ELSIF fillDtat THEN FillColorR = 239 FillColorG = 83 FillColorB = 80 ELSE FillColorR = undefined FillColorG = undefined FillColorB = undefined ENDIF COLORBETWEEN(nT3Average, anT3Average, FillColorR, FillColorG, FillColorB, 80) // Heikin-Ashi Bar Input haClose = (open + high + low + close) / 4 haOpen = (open + close) / 2 IF NOT haOpen[1] = undefined THEN haOpen = (haOpen[1] + haClose[1]) / 2 ENDIF haHigh = MAX(high, MAX(haOpen, haClose)) haLow = MIN(low, MIN(haOpen, haClose)) // Define colors BullTrendColorR = 100 BullTrendColorG = 181 BullTrendColorB = 246 BearTrendColorR = 239 BearTrendColorG = 83 BearTrendColorB = 80 BullReversalColorR = 255 BullReversalColorG = 241 BullReversalColorB = 118 BearReversalColorR = 255 BearReversalColorG = 241 BearReversalColorB = 118 // Bar Color uc = (close > nT3Average) AND (anT3Average >= nT3Average) dc = (close < nT3Average) AND (anT3Average <= nT3Average) dr = (close < nT3Average) AND (anT3Average >= nT3Average) ur = (close > nT3Average) AND (anT3Average <= nT3Average) hauc = (haClose > nT3Average) AND (anT3Average >= nT3Average) hadc = (haClose < nT3Average) AND (anT3Average <= nT3Average) hadr = (haClose < nT3Average) AND (anT3Average >= nT3Average) haur = (haClose > nT3Average) AND (anT3Average <= nT3Average) hadu = haClose >= haOpen hadd = haClose < haOpen IF uc THEN BarColorR = BullTrendColorR BarColorG = BullTrendColorG BarColorB = BullTrendColorB ELSIF dc THEN BarColorR = BearTrendColorR BarColorG = BearTrendColorG BarColorB = BearTrendColorB ELSIF dr THEN BarColorR = BearReversalColorR BarColorG = BearReversalColorG BarColorB = BearReversalColorB ELSIF ur THEN BarColorR = BullReversalColorR BarColorG = BullReversalColorG BarColorB = BullReversalColorB ELSE BarColorR = undefined BarColorG = undefined BarColorB = undefined ENDIF // Heikin-Ashi Bar Color IF hauc THEN HABarColorR = BullTrendColorR HABarColorG = BullTrendColorG HABarColorB = BullTrendColorB ELSIF hadc THEN HABarColorR = BearTrendColorR HABarColorG = BearTrendColorG HABarColorB = BearTrendColorB ELSIF hadr THEN HABarColorR = BearReversalColorR HABarColorG = BearReversalColorG HABarColorB = BearReversalColorB ELSIF haur THEN HABarColorR = BullReversalColorR HABarColorG = BullReversalColorG HABarColorB = BullReversalColorB ELSIF hadu THEN HABarColorR = BullTrendColorR HABarColorG = BullTrendColorG HABarColorB = BullTrendColorB ELSE HABarColorR = BearTrendColorR HABarColorG = BearTrendColorG HABarColorB = BearTrendColorB ENDIF haover = 0 // Overlays HA bars in place of regular candles. rPrice = 0 // Displays 'real close' level IF haover THEN DRAWCANDLE(haOpen, haHigh, haLow, haClose) COLOURED(HABarColorR, HABarColorG, HABarColorB, 255) ELSE DRAWCANDLE(haOpen, haHigh, haLow, haClose) COLOURED(255, 255, 255, 255) // Default color (white) when haover is not active. ENDIF IF rPrice THEN DRAWsegment(barindex - 1, close, barindex, close) COLOURED(HABarColorR, HABarColorG, HABarColorB, 255) // Displaying the real close level ENDIF c = (close > nT3Average[1] AND close[1] < nT3Average) OR (close < nT3Average[1] AND close[1] > nT3Average) d = (nT3Average > anT3Average[1] AND nT3Average[1] < anT3Average) OR (nT3Average < anT3Average[1] AND nT3Average[1] > anT3Average) // These conditions can be used in ProRealTime to create alerts. RETURN nT3Average coloured(myColorR, myColorG, myColorB, 255), anT3Average coloured(T3ColorR, T3ColorG, T3ColorB, 255) |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Hello, after watching the attached video of Chris Moody, it seems to me that a certain number of elements are missing! What do you think? https://www.youtube.com/watch?v=k91gA-YrXZQ
It is not the same indicator… The one of the video is this one below :
https://fr.tradingview.com/script/GE7tSQK1-CM-Sling-Shot-System/
The one translated here is this one below :
https://www.tradingview.com/script/5zoE62bC-TKP-T3-Trend-With-Psar-Barcolor/
@LucasBest Thanks for the precision.
Hi, I couldn’t see the candles well. Changing the code solves the problem.
from line 164 to line 171 should be:
// Heikin-Ashi Bar Input
haOpen = (haopen + haclose)/2
haClose = (open + high + low + close) / 4
IF NOT haOpen[1] = undefined THEN
haOpen = (haOpen[1] + haClose[1]) / 2
ENDIF
haLow = MIN(MIN(haOpen, haClose),low)
haHigh = MAX(MAX(haOpen, haClose),high)
great job @LucasBest
Thank you
@LucasBest Hello, do you think it is possible to isolate moving averages? I would like to use them in a Screener. I made a few attempts, but they ended in failure!