indicateur Tendance TKP T3 avec Psar Barcolor
Forums › ProRealTime forum Français › Support ProOrder › indicateur Tendance TKP T3 avec Psar Barcolor
- This topic has 1 reply, 2 voices, and was last updated 11 months ago by Jean FX.
Viewing 2 posts - 1 through 2 (of 2 total)
-
-
11/24/2023 at 8:37 PM #224272
Bonjour a tous =)
je suis en train de tester un nouvelle indicateur ( indicateur trouver dans prorealcode), je souhaiterais prendre position à l’achat lorsque la première boule bleue apparait et prendre position à la vente lorsque la première boule rouge apparait,
pouvez vous m’aider à coder le code svp
merci beaucoup
Tendance TKP T3 avec Psar Barcolor123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271//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 Inputslong = 25short = 5signal = 14// --------------------// Calculate TSIpc = close - close[1]// Calculate double smoothed PCfirstsmooth = ExponentialAverage[long](pc)doublesmoothedpc = ExponentialAverage[short](firstsmooth)// Calculate double smoothed absolute PCabspc = abs(pc)firstsmoothabs = ExponentialAverage[long](abspc)doublesmoothedabspc = ExponentialAverage[short](firstsmoothabs)tsivalue = 100 * (doublesmoothedpc / doublesmoothedabspc)// Calculate Signalsdata = tsivalue > tsivalue[1] AND tsivalue < ExponentialAverage[signal](tsivalue)dtat = tsivalue < tsivalue[1] AND tsivalue > ExponentialAverage[signal](tsivalue)// Define ATRatr = AverageTrueRange[14](close)// Plot Upward-Pointing Triangle using drawtext for "Curl Up" with color "green"IF data THENDRAWTEXT("▴", 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 THENDRAWTEXT("▾", barindex, high + atr / 2, dialog, bold, 25) coloured(255, 165, 0, 255)ENDIF// Parabolic Stop and ReversestartValue = 0.043incrementValue = 0.043maximumValue = 0.34// Calculate PSARsarUp = SAR[startValue, incrementValue, maximumValue]sarDown = SAR[startValue, incrementValue, maximumValue]// Define ColorscolUpR = 100colUpG = 181colUpB = 246colDownR = 239colDownG = 83colDownB = 80// Condition to check if close is greater or equal to sarDownIF close >= sarDown THENDRAWPOINT(barindex, sarUp, 3) coloured(colUpR, colUpG, colUpB, 255)ENDIF// Condition to check if close is less or equal to sarUpIF close <= sarUp THENDRAWPOINT(barindex, sarDown, 3) coloured(colDownR, colDownG, colDownB, 255)ENDIF// T3 MA5aLength = 5AxPrice = closeaxe1 = 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.7ac1 = -ab * ab * abac2 = 3 * ab * ab + 3 * ab * ab * abac3 = -6 * ab * ab - 3 * ab - 3 * ab * ab * abac4 = 1 + 3 * ab + ab * ab * ab + 3 * ab * abanT3Average = ac1 * axe6 + ac2 * axe5 + ac3 * axe4 + ac4 * axe3p2 = anT3AveragecolOne = anT3Average > anT3Average[1]colTwo = anT3Average < anT3Average[1]IF colOne THENT3ColorR = 100T3ColorG = 181T3ColorB = 246ELSIF colTwo THENT3ColorR = 239T3ColorG = 83T3ColorB = 80ELSET3ColorR = undefinedT3ColorG = undefinedT3ColorB = undefinedENDIF// T3 MA8Length = 8xPrice = closexe1 = 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.7c1 = -b * b * bc2 = 3 * b * b + 3 * b * b * bc3 = -6 * b * b - 3 * b - 3 * b * b * bc4 = 1 + 3 * b + b * b * b + 3 * b * bnT3Average = c1 * xe6 + c2 * xe5 + c3 * xe4 + c4 * xe3p1 = nT3AverageupCol = nT3Average > nT3Average[1]downCol = nT3Average < nT3Average[1]IF upCol THENmyColorR = 100myColorG = 181myColorB = 246ELSIF downCol THENmyColorR = 239myColorG = 83myColorB = 80ELSEmyColorR = undefinedmyColorG = undefinedmyColorB = undefinedENDIF// T3 area fillfillData = nT3Average < anT3AveragefillDtat = nT3Average > anT3AverageIF fillData THENFillColorR = 100FillColorG = 181FillColorB = 246ELSIF fillDtat THENFillColorR = 239FillColorG = 83FillColorB = 80ELSEFillColorR = undefinedFillColorG = undefinedFillColorB = undefinedENDIFCOLORBETWEEN(nT3Average, anT3Average, FillColorR, FillColorG, FillColorB, 80)// Heikin-Ashi Bar InputhaClose = (open + high + low + close) / 4haOpen = (open + close) / 2IF NOT haOpen[1] = undefined THENhaOpen = (haOpen[1] + haClose[1]) / 2ENDIFhaHigh = MAX(high, MAX(haOpen, haClose))haLow = MIN(low, MIN(haOpen, haClose))// Define colorsBullTrendColorR = 100BullTrendColorG = 181BullTrendColorB = 246BearTrendColorR = 239BearTrendColorG = 83BearTrendColorB = 80BullReversalColorR = 255BullReversalColorG = 241BullReversalColorB = 118BearReversalColorR = 255BearReversalColorG = 241BearReversalColorB = 118// Bar Coloruc = (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 >= haOpenhadd = haClose < haOpenIF uc THENBarColorR = BullTrendColorRBarColorG = BullTrendColorGBarColorB = BullTrendColorBELSIF dc THENBarColorR = BearTrendColorRBarColorG = BearTrendColorGBarColorB = BearTrendColorBELSIF dr THENBarColorR = BearReversalColorRBarColorG = BearReversalColorGBarColorB = BearReversalColorBELSIF ur THENBarColorR = BullReversalColorRBarColorG = BullReversalColorGBarColorB = BullReversalColorBELSEBarColorR = undefinedBarColorG = undefinedBarColorB = undefinedENDIF// Heikin-Ashi Bar ColorIF hauc THENHABarColorR = BullTrendColorRHABarColorG = BullTrendColorGHABarColorB = BullTrendColorBELSIF hadc THENHABarColorR = BearTrendColorRHABarColorG = BearTrendColorGHABarColorB = BearTrendColorBELSIF hadr THENHABarColorR = BearReversalColorRHABarColorG = BearReversalColorGHABarColorB = BearReversalColorBELSIF haur THENHABarColorR = BullReversalColorRHABarColorG = BullReversalColorGHABarColorB = BullReversalColorBELSIF hadu THENHABarColorR = BullTrendColorRHABarColorG = BullTrendColorGHABarColorB = BullTrendColorBELSEHABarColorR = BearTrendColorRHABarColorG = BearTrendColorGHABarColorB = BearTrendColorBENDIFhaover = 0 // Overlays HA bars in place of regular candles.rPrice = 0 // Displays 'real close' levelIF haover THENDRAWCANDLE(haOpen, haHigh, haLow, haClose) COLOURED(HABarColorR, HABarColorG, HABarColorB, 255)ELSEDRAWCANDLE(haOpen, haHigh, haLow, haClose) COLOURED(255, 255, 255, 255) // Default color (white) when haover is not active.ENDIFIF rPrice THENDRAWsegment(barindex - 1, close, barindex, close) COLOURED(HABarColorR, HABarColorG, HABarColorB, 255) // Displaying the real close levelENDIFc = (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)12/20/2023 at 3:18 PM #225529Et voilà :
12345678910111213141516// Parabolic Stop and ReversestartValue = 0.043incrementValue = 0.043maximumValue = 0.34// Calculate PSARMySAR = SAR[startValue, incrementValue, maximumValue]if close crosses over MySAR thenbuy at marketendifif close crosses under MySAR thensellshort at marketendif1 user thanked author for this post.
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
Find exclusive trading pro-tools on
Similar topics: