Plot Yesterday’s High, Low and Close
Forums › ProRealTime English forum › ProBuilder support › Plot Yesterday’s High, Low and Close
- This topic has 21 replies, 5 voices, and was last updated 7 years ago by AVT.
-
-
08/02/2017 at 11:47 AM #42311
Hi mmichael
The indicator found here: https://www.prorealcode.com/prorealtime-indicators/initial-balance-indicator-v2-0/ bought to my attention by Toto le Heros should do what you want.
1 user thanked author for this post.
08/02/2017 at 11:55 AM #42312Hi AVT, if you are following this thread, just want to thank you for the sterling coding job you did. The indicator has worked perfectly so far this week so I assume it must be bug free – unless affected by public holidays etc. I would like to ask you another favour if you don’t mind and have some spare moments. It involves checking some code from one of my earlier posts and a modification to some code- which I have not been able to do myself. If you are game, please let me know here, and I will bring you up to speed with the issue(s). Thank you.
08/03/2017 at 1:58 PM #42405@denmar Following, but not checking my mail account, so I might be a day late sometimes.
I did also follow the line plotting and noticed some lines not constantly updated with ongoing minutes. There’s a peace of code in it checking what timeframe we are in which is neither my work nor do I understand it (shame on me) and when debugging this code, it sometimes showed wrong results (like on a m3 chart it sometimes said we have m6 or even m24, which is why I don’t trust that code – or the code is correct and sometimes just the calculation engine too busy or god know what), so it’s still in “working sheet” state – there’s by the way still a DRAWTEXT line in it which should be deleted.
08/03/2017 at 7:07 PM #42443I made a detailed example for you, so you can examine how it is done. Those 2 “breakout range lines” will accompany you through the whole market session and it will do that for every day (very handy if one wants to compare them with previous days). Code:
Plot Breakout Box Lines1234567891011121314151617181920212223242526272829303132333435363738394041424344// === paint breakout box lines during the market time// === PRT 10.3 AVT// --- variables exern//StartTime=080000 // when do we start to find our box range//StopTime=090000 // when do we stop to find our box range// --- usually we only need those lines printed as long as the market is open// painting range breakout lines makes only sense from that moment on// when the range is complete, means at 9:00 we know the 8-9 range//PrintTimeStart=090001 // when do we want to start printing our lines//PrintTimeStop=163000 // when do we want to stop printing our lines//ShowLines=1 // quick switch on=1 off=0 of lines (practical if too much in the chart)// --- variables internCalcTime=(time>=StartTime AND time<=StopTime) // from 8:00 till 9:00PrintTime=(time>=PrintTimeStart AND time<=PrintTimeStop) // from 9:01 till 16:30// --- calcIF IntradayBarIndex = 0 THEN // if the bar for the current day is the first oneRangeHighestPrice = 0 // set highest to 0, -> the first price we calc will be moreRangeLowestPrice = close * 1000 // set lowest very high -> the first price we calc will be lessENDIFIF CalcTime THEN // if we are between 8-9RangeHighestPrice = max(RangeHighestPrice,high) // take maximum of what we know already and high of barRangeLowestPrice = min(RangeLowestPrice,low) // take minimum of what we know already and low of barRangeHigh = RangeHighestPrice // fix the highest we found in an extra variableRangeLow = RangeLowestPrice // same for lowest// this is repeated for each new bar as long as we are in the calc time 8-9// if time is over we have our final valuesENDIF// --- calc end// --- print// we begin printing a minute after we know the complete rangeIF PrintTime THEN // we are within the printing time 9:01-16:30IF ShowLines THEN // we are allow to show the linesDRAWSEGMENT(barindex-1,RangeHigh,barindex,RangeHigh) coloured(255,0,255) // upper Line magenta for nowDRAWSEGMENT(barindex-1,RangeLow,barindex,RangeLow) coloured(255,0,255) // lower LineENDIFENDIF// --- print endRETURN// === End of progI also attach the itf so you can see how/where we set external variables.
Hope this helps you.
08/04/2017 at 2:17 AM #42455Hello,
I would like to jump in your interesting topic.
I share with you a small enhancement. If (like me) you need these lines only for indexes (CAC, DAX, DJI, …) as these are not relevant for other assets, forex etc…, I would suggest to change line 38 as follows –> It works for me.
1IF PrintTime and close > 5000 THENI have a small question, is it possible to add a condition (or choice checkbox) to plot the lines only for the current day?
08/04/2017 at 4:42 AM #4245608/04/2017 at 6:47 PM #42485In this code snip you suggested
1IF PrintTime and close > 5000 THENyou say: print only if we are in the allowed time and the closing price is above 5000.
But printing should not have anything to do with a price level. Just have a look here http://www.finanzen.net/indizes/Westeuropa – there are a lot of European indices which are well below 5000 and you would exclude all those from ever being printed.
If you have this printing tool in a forex chart for example, there’s the check box ShowLines – and if you switch that off no line will be shown and that’s it.
As for the 2nd matter of drawing just at the current day, this snip
1IF printTime and ShowLines and date = today THENdoes not work here at all, because all those Date,Today,Yesterday,OpenDate return a “wrong format” (due to https://www.prorealcode.com/documentation/category/dateandtime/ those should: Report …. in YYYYMMDD format, but actually they simply return 20,2M which is unusable). My solution would be to compare the day part of a date (DD). But at the moment a day change at my PRT takes place around 17:45 and 18:15 – really don’t know what the cause for that is, so for now I can’t test anything, sorry for that. I have to find out what the heck is the orign of such time differences.
-
AuthorPosts
Find exclusive trading pro-tools on