User defined trendline points
Forums › ProRealTime English forum › ProBuilder support › User defined trendline points
- This topic has 7 replies, 3 voices, and was last updated 2 years ago by tabarrington.
-
-
09/11/2022 at 12:53 AM #200519
Hello All,
I am trying to code an indicator that will draw a line between two points on RSI like I have attached in the screen shot.
I am wondering what is the best way to tell ProBuilder the coordinates if my line?
Once I have these I thought I might be able to duplicate this line by calculating the slope with rise/run so I can have duplicates of the line on the indicator.
I hope this will also allow me to get the value of the line at any given point in time.
Any advice would be greatly appreciated,
Many thanks,
Tim.
09/11/2022 at 1:12 AM #200525Sorry about all the screenshot duplicates!
09/11/2022 at 7:57 AM #20052809/11/2022 at 9:49 AM #200531Hi JS,
Thankyou very much for the reply!
RSI and date have to be at a certain value…
Ive played around with a few things like DATETOBARINDEX(2022022117) to stop the X coordinates moving when a new bar is loaded which does work but Ive been unable to define a variable using that…
Is there a way that you know of for saving a set point in time, such as DATETOBARINDEX(2022022117), to a variable?
Many Thanks!!
09/11/2022 at 1:09 PM #200540Sorry about all the screenshot duplicates!
I deleted all duplicates.
Please, do not embed documents of any type in your posts, as they slow down the loading of pages. Use the Select File button, instead, to attach them.
Thank you 🙂
1 user thanked author for this post.
09/11/2022 at 10:30 PM #200580Trendline Points1234567891011121314151617defparam drawonlastbaronly=trueMyFirstDate = 20220601MySecondDate = 20220902If Date = MyFirstDate thenxFirstRSI = RSI[5](Close)EndIfIf Date = MySecondDate thenxSecondRSI = RSI[5](Close)EndIfdrawsegment(datetobarindex(MyFirstDate),xFirstRSI,datetobarindex(MySecondDate),xSecondRSI) Coloured(255,0,0)drawtext("#xFirstRSI#",datetobarindex(MyFirstDate),xFirstRSI,dialog,bold,30) coloured(0,255,0)drawtext("#xSecondRSI#",datetobarindex(MySecondDate),xSecondRSI,dialog,bold,30) coloured(0,255,0)return //xFirstRSI as "First", xSecondRSI as "Second"Hi @tabarrington
That’s right, you could use DateToBarIndex to draw your line between two dates and at certain levels.
You then have to enter two dates, a start date and an end date.
The indicator then draws the line between these two data and plots the values of the corresponding RSI.
1 user thanked author for this post.
09/11/2022 at 11:01 PM #200582You’re an absolute legend!!! Thank you so much for your help, I really appreciate it.
Such a great community here, I wish I had found it years ago.
Many thanks and have a great day.
Tim
1 user thanked author for this post.
09/11/2022 at 11:05 PM #200583No worries @robertogozzi, thanks for getting rid of those for me!
T
-
AuthorPosts
Find exclusive trading pro-tools on