Nicolas

Yearly pivot points

Category: Indicators By: Nicolas Created: October 26, 2016, 3:02 PM
October 26, 2016, 3:02 PM
Indicators
15 Comments
Yearly pivot points

Here is an annual pivot points indicator that complete the whole series of pivot points indis that can be found in our prorealtime code library. Like the other ones, this one embed 3 different kind of calculation that can be changed at will with the variable “mode” available at line 8 of the code.

To compute correctly, the indicator need sufficient amount of data, especially on intraday timeframe.  

coded by request on the French forums.

//PRC_YearlyPivotPoints | indicator
//26.10.2016
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//adapted from PRT original indicator 

//select mode of calculation of the yearly pivot points (0,1,2)
mode = 0

If Year<>Year[1] then
 yearlyHigh = Highest[BarIndex - lastYearBarIndex](High)[1]
 yearlyLow = Lowest[BarIndex - lastYearBarIndex](Low)[1]
 lastYearBarIndex = BarIndex

 If mode = 0 then
  yearlyPivot = (yearlyHigh + yearlyLow + Close[1]) / 3
 Elsif mode = 1 then
  yearlyPivot = (Open + yearlyHigh + yearlyLow + Close[1]) / 4
 Elsif mode = 2 then
  yearlyPivot = (yearlyHigh + yearlyLow + Close[1]*2) / 4
 Else
  yearlyPivot = (Open*2 + yearlyHigh + yearlyLow) / 4
 Endif
 yearlyR1 = 2*yearlyPivot - yearlyLow
 yearlyS1 = 2*yearlyPivot - yearlyHigh
 yearlyR2 = yearlyPivot + (yearlyHigh - yearlyLow)
 yearlyS2 = yearlyPivot - (yearlyHigh - yearlyLow)
 yearlyR3 = yearlyR1 + (yearlyHigh - yearlyLow)
 yearlyS3 = yearlyS1 - (yearlyHigh - yearlyLow)
Endif

return yearlyPivot as "yearly P", yearlyR1 as "yearly R1", yearlyS1 as "yearly S1", yearlyR2 as "yearly R2", yearlyS2 as "yearly S2", yearlyR3 as "yearly R3", yearlyS3 as "yearly S3"

 

Download
Filename: PRC_YearlyPivotPoints.itf
Downloads: 134
Nicolas
Nicolas Legend
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

juju333
6 years ago
#

merci !!!

juju333
6 years ago
#

Merci Nicolas, j'utilisais avec bonheur ce code dans la 10.3, il ne tourne plus dans la v11. Je suppose que quelqu'un a déjà cherché à le mettre à jour ?

Nicolas
6 years ago
#

Remplacer les lignes 11 et par 12 avec: yearlyHigh = Highest[max(1,BarIndex - lastYearBarIndex)](High)[1] yearlyLow = Lowest[max(1,BarIndex - lastYearBarIndex)](Low)[1]

juju333
6 years ago
#

Génial merci Nicolas. Il est facile d'ajouter les niveau S/R 4 et 5 ? avec la purge cette année, on voit que certains indices sont allés les chercher (ESP35, etc. )

Nicolas
6 years ago
#

Oui c'est facile

Henchey
6 years ago
#

Bonjour Nicolas, seriez-vous en mesure de nous conseiller sur la façon d'identifier un point de pivot annuel dans le pro screener? Merci Pete

Henchey
6 years ago
#

Yes I can't get this to work either

curses
6 years ago
#

https://prnt.sc/seo15l

curses
6 years ago
#

Encore une fois, j'ai importé le fichier, mais malheureusement cela ne fonctionne pas, j'ajoute une capture d'écran de l'erreur. salutations link .... https://prnt.sc/seo15l

curses
7 years ago
#

quan t'on ajoute, le code .... PRT error in code

Nicolas
7 years ago
#

Tu as peut être fait un mauvais copier/coller. Le mieux étant de télécharger le code de l'indicateur et de l'importer dans la plateforme.

mcha
9 years ago
#

bonsoir j'ai tenté de déterminer le point pivot trimestriel en mettant quarter mais cela n'est pas reconnu. Y aurait-il une solution mais étant mauvais en codage j'ai bien cherché dans le forum, je n'ai rien trouvé pour cette période de trimestre. par avance merci de votre aide.

Nicolas
9 years ago
#

Cela a déjà été codé quelque part sur le forum, en anglais, il faut chercher 'quarterly' avec l'outil de recherche du site.

mcha
9 years ago
#

dans cet article par exemple "Monthly High Low Close Indicator". N'avait pas cherché au bon endroit et avait pensé trop simple avec quarter. merci

kuroobi
10 years ago
#

Merci beaucoup pour ce code .

C'est parfait pour prendre position et pour les take profit sur le long terme .

ProRealCode ProRealCode
Loading...