programme de calcul des points pivots
Forums › ProRealTime forum Français › Support ProOrder › programme de calcul des points pivots
- This topic has 7 replies, 3 voices, and was last updated 2 months ago by
LucasBest.
-
-
05/13/2025 at 11:14 AM #247042
Bonjour a tous,
Je cherche a intégrer a mon programme les points pivots journaliers, semaine et mois ainsi que 4h mais leurs mid.
Il y a plusieurs formules sur le forum et je vousais etre de prendre la bonne c’est a dire identique aux calculs de PRT nativement.
Pouvez vous m’aider ?
Merci !05/13/2025 at 5:53 PM #247071Essayez cet indicateur (c’est un indicateur existant sur le forum, que j’ai modifié).
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128DEFPARAM CalculateOnLastBars = 5000Once mode = 0 //0, 1, 2, 3Once dailyPivot = 0Once dailyHigh = 0Once dailyLow = 0Once dailyR1 = 0Once dailyS1 = 0Once dailyR2 = 0Once dailyS2 = 0Once dailyR3 = 0Once dailyS3 = 0Once lastWeekBarIndex = 0Once weeklyHigh = 0Once weeklyLow = 0Once weeklyPivot = 0Once weeklyR1 = 0Once weeklyS1 = 0Once weeklyR2 = 0Once weeklyS2 = 0Once weeklyR3 = 0Once weeklyS3 = 0Once lastMonthBarIndex = 0Once monthlyHigh = 0Once monthlyLow = 0Once monthlyPivot = 0Once monthlyR1 = 0Once monthlyS1 = 0Once monthlyR2 = 0Once monthlyS2 = 0Once monthlyR3 = 0Once monthlyS3 = 0Once lastHourBarIndex = 0Once hourlyHigh = 0Once hourlyLow = 0Once hourlyPivot = 0Once hourlyR1 = 0Once hourlyS1 = 0Once hourlyR2 = 0Once hourlyS2 = 0Once hourlyR3 = 0Once hourlyS3 = 0If Day<>Day[1] thenIf mode = 0 thendailyPivot = (High[1] + Low[1] + Close[1]) / 3Elsif mode = 1 thendailyPivot = (Open + High[1] + Low[1] + Close[1]) / 4Elsif mode = 2 thendailyPivot = (High[1] + Low[1] + Close[1]*2) / 4ElsedailyPivot = (Open*2 + High[1] + Low[1]) / 4EndifdailyR1 = 2*dailyPivot - Low[1]dailyS1 = 2*dailyPivot - High[1]dailyR2 = dailyPivot + (High[1] - Low[1])dailyS2 = dailyPivot - (High[1] - Low[1])dailyR3 = dailyR1 + (High[1] - Low[1])dailyS3 = dailyS1 - (High[1] - Low[1])EndifIf DayOfWeek<>DayOfWeek[1] thenweeklyHigh = Highest[BarIndex - lastWeekBarIndex](High)[1]weeklyLow = Lowest[BarIndex - lastWeekBarIndex](Low)[1]lastWeekBarIndex = BarIndexIf mode = 0 thenweeklyPivot = (weeklyHigh + weeklyLow + Close[1]) / 3Elsif mode = 1 thenweeklyPivot = (Open + weeklyHigh + weeklyLow + Close[1]) / 4Elsif mode = 2 thenweeklyPivot = (weeklyHigh + weeklyLow + Close[1]*2) / 4ElseweeklyPivot = (Open*2 + weeklyHigh + weeklyLow) / 4EndifweeklyR1 = 2*weeklyPivot - weeklyLowweeklyS1 = 2*weeklyPivot - weeklyHighweeklyR2 = weeklyPivot + (weeklyHigh - weeklyLow)weeklyS2 = weeklyPivot - (weeklyHigh - weeklyLow)weeklyR3 = weeklyR1 + (weeklyHigh - weeklyLow)weeklyS3 = weeklyS1 - (weeklyHigh - weeklyLow)EndifIf Month<>Month[1] thenmonthlyHigh = Highest[BarIndex - lastMonthBarIndex](High)[1]monthlyLow = Lowest[BarIndex - lastMonthBarIndex](Low)[1]lastMonthBarIndex = BarIndexIf mode = 0 thenmonthlyPivot = (monthlyHigh + monthlyLow + Close[1]) / 3Elsif mode = 1 thenmonthlyPivot = (Open + monthlyHigh + monthlyLow + Close[1]) / 4Elsif mode = 2 thenmonthlyPivot = (monthlyHigh + monthlyLow + Close[1]*2) / 4ElsemonthlyPivot = (Open*2 + monthlyHigh + monthlyLow) / 4EndifmonthlyR1 = 2*monthlyPivot - monthlyLowmonthlyS1 = 2*monthlyPivot - monthlyHighmonthlyR2 = monthlyPivot + (monthlyHigh - monthlyLow)monthlyS2 = monthlyPivot - (monthlyHigh - monthlyLow)monthlyR3 = monthlyR1 + (monthlyHigh - monthlyLow)monthlyS3 = monthlyS1 - (monthlyHigh - monthlyLow)EndifIf (hour mod 4 = 1) thenhourlyHigh = Highest[BarIndex - lastHourBarIndex](High)[1]hourlyLow = Lowest[BarIndex - lastHourBarIndex](Low)[1]lastHourBarIndex = BarIndexIf mode = 0 thenhourlyPivot = (hourlyHigh + hourlyLow + Close[1]) / 3Elsif mode = 1 thenhourlyPivot = (Open + hourlyHigh + hourlyLow + Close[1]) / 4Elsif mode = 2 thenhourlyPivot = (hourlyHigh + hourlyLow + Close[1]*2) / 4ElsehourlyPivot = (Open*2 + hourlyHigh + hourlyLow) / 4EndifhourlyR1 = 2*hourlyPivot - hourlyLowhourlyS1 = 2*hourlyPivot - hourlyHighhourlyR2 = hourlyPivot + (hourlyHigh - hourlyLow)hourlyS2 = hourlyPivot - (hourlyHigh - hourlyLow)hourlyR3 = hourlyR1 + (hourlyHigh - hourlyLow)hourlyS3 = hourlyS1 - (hourlyHigh - hourlyLow)EndifReturn dailyPivot coloured(255,0,0) as "dP", dailyR1 coloured(255,0,0) as "dR1", dailyS1 coloured(255,0,0) as "dS1", dailyR2 coloured(255,0,0) as "dR2", dailyS2 coloured(255,0,0) as "dS2", dailyR3 coloured(255,0,0) as "dR3", dailyS3 coloured(255,0,0) as "dS3", weeklyPivot coloured(0,255,0) as "wP", weeklyR1 coloured(0,255,0) as "wR1", weeklyS1 coloured(0,255,0) as "wS1", weeklyR2 coloured(0,255,0) as "wR2", weeklyS2 coloured(0,255,0) as "wS2", weeklyR3 coloured(0,255,0) as "wR3", weeklyS3 coloured(0,255,0) as "wS3", monthlyPivot coloured(0,0,255) as "mP", monthlyR1 coloured(0,0,255) as "mR1", monthlyS1 coloured(0,0,255) as "mS1", monthlyR2 coloured(0,0,255) as "mR2", monthlyS2 coloured(0,0,255) as "mS2", monthlyR3 coloured(0,0,255) as "mR3", monthlyS3 coloured(0,0,255) as "mS3", hourlyPivot coloured("Fuchsia") as "hP", hourlyR1 coloured("Fuchsia") as "hR1", hourlyS1 coloured("Fuchsia") as "hS1", hourlyR2 coloured("Fuchsia") as "hR2", hourlyS2 coloured("Fuchsia") as "hS2", hourlyR3 coloured("Fuchsia") as "hR3", hourlyS3 coloured("Fuchsia") as "hS3"1 user thanked author for this post.
05/17/2025 at 3:57 PM #24723705/18/2025 at 8:44 AM #247257Bonjour,
En fait cf le screenshot ci dessous, dans un premier temps je n’ai regardé que les points pivots journaliers sur MNQ :
-> le point pivot n’est pas le meme : c’est la ligne rouge qui est calculée par ton programme et les lignes bleues sont celles de PRT (reglé en standard)
-> je ne sais pas pourquoi mais le point pivot se calcule a 7 h du matin ce qui explique sans doute l’écartPeut etre avez vous une idée?
bien a vous,
05/18/2025 at 10:36 AM #247265Certains instruments financiers, notamment non européens, ont des horaires différents.
Apparemment, le nouveau jour commence à 07h00, cela pourrait être une cause.05/18/2025 at 2:03 PM #24727305/29/2025 at 10:59 PM #247738Une erreur ligne 65 ?
A tester1234If DayOfWeek<>DayOfWeek[1] then // n'y a t'il pas une erreur dans cette ligne ?//N'importe quel nouveau jour de la semaine et le code pense que l'on change de semaineIf DayOfWeek<DayOfWeek[1] then //Retour au 1er jour de la semaine = changement de semaine06/12/2025 at 8:02 AM #248206Pivots jour et hebdo identiques à ceux de PRT
Pivots Jour et Hebdo12345678910111213141516171819202122232425262728293031if OpenTime=010000 and dayofweek=1 thenWeekHigh = HighWeekLow = LowWeekClose = CloseendifIF (OpenTime=010000 and dayofweek<>1) or (dayofweek<dayofweek[1]) THENIF dayofweek <> 1 or dayofweek<DAYOFWEEK[1] THENWeekHigh = Max(WeekHigh, DHigh(1))WeekLow = Min(WeekLow, DLow(1))WeekClose = DClose(1)PivotDuJour = (DHigh(1) + DLow(1) + DClose(1)) / 3Elsif dayofweek = 1 and dayofweek=dayofweek[1] thenWeekHigh = Max(WeekHigh, DHigh(2))WeekLow = Min(WeekLow, DLow(2))WeekClose = DClose(2)PivotDuJour = (DHigh(2) + DLow(2) + DClose(2)) / 3endifif dayofweek<dayofweek[1] thenPivotHebdo = (WeekHigh+WeekLow+WeekClose)/3endifendifReturn PivotDuJour coloured'"blue",200), PivotHebdo coloured("red",200)1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on