indicateur weelky sur une UT 1h
Forums › ProRealTime forum Français › Support ProBuilder › indicateur weelky sur une UT 1h
- This topic has 6 replies, 2 voices, and was last updated 2 days ago by
finplus.
-
-
08/24/2025 at 3:50 PM #25001308/24/2025 at 6:43 PM #250020
Oui, voici un exemple sur le DAX (1h). Bien entendu, vous devez utiliser suffisamment d’unités sur le graphique horaire pour calculer l’indicateur hebdomadaire :
12345678Timeframe(Weekly)SmaW = average[20,0](close)//Timeframe(1h)Sma1h = average[20,0](close)//Timeframe(default)RETURN SmaW AS "Sma weekly",Sma1h AS "Sma hourly"08/25/2025 at 7:29 AM #25003108/25/2025 at 6:10 PM #250050Timeframe weekly et 1h123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151// Original Script > @DonovanWall// Adapted Version > @guikroth//////////////////////////////////////////////////////////////////////////// Settings for 5min chart, BTCUSDC. For Other coin, change the parameters//////////////////////////////////////////////////////////////////////////Timeframe (weekly)// Sourcesrc = customclose// Sampling Period// Settings for 5min chart, BTCUSDC. For Other coin, change the paremeters// per = defval=100, minval=1, "Sampling Period"// Range Multiplier// mult = defval=3.0, minval=0.1, "Range Multiplier"PER = 150MULT = 3// Smooth Average Rangewper = per*2 -1avrng = exponentialaverage[per](abs(src-src[1]))smrng = mult * exponentialaverage[wper](avrng)// Range Filterrngfilt = srcIf src > rngfilt[1] thenIf rngfilt[1] > src-smrng thenrngfilt = rngfilt[1]Elserngfilt = src-smrngendifelsif rngfilt[1] < src+smrng thenrngfilt = rngfilt[1]elserngfilt = src+smrngendiffilt = rngfilt// Filter Directionupward = 0If filt > filt[1] thenupward = upward[1]+1elsif filt < filt[1] thenupward = 0elseupward = upward[1]endifdownward = 0If filt < filt[1] thendownward = downward[1]+1elsif filt > filt[1] thendownward = 0elsedownward = downward[1]endif// Target Bandshband = filt + smrnglband = filt - smrng//// Zone de couleurs : selon des conditions////////////////////////////////////////////////////////////////////////////mbTendance = (Average[3](filt) + filt)/2if mbTendance > mbTendance[1] thenred=0green=0blue=255elsif mbTendance < mbTendance[1] thenred=255green=0blue=0endifcolorbetween(lband,hband,red,Green,Blue,88)Timeframe (1 hour)// Sourcesrc1h = customclose// Smooth Average Rangeper1h = 150mult1h = 3wper1h = per1h*2 -1avrng1h = exponentialaverage[per1h](abs(src1h-src1h[1]))smrng1h = mult1h * exponentialaverage[wper1h](avrng1h)// Range Filterrngfilt1h = src1hIf src1h > rngfilt1h[1] thenIf rngfilt1h[1] > src1h-smrng1h thenrngfilt1h = rngfilt1h[1]Elserngfilt1h = src1h-smrng1hendifelsif rngfilt1h[1] < src1h+smrng1h thenrngfilt1h = rngfilt1h[1]elserngfilt1h = src1h+smrng1hendiffilt1h = rngfilt1h// Filter Directionupward1h = 0If filt1h > filt1h[1] thenupward1h = upward1h[1]+1elsif filt1h < filt1h[1] thenupward1h = 0elseupward1h = upward1h[1]endifdownward1h = 0If filt1h < filt1h[1] thendownward1h = downward1h[1]+1elsif filt1h > filt1h[1] thendownward1h = 0elsedownward1h = downward1h[1]endif// Target Bandshband1h = filt1h + smrng1hlband1h = filt1h - smrng1h//// Zone de couleurs : selon des conditions////////////////////////////////////////////////////////////////////////////mbTendance1h = (Average[3](filt1h) + filt1h)/2if mbTendance1h > mbTendance1h[1] thenred1h=0green1h=0blue1h=255elsif mbTendance1h < mbTendance1h[1] thenred1h=255green1h=0blue1h=0endifTimeframe(default)Return filt as "Range Filter", hband as "High Target", lband as "Low Target", mbtendance as "tendance", filt1h as "Range Filter1H", hband1h as "High Target1H", lband1h as "Low Target1H", mbtendance1h as "tendance1H"Bonsoir Roberto,
ci-joint le code que j’ai essayé de transformer en weekly et 1h.
je m’attendais à voir deux graphes mais ce n’est pas le cas.
Pourriez-vous me dire où est le problème ?
Merci.
08/25/2025 at 6:14 PM #25005108/26/2025 at 4:06 PM #250076Comme je l’ai dit plus haut “vous devez utiliser suffisamment d’unités sur le graphique horaire pour calculer l’indicateur hebdomadaire“.
Une moyenne exponentielle nécessite environ deux fois plus d’unités que de périodes, soit environ 300 unités par semaine. Comme une semaine compte 5 jours et que chaque jour dure 24 heures, le nombre total d’unités horaires nécessaires sera d’environ 36 000 (300 x 5 x 24), voire plus.
08/26/2025 at 5:29 PM #250083 -
AuthorPosts
Find exclusive trading pro-tools on