High/low/open prices for specific timeframes
Forums › ProRealTime English forum › ProBuilder support › High/low/open prices for specific timeframes
- This topic has 16 replies, 2 voices, and was last updated 7 years ago by gabri.
-
-
04/20/2017 at 7:32 PM #3280004/22/2017 at 8:07 PM #3298404/23/2017 at 3:39 PM #3306904/23/2017 at 3:45 PM #3307004/23/2017 at 6:13 PM #3307904/23/2017 at 6:23 PM #3308204/23/2017 at 7:07 PM #33083
Hi, gabri,
For example: the average value as diffence between open price and highest price (highest price – open price) between 080000 and 090000 (DL on the picture) for last 22 days and the avergae value as diffence between open price and lowest price (open price – lowest price) between 080000 and 090000 (DS on the picture) for last 22 days.
04/24/2017 at 8:03 AM #33117Roman,
if for you a Wilder Average is enough I can offer you this solution. If you need a standard average I need to come up with something more complex.
12345678910111213141516171819202122232425262728//Timeframe used has to be less than 1 hr//definition open of the dayinitialopen=dopen(0)//computation max and min in the first hour - super e inferif (time>=090000) and (time<=100000) thensuper=dopen(0)infer=dopen(0)if high>super thensuper=highendifif low<infer theninfer=lowendifelsesuper=superinfer=inferendif//computation Wilder average of (super-initialopen) and (initialopen-infer)period=22once sommadeltasuper=0once sommadeltainfer=0if time=100000 thensommadeltasuper=((super-initialopen)+(sommadeltasuper*(period-1)))/periodsommadeltainfer=((super-initialopen)+(sommadeltasuper*(period-1)))/periodendifreturn sommadeltasuper,sommadeltainfer04/24/2017 at 11:52 AM #33168Roman,
this is the code with simple moving average. Let me know how it work.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748//computation timeframe in use and intraday number of bars - intrabif intradaybarindex=0 thentime1=opentimeendifif intradaybarindex=1 thentime2=opentimeendifdeltatime=(time2-time1)/100intrab=round(522/deltatime)//computation max and min in the first hour - super e inferif (time>=090000) and (time<=100000) thensuper=dopen(0)infer=dopen(0)if high>super thensuper=highendifif low<infer theninfer=lowendifelsesuper=superinfer=inferendif//computation average (super-initialopen) and (initialopen-infer)period=20if time=100000 thensommadeltasuper=0sommadeltainfer=0for i=0 to (period) doj=1+round(i*intrab)sommadeltasuper=sommadeltasuper+abs(super[j]-dopen(i))sommadeltainfer=sommadeltainfer+abs(dopen(i)-infer[j])nextdeltasuper=sommadeltasuper/perioddeltainfer=sommadeltainfer/periodendifif time>100000 thenup=super+deltasuperdown=infer-deltainferelseup=updown=downendifreturn up,down1 user thanked author for this post.
04/24/2017 at 11:53 AM #3316904/24/2017 at 1:13 PM #3318304/25/2017 at 7:10 AM #3327404/27/2017 at 7:24 PM #33738Hallo, gabri,
you can see attached results. I used your Wilder’s Average. The idea was that in the premarket (08.00 – 09:00) the price often returns to the open price at 08:00. I don’t think the code can be improved, so I reject the idea.
Thank you
Roman
04/27/2017 at 7:32 PM #3374504/27/2017 at 7:35 PM #33747 -
AuthorPosts
Find exclusive trading pro-tools on