DRAWHLINE on daily and display on lower timeframes?
Forums › ProRealTime English forum › ProBuilder support › DRAWHLINE on daily and display on lower timeframes?
- This topic has 7 replies, 3 voices, and was last updated 8 months ago by druby.
-
-
07/09/2019 at 12:33 PM #102262
Hi
I suspect it’s not possible but I thought I’d check.
If you have an indicator that uses DRAWHLINE and you add it to a daily chart, is it possible to automatically display the lines drawn on lower time frames automatically?
Many thanks
Rob
07/09/2019 at 4:25 PM #10228203/23/2024 at 1:42 PM #23031903/23/2024 at 3:51 PM #230325No, it’s still not doable.
03/23/2024 at 11:36 PM #23033903/24/2024 at 1:34 PM #230351Hi…
Depending on complexity of what your trying to do, the following could be an alternate option is some cases.
Basically, add a custom indicator, call it ‘MAIN’, that only contains a ‘CALL’ to another custom indicator let’s say ‘DATA’.
Add ‘MAIN’ to all desired charts.
Now the code in ‘DATA’ will run in all charts (price or stand alone) that contain ‘MAIN’.
Therefore the code in ‘DATA’ runs on all MAIN’s and if you modify ‘DATA’ and update it via the ‘ADD to indicator’ button, the changes are replicated onto all the charts. On the next tick event I think.
Since, number of bars,barindex,intradaybarindex values are going to be different on different timeframes, using the x an y scale value of time and price, which appear the same on all charts, allows certain drawn objects to appear on all charts.
Below are some simple examples of what could be achieved.
Things to note, IMO, are:
PRT appears to be an EVENT driven system, and the events are ‘ticks’
For a bar to exist it needs a ‘tick’
Code runs at the end of each bar.
NO tick/bar, no bar, no run code, no update.
regards druby
DATA
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960// 'CALL' this file from multiple charts and// replicate objects over all the charts from this file// object related to the 'x' and 'y' scale's of the chart// time, price.if islastbarupdate then // only draw objects on last bar//------------------------------------------------- V Linedt = 20240322// options -> YYYYMMDD//yesterday//todaytm = 123500 // hhmmssx1 = (dt * 1000000) + tmdrawVline(datetoBarindex(x1)) coloured("violet",150)style(dottedline,1)//------------------------------------------------- line segmentx1 = 20240319000000y1 = 60.6x2 = 20240323140000y2 = 73.1drawsegment(datetobarindex(x1),y1,datetobarindex(x2),y2)coloured("pink",150)x1 = 20240319080000y1 = 56x2 = 20240324163000y2 = 70drawsegment(datetobarindex(x1),y1,datetobarindex(x2),y2)coloured("pink",150)//------------------------------------------------- H Linelevel = 64drawHline(level) coloured("violet",150)style(dottedline,1)//------------------------------------------------- anchored textdrawtext("Hello World!",0,0)anchor(middle,xshift,yshift)//------------------------------------------------- rectangle// YYYYMMDDhhmmssx1 = 20240323080000y1 = 60x2 = 20240323163000y2 = 65drawrectangle(datetobarindex(x1),y1,datetobarindex(x2),y2)coloured("aqua",55)bordercolor("aqua",255)//------------------------------------------------- arrowdrawArrowUp(datetobarindex(x1),66 )coloured("lime")endif // islastbarupdate//------------------------------------------------- backgroundcolor// trade sessionif opentime < 80000 or opentime > 163000 thenif opendayofweek < 5 thenbackgroundcolor("grey",20)endifendifreturnMAIN
12CALL "DATA"return2 users thanked author for this post.
03/24/2024 at 2:25 PM #23035703/24/2024 at 4:55 PM #230361 -
AuthorPosts
Find exclusive trading pro-tools on