A code about highs of last ten days
Forums › ProRealTime English forum › ProBuilder support › A code about highs of last ten days
- This topic has 17 replies, 4 voices, and was last updated 3 years ago by Vonasi.
-
-
02/10/2021 at 1:10 PM #160925
Hello, I would like an answer about this code. It is a code that considers the high of the day of the last ten days. It’ s vey simple but I do not understand why it doesn’t function
thanks a lot guys123456789101112a=DHigh(1)b=DHigh(2)c=DHigh(3)d=DHigh(4)e=DHigh(5)f=DHigh(6)g=DHigh(7)i=DHigh(8)l=DHigh(9)m=DHigh(10)return a,b,c,d,e,f,g,i,l,m02/10/2021 at 1:18 PM #160931gb967 – Welcome to the forums. Please re-read the forum rules before posting again. Your post has been moved to the correct forum and your code inserted correctly.
Post your topic in the correct forum:
_ ProRealTime Platform Support: only platform related issues.
_ ProOrder: only strategy topics.
_ ProBuilder: only indicator topics.
_ ProScreener: only screener topics
_ General Discussion: any other topics.
_ Welcome New Members: for new forum members to introduce themselves.- Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read.
02/10/2021 at 4:57 PM #160955Why do you think it’s not working?
02/10/2021 at 6:14 PM #16097102/10/2021 at 6:51 PM #16097402/10/2021 at 7:17 PM #16097602/10/2021 at 8:18 PM #160981Do not use the ‘Insert PRT Code‘ when writing text.
Thank you 🙂
No, I don’t understand what you want.
There’s no difference between 1-hour and 4-minute hour TF’s.
02/10/2021 at 9:32 PM #16099002/10/2021 at 9:45 PM #16099102/10/2021 at 10:02 PM #160994Your code should work but does not.
Try this slightly more complicated workaround:
1234567891011121314if intradaybarindex < intradaybarindex[1] thena = a + 1$dayhigh[a]=maxhighmaxhigh = lowif a >=10 thenfor b = 1 to 10$day[b] = $dayhigh[lastset($dayhigh)-b+1]nextendifendifmaxhigh = max(maxhigh,high)return $day[1] as "day1",$day[2] as "day2",$day[3] as "day3",$day[4] as "day4",$day[5] as "day5",$day[6] as "day6",$day[7] as "day7",$day[8] as "day8",$day[9] as "day9",$day[10] as "day10"02/10/2021 at 10:14 PM #160998Just for fun here is a version that draws the last ten days highs and lows.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546once $hday[1] = undefinedonce $hday[2] = undefinedonce $hday[3] = undefinedonce $hday[4] = undefinedonce $hday[5] = undefinedonce $hday[6] = undefinedonce $hday[7] = undefinedonce $hday[8] = undefinedonce $hday[9] = undefinedonce $hday[10] = undefinedonce $lday[1] = undefinedonce $lday[2] = undefinedonce $lday[3] = undefinedonce $lday[4] = undefinedonce $lday[5] = undefinedonce $lday[6] = undefinedonce $lday[7] = undefinedonce $lday[8] = undefinedonce $lday[9] = undefinedonce $lday[10] = undefinedif intradaybarindex < intradaybarindex[1] thena = a + 1$dayhigh[a]=maxhighmaxhigh = lowif a > 10 thenfor b = 1 to 10$hday[b] = $dayhigh[lastset($dayhigh)-b+1]nextendifc = c + 1$daylow[c]=maxlowmaxlow = highif c > 10 thenfor b = 1 to 10$lday[b] = $daylow[lastset($daylow)-b+1]nextendifendifmaxhigh = max(maxhigh,high)maxlow = min(maxlow,low)return $hday[1] coloured(0,128,0) as "day1",$hday[2] coloured(0,128,0) as "day2",$hday[3] coloured(0,128,0) as "day3",$hday[4] coloured(0,128,0) as "day4",$hday[5] coloured(0,128,0) as "day5",$hday[6] coloured(0,128,0) as "day6",$hday[7] coloured(0,128,0) as "day7",$hday[8] coloured(0,128,0) as "day8",$hday[9] coloured(0,128,0) as "day9",$hday[10] coloured(0,128,0) as "day10", $lday[1] coloured(128,0,0) as "day1",$lday[2] coloured(128,0,0) as "day2",$lday[3] coloured(128,0,0) as "day3",$lday[4] coloured(128,0,0) as "day4",$lday[5] coloured(128,0,0) as "day5",$lday[6] coloured(128,0,0) as "day6",$lday[7] coloured(128,0,0) as "day7",$lday[8] coloured(128,0,0) as "day8",$lday[9] coloured(128,0,0) as "day9",$lday[10] coloured(128,0,0) as "day10"02/11/2021 at 12:11 AM #161001I still can’t understand why all that extra coding when the first code posted works like a charm on whatever TF.
02/11/2021 at 9:21 AM #161025Because it doesn’t work like a charm. Did you see my image in this post?
https://www.prorealcode.com/topic/a-code-about-highs-of-last-ten-days/#post-160991
The simple code is definitely not drawing lines on the daily highs.
02/11/2021 at 9:47 AM #161027This is what I would like to see the extension of the highs lines such as supports and resistances in the 4-minute tf of the current day.
Instead the lines are not reported to me on the current day. I do not see them but i see only those of the past days.
02/11/2021 at 10:02 AM #161034In my pic it does work as intended!
Unless you want to plot them into the future, but it’s not what this post was all about!
-
AuthorPosts
Find exclusive trading pro-tools on