Tracé une zone a une distance du PP 1H
Forums › ProRealTime forum Français › Support ProBuilder › Tracé une zone a une distance du PP 1H
- This topic has 4 replies, 2 voices, and was last updated 2 years ago by maxlys.
-
-
12/22/2021 at 1:51 PM #183746
Bonjour A tous,
j’utilise le code ci dessous pour tracer les PP 1H.
j’aimerais que sur l’heure en cours, il soit tracé un rectangle se trouvant a 15/20 points au dessus et en dessous du PP1H ( voir fichier joint pour exemple au dessus du PP)
Comment peut on coder cela ?
Merci
12345678910111213141516171819202122232425262728293031323334353637383940Pivot = 1IF Openhour <> openhour [ 1 ] THEN//MyEnd = (Opendate * 1000000) + (OpenHour * 10000) + (5900) //YYYYMMDDHHMMSSMyPP = PPStartBar = BarIndex//myLastHigh = myHighmyLastLow = myLowmyLastClose = Close [ 1 ]myHigh = HighmyLow = Lowmyopen = openELSEmyHigh = Max(myHigh, High)myLow = Min(myLow, Low)ENDIF// Formule en fonction de la valeur du paramètre PivotIF Pivot = 2 THEN// Point pivot : PP= (Hveille + Bveille + Cveille + Ojour) / 4PP = (myLastHigh + myLastLow + myLastClose + myopen) / 4ELSIF Pivot = 3 THEN// Point pivot : PP= (Hveille + Bveille + Ojour) / 3PP = (myLastHigh + myLastLow + myopen) / 3ELSE// Point pivot : PP= (Hveille + Bveille + Cveille) / 3PP = (myLastHigh + myLastLow + myLastClose) / 3ENDIFRes1 = 2 * PP - myLastLowRes2 = PP + myLastHigh - myLastLowRes3 = myLastHigh + 2 * (PP - myLastLow)Sup1 = 2 * PP - myLastHighSup2 = PP - myLastHigh + myLastLowSup3 = myLastLow - 2 * (myLastHigh - PP)DrawSegment(StartBar,PP,DateToBarIndex(MyEnd),PP) coloured(0,255,0,255) style(Line, 1)Return pp12/22/2021 at 7:48 PM #183776J’ai essayé d’avancer, j’ai fait plus simple pour le tracé du PP 1H
Ensuite plutôt qu’un rectangle 4 segments situés a 15 pts et 20 pts en dessus et en dessous du PP1H, segment de la longueur seulement du PP1H
En fait j’aierais déclaer le PP1H a 15 et 20 pts en dessous et au dessus du PP1H
J’ai essayé avec DRAWHLINE, mais ici les lignes sont tracés sur toute la longeur et sur tous les PP 1H, cela ne convient donc pas
Dans le code ci dessous que pourrais je mettre comme instruction entre les parenthèses de DRAWSEGMENT ?
Ou bien un code qui me décale le PP1H de 15 et 20 pts
Merci pour votre aide
1234567891011timeframe(1 hour)//point pivot en UT 1 heurePivotH1 = (High[1] + Low[1] + Close[1])/3//DrawSegment(15 points au dessus du PP) coloured(0,255,0,255) style(dottedline, 1)//DrawSegment(20 points au dessus du PP) coloured(0,255,0,255) style(dottedline, 1)//DrawSegment(15 points en dessous du PP) coloured(0,255,0,255) style(dottedline, 1)//DrawSegment(20 points en dessus du PP) coloured(0,255,0,255) style(dottedline, 1)DrawHLINE(PivotH1+15*pipsize) coloured(0,255,0,255) style(dottedline, 1)Return PivotH112/22/2021 at 8:03 PM #183778J’ai aussi essayé avec ce code mais là plus rien ne s’affiche :
123456789timeframe(1 hour)//point pivot en UT 1 heurePivotH1 = (High[1] + Low[1] + Close[1])/3P15SUP = PivotH1+15*pipsizeP20SUP = PivotH1+20*pipsizeP15INF = PivotH1-15*pipsizeP20INF = PivotH1-20*pipsizeReturn PivotH1 and P15SUP and P20SUP and P15INF and P20INF12/23/2021 at 11:32 AM #183804Bonjour,
Basé sur post de départ, code pour rectangles dessus/dessous pour heure en cours. On peut enlever la première ligne en drawonlastbaronly si on veut tous les rectangles de l’historique au lieu de juste l’heure en cours
123456789101112131415161718192021222324252627282930313233343536373839404142434445defparam DRAWONLASTBARONLY=truePivot = 1IF Openhour <> openhour [ 1 ] THEN//MyEnd = (Opendate * 1000000) + (OpenHour * 10000) + (5900) //YYYYMMDDHHMMSSMyPP = PPStartBar = BarIndex//myLastHigh = myHighmyLastLow = myLowmyLastClose = Close [ 1 ]myHigh = HighmyLow = Lowmyopen = openELSEmyHigh = Max(myHigh, High)myLow = Min(myLow, Low)ENDIF// Formule en fonction de la valeur du paramètre PivotIF Pivot = 2 THEN// Point pivot : PP= (Hveille + Bveille + Cveille + Ojour) / 4PP = (myLastHigh + myLastLow + myLastClose + myopen) / 4ELSIF Pivot = 3 THEN// Point pivot : PP= (Hveille + Bveille + Ojour) / 3PP = (myLastHigh + myLastLow + myopen) / 3ELSE// Point pivot : PP= (Hveille + Bveille + Cveille) / 3PP = (myLastHigh + myLastLow + myLastClose) / 3ENDIFRes1 = 2 * PP - myLastLowRes2 = PP + myLastHigh - myLastLowRes3 = myLastHigh + 2 * (PP - myLastLow)Sup1 = 2 * PP - myLastHighSup2 = PP - myLastHigh + myLastLowSup3 = myLastLow - 2 * (myLastHigh - PP)DrawRectangle(StartBar,PP+15*pipsize,DateToBarIndex(MyEnd),PP+20*pipsize) coloured(0,255,0)DrawRectangle(StartBar,PP-15*pipsize,DateToBarIndex(MyEnd),PP-20*pipsize) coloured(0,255,0)Return pp1 user thanked author for this post.
12/23/2021 at 11:40 AM #183805 -
AuthorPosts
Find exclusive trading pro-tools on