Repeat indicator on time intervals
- This topic has 1 reply, 2 voices, and was last updated 2 years ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
Similar topics:
Forums › ProRealTime English forum › ProBuilder support › Repeat indicator on time intervals
Hi there,
I allow myself to request your help to create a repetition indicator but I do not know if it is possible
Today I do it by hand
1 – Calculate the amplitude of points over an hourly interval of the previous day (for example, the previous day, between 2 p.m. and 3 p.m. the max is 11,900 and the min is 11,700, the amplitude of points is 200 that I will call A later)
2 – On the current day, from a defined time (for example 2 p.m.) identify the low point (called MIN) and draw lines from this low point: MIN+1/2A, MIN+A, MIN+ 1.5A, MIN+2A. When a new low point appears, the lines are recalculated
3 – On the current day, from a defined time (for example 2 p.m.) identify the high point (called MAX) and draw lines from this high point: MAX-1/2A, MAX-A, MAX- 1.5A, MAX-2A. When a new low point appears, the lines are recalculated
4 – Optional: be able to add information on the lines drawn: point value, point difference with the current price, percentage difference with the current price,
I think this indicator could be useful for everyone. Our graphics are eternal repetitions
Thanks in advance
There you go (the 4 MAX and MIN lines are differently coloured, but since they overlap in most cases, the colours will be mostly the same):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
// Repeat Indicator // // https://www.prorealcode.com/topic/repeat-indicator-on-time-intervals/ // DEFPARAM DrawOnLastBarOnly = True //YesterdayFrom = 140000 //YesterdayTo = 150000 //TodayTime = 140000 //Multiplier1 = 0.5 //Multiplier2 = 1.0 //Multiplier3 = 1.5 //Multiplier4 = 2.0 //FutureBARS = 5 // ONCE HH = 0 ONCE LL = 0 ONCE prevHH = 0 ONCE prevLL = 0 ONCE TodayHH = 0 ONCE TodayLL = 0 ONCE TodayBarHH = 0 ONCE TodayBarLL = 0 ONCE Amplitude = 0 // IF (OpenTime >= YesterdayFrom) AND (OpenTime <= YesterdayTo) THEN IF (OpenTime = YesterdayFrom) OR ((OpenTime > YesterdayFrom) AND (OpenTime[1] < YesterdayFrom)) THEN Amplitude = HH - LL Ampli1 = Amplitude * Multiplier1 Ampli2 = Amplitude * Multiplier2 Ampli3 = Amplitude * Multiplier3 Ampli4 = Amplitude * Multiplier4 prevHH = HH prevLL = LL HH = high LL = low ENDIF HH = max(HH,high) LL = min(LL,low) ENDIF // IF (OpenTime >= TodayTime) THEN IF (OpenTime = TodayTime) OR ((OpenTime > TodayTime) AND (OpenTime[1] < TodayTime)) THEN TodayHH = high TodayLL = low ENDIF TodayHH = max(TodayHH,high) TodayLL = min(TodayLL,low) IF TodayHH <> TodayHH[1] THEN TodayBarHH = BarIndex ENDIF IF TodayLL <> TodayLL[1] THEN TodayBarLL = BarIndex ENDIF Max1 = TodayHH - Ampli1 Max2 = TodayHH - Ampli2 Max3 = TodayHH - Ampli3 Max4 = TodayHH - Ampli4 // Min1 = TodayLL + Ampli1 Min2 = TodayLL + Ampli2 Min3 = TodayLL + Ampli3 Min4 = TodayLL + Ampli4 ENDIF DrawSegment(TodayBarHH,TodayHH,BarIndex + FutureBARS,TodayHH) coloured("SkyBlue") style(Line,4) //SkyBlue (Main HIGH line) DrawSegment(TodayBarLL,TodayLL,BarIndex + FutureBARS,TodayLL) coloured("SkyBlue") style(Line,4) //SkyBlue (Main LOW line) // DrawSegment(TodayBarHH,Min1,BarIndex + FutureBARS,Min1) coloured("Tomato") style(DottedLine,2) //Tomato DrawSegment(TodayBarHH,Min2,BarIndex + FutureBARS,Min2) coloured("OrangeRed") style(DottedLine,2) //OrangeRed DrawSegment(TodayBarHH,Min3,BarIndex + FutureBARS,Min3) coloured("Red") style(DottedLine,2) //Red DrawSegment(TodayBarHH,Min4,BarIndex + FutureBARS,Min4) coloured("Crimson") style(DottedLine,2) //Crimson DrawSegment(TodayBarLL,Max1,BarIndex + FutureBARS,Max1) coloured("DeepSkyBlue") style(DottedLine,2) //DeepSkyBlue DrawSegment(TodayBarLL,Max2,BarIndex + FutureBARS,Max2) coloured("LightBlue" ) style(DottedLine,2) //LightBlue DrawSegment(TodayBarLL,Max3,BarIndex + FutureBARS,Max3) coloured("DodgeBlue") style(DottedLine,2) //DodgeBlue DrawSegment(TodayBarLL,Max4,BarIndex + FutureBARS,Max4) coloured("Blue") style(DottedLine,2) //Blue RETURN |
I added a setting named FutureBARS, it’s the number of bars you want to plot lines beyond the current bar (a negative valuie will plot in the past). If you don’t need it, set it to 0.
As to the optional data you want to be displayed, will you please attach a picture or a drawing of what you want.
Find exclusive trading pro-tools on