Plot Open Of Day
Forums › ProRealTime English forum › ProBuilder support › Plot Open Of Day
- This topic has 6 replies, 2 voices, and was last updated 1 year ago by robertogozzi.
-
-
02/21/2023 at 5:28 PM #210051
Hello,
I have borrowed some code from another post (https://www.prorealcode.com/topic/high-low-close-yesterday-premarket/)
I use only the part to plot yesterdays high, low and close and have added text to describe the levels.My question is, can someone add the code to plot the of the open of the current day? I want the segment to look exactly like the others, with the segment ending at the current bar.
Help is very appreciated.
1234567891011121314151617181920212223242526272829303132DEFPARAM DrawOnLastBarOnly = trueONCE PrevHH = highONCE PrevLL = lowONCE PrecCL = closeONCE HH = highONCE LL = lowONCE CL = closeIf OpenTime = 000000 OR (OpenTime >= 000000 AND OpenTime < OpenTime[1])THENPrevHH = HHPrevLL = LLPrevCL = CL//close[1]LL = lowHH = highCL = closeBarID = BarIndexENDIFIF (OpenTime >= 093000) AND (OpenTime <= 161500) THENHH = max(HH,high)LL = min(LL,low)CL = closeENDIFDrawText("HoY",barindex-2,PrevHH+1.5*pipsize,SansSerif,Bold) coloured(0,128,0,75)DrawText("LoY",barindex-2,PrevLL+1.5*pipsize,SansSerif,Bold) coloured(0,0,255,75)DrawText("CoY",barindex-2,PrevCL+1.5*pipsize,SansSerif,Bold) coloured(255,0,0,75)//DrawSegment(BarID,PrevHH,BarIndex,PrevHH) coloured(0,128,0,75) style(dottedline) //GreenDrawSegment(BarID,PrevLL,BarIndex,PrevLL) coloured(0,0,255,75) style(dottedline) //BlueDrawSegment(BarID,PrevCL,BarIndex,PrevCL) coloured(255,0,0,75) style(dottedline) //Red////DrawSegment(pmBarID,pmHH,BarIndex,pmHH) coloured(0,178,238,255) style(dottedline,3) //Cyan//DrawSegment(pmBarID,pmLL,BarIndex,pmLL) coloured(0,178,238,255) style(dottedline,3) //CyanRETURN02/21/2023 at 5:42 PM #210067As a last request, this is only if possible and straightforward to do: plotting the high, low and open of the last week like the segments in the screenshot.
Thank you.02/21/2023 at 5:54 PM #210073As a last request, this is only if possible and straightforward to do: plotting the high, low and open of the last week like the segments in the screenshot.
Thank you.
Sorry, I meant to say high and low of last week and open of the current week.
02/21/2023 at 6:02 PM #210080This is the one with the addition of today’s OPEN:
1234567891011121314151617181920212223242526272829303132333435DEFPARAM DrawOnLastBarOnly = trueONCE PrevHH = highONCE PrevLL = lowONCE PrecCL = closeONCE HH = highONCE LL = lowONCE CL = closeIf OpenTime = 000000 OR (OpenTime >= 000000 AND OpenTime < OpenTime[1])THENPrevHH = HHPrevLL = LLPrevCL = CL//close[1]LL = lowHH = highCL = closeOP = openBarID = BarIndexENDIFIF (OpenTime >= 093000) AND (OpenTime <= 161500) THENHH = max(HH,high)LL = min(LL,low)CL = closeENDIFDrawText("Open",barindex-2,OP+1.5*pipsize, SansSerif,Bold) coloured("Fuchsia")DrawText("HoY", barindex-2,PrevHH+1.5*pipsize,SansSerif,Bold) coloured(0,128,0,75)DrawText("LoY", barindex-2,PrevLL+1.5*pipsize,SansSerif,Bold) coloured(0,0,255,75)DrawText("CoY", barindex-2,PrevCL+1.5*pipsize,SansSerif,Bold) coloured(255,0,0,75)//DrawSegment(BarID,OP, BarIndex,OP) coloured("Fuchsia") style(dottedline) //FuchsiaDrawSegment(BarID,PrevHH,BarIndex,PrevHH) coloured(0,128,0,75) style(dottedline) //GreenDrawSegment(BarID,PrevLL,BarIndex,PrevLL) coloured(0,0,255,75) style(dottedline) //BlueDrawSegment(BarID,PrevCL,BarIndex,PrevCL) coloured(255,0,0,75) style(dottedline) //Red////DrawSegment(pmBarID,pmHH,BarIndex,pmHH) coloured(0,178,238,255) style(dottedline,3) //Cyan//DrawSegment(pmBarID,pmLL,BarIndex,pmLL) coloured(0,178,238,255) style(dottedline,3) //CyanRETURN02/21/2023 at 6:06 PM #210083This is the one with the weekly data, just add both on your chart:
123456789101112131415161718192021222324DEFPARAM DrawOnLastBarOnly = trueONCE PrevHH = highONCE PrevLL = lowONCE HH = highONCE LL = lowIf OpenDayOfWeek < OpenDayOfweek[1] THENPrevHH = HHPrevLL = LLLL = lowHH = highOP = openBarID = BarIndexENDIFHH = max(HH,high)LL = min(LL,low)CL = closeDrawText("Open",barindex-2,OP+1.5*pipsize, SansSerif,Bold) coloured("Fuchsia")DrawText("HoY", barindex-2,PrevHH+1.5*pipsize,SansSerif,Bold) coloured(0,128,0,75)DrawText("LoY", barindex-2,PrevLL+1.5*pipsize,SansSerif,Bold) coloured(0,0,255,75)//DrawSegment(BarID,OP, BarIndex,OP) coloured("Fuchsia") style(dottedline) //FuchsiaDrawSegment(BarID,PrevHH,BarIndex,PrevHH) coloured(0,128,0,75) style(dottedline) //GreenDrawSegment(BarID,PrevLL,BarIndex,PrevLL) coloured(0,0,255,75) style(dottedline) //BlueRETURN1 user thanked author for this post.
02/21/2023 at 7:35 PM #210092Thank you very much @robertogozzi
Is it possible to make the weekly line segments drawn at the current day only? Just like the other lines.
See screenshot02/23/2023 at 3:31 PM #210285There you go:
12345678910111213141516171819202122232425262728DEFPARAM DrawOnLastBarOnly = trueONCE PrevHH = highONCE PrevLL = lowONCE HH = highONCE LL = lowIf OpenDayOfWeek < OpenDayOfweek[1] THENPrevHH = HHPrevLL = LLLL = lowHH = highOP = openBarID = BarIndexELSEIf OpenTime = 000000 OR (OpenTime >= 000000 AND OpenTime < OpenTime[1])THENBarID = BarIndexENDIFENDIFHH = max(HH,high)LL = min(LL,low)CL = closeDrawText("Open",barindex-2,OP+1.5*pipsize, SansSerif,Bold) coloured("Fuchsia")DrawText("HoY", barindex-2,PrevHH+1.5*pipsize,SansSerif,Bold) coloured(0,128,0,75)DrawText("LoY", barindex-2,PrevLL+1.5*pipsize,SansSerif,Bold) coloured(0,0,255,75)//DrawSegment(BarID,OP, BarIndex,OP) coloured("Fuchsia") style(dottedline) //FuchsiaDrawSegment(BarID,PrevHH,BarIndex,PrevHH) coloured(0,128,0,75) style(dottedline) //GreenDrawSegment(BarID,PrevLL,BarIndex,PrevLL) coloured(0,0,255,75) style(dottedline) //BlueRETURN1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on