Drawrectangle entre plus haut et plus bas de l’overnight
Forums › ProRealTime forum Français › Support ProOrder › Drawrectangle entre plus haut et plus bas de l’overnight
- This topic has 5 replies, 2 voices, and was last updated 1 year ago by
Nicolas.
-
-
05/10/2023 at 6:19 PM #214479
Bonjour Nicolas, bonjour à tous !
Je me résigne à venir poster sur le forum ne trouvant pas la réponse.
Je souhaite simplement afficher des rectangles entre 18h et 8h du matin identifiant les plus haut et plus bas.
Afin de comparer les journées et à des fins de réuitlisations, je souhaite que les valeurs x1,x2,y1,y2 puissent êtres stockés dans un tableau avec [array].Quelqu’un aurait-il une esquisse de code ou de piste sérieuse ?
Par avance, merci.
05/11/2023 at 8:20 AM #214493Le code ci-dessous va tracer ses zones à cheval entre 2 journées sur l’ensemble de l’historique:
1234567891011121314151617181920212223242526272829defparam drawonlastbaronly=truestart = time>=180000 and time<235900end = time<080000 and time>=000000if time=180000 theni=i+1$x1[i]=barindex$y1[i]=low$y2[i]=highhh=highll=lowendifif start or end then$x2[i]=barindexll=min(ll,low)hh=max(hh,high)$y1[i]=ll$y2[i]=hhendifif islastbarupdate and isset($x1[2]) thenfor y = 1 to i dodrawrectangle($x1[y],$y1[y],$x2[y],$y2[y]) //plot in historynextendifreturn //hh,ll1 user thanked author for this post.
05/11/2023 at 9:34 AM #21450305/12/2023 at 3:21 PM #21461405/12/2023 at 4:29 PM #214622Petit bémol…
J’ai tenter de modifier ce code pour ne prendre que la partie entre 8h et 9h.
Cela marche bien sur l’enssemble de l’historique sauf les 3 derniers jours ou il englobe le debut à 8h à J-3 jusqu’a ce jour 9h… une idée ?Edit : le code
123456789101112131415161718192021222324252627Debut = 080000SessionKZ8 = time>=Debut and time<090000 //or (time<110000 and time>=100000)IF time = Debut theng=g+1$x7[g]=barindex$y7[g]=low$y8[g]=highBasKZ8=lowHautKZ8=highendifif SessionKZ8 then$x8[g]=barindexBasKZ8=min(BasKZ8,low)HautKZ8=max(HautKZ8,high)$y7[g]=BasKZ8$y8[g]=HautKZ8endifif islastbarupdate and isset ($x7[1]) thenfor y = 1 to g dodrawrectangle($x7[y],$y7[y],$x8[y],$y8[y])coloured(50,150,0,60) bordercolor(50,150,0)STYLE(line,2)//drawsegment($x7[y],($y7[y]+$y8[y])/2,$x8[y],($y7[y]+$y8[y])/2)coloured(50,150,0,100)STYLE(line,2)nextendif05/15/2023 at 12:05 PM #214725Ce code est spécifique à l’overnight, puisque horaire à cheval entre 2 journées, tu peux essayer celui-ci pour un horaire dans la même journée:
12345678910111213141516171819202122232425262728293031defparam drawonlastbaronly=truestart = 090000end = 091500tc = time>=start and time<endif tc and not tc[1] theni=i+1$x1[i]=barindex$y1[i]=low$y2[i]=highhh=highll=lowendifif tc then$x2[i]=barindexll=min(ll,low)hh=max(hh,high)$y1[i]=ll$y2[i]=hhendifif islastbarupdate and isset($x1[2]) thenfor y = 1 to i dodrawrectangle($x1[y],$y1[y],$x2[y],$y2[y]) //plot in historynextendifreturn //hh,ll1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on