No of times Price closed inside Initial balance
Forums › ProRealTime English forum › ProBuilder support › No of times Price closed inside Initial balance
- This topic has 7 replies, 3 voices, and was last updated 3 weeks ago by robertogozzi.
Viewing 8 posts - 1 through 8 (of 8 total)
-
-
11/22/2024 at 12:34 PM #24064811/22/2024 at 12:56 PM #24065111/22/2024 at 5:12 PM #24066511/25/2024 at 7:32 AM #240709
Say the price from 080000 to 090000, today, sits in the range 19000 – 19100, do you want to know how many times, in the past days, months, years, that price range sat in that same time interval?
1 user thanked author for this post.
11/25/2024 at 9:56 AM #24071011/25/2024 at 5:01 PM #240722Hi, I don't know if this is useful for you. The indicator shows the number of candles in which the price has moved between 2 levels and at certain times.
1234567891011121314starttime=080000endtime=090000minlevel=20000maxlevel=21000if opentime>=starttime and opentime<=endtime thenn=n+1if close>=minlevel and close<=maxlevel thenm=m+1endifendifreturn m1 user thanked author for this post.
11/25/2024 at 7:14 PM #240734Try this one:
12345678910111213141516171819202122232425262728293031323334353637383940414243DEFPARAM DrawOnLastBarOnly = trueONCE FromDate = 20240901 //from Sep. 1st, 2024ONCE ToDate = 20241125 //to Nov. 25th, 2024//ONCE FromTime = 080000 //from 8am (candle opening at 8am)ONCE ToTime = 090000 //to 9am (candle opening at 9am)//ONCE Tally = 0//IF (OpenTime >= FromTime) AND (OpenTime <= ToTime) THENIF (OpenTime = FromTime) OR ((OpenTime > FromTime) AND (OpenTime[1] < FromTime)) OR ((OpenTime > FromTime) AND (IntraDayBarIndex = 0)) THENHH = HighLL = lowFlag = 0ENDIFHH = max(HH,high)LL = min(LL,low)ENDIFIF Flag = 0 AND (OpenTime >= ToTime) THENFlag = 1Tally = 0FOR i = (BarIndex - 1) DownTo 0IF (OpenDate[i] >= FromDate) AND (OpenDate[i] <= ToDate) THENIF (OpenTime[i] >= FromTime) AND (OpenTime[i] <= ToTime) THENIF (OpenTime[i] = FromTime) OR ((OpenTime[i] > FromTime) AND (OpenTime[i + 1] < FromTime)) OR ((OpenTime[i] > FromTime) AND (IntraDayBarIndex[i] = 0)) THENHHx = High[i]LLx = low[i]Flagx = 0ENDIFHHx = max(HHx,high[i])LLx = min(LLx,low[i])ENDIFIF Flagx = 0 AND (OpenTime[i] >= ToTime) THENFlagx = 1IF (HHx <= HH) AND (LLx >= LL) THENTally = Tally + 1ENDIFENDIFENDIFNEXTENDIFDrawText("#Tally# occurrences",BarIndex+10,high+range,Dialog,Bold,10) coloured("Green")RETURNYou can choose the DATE range (a few days, up to several years) and the TIME range.
11/25/2024 at 7:18 PM #240736I am attaching the ITF file.
-
AuthorPosts
Viewing 8 posts - 1 through 8 (of 8 total)
Find exclusive trading pro-tools on
Similar topics: