Beginning and end of Manual Trendline
Author: grtrader
Creation Date: 3/18/2014 5:58 AM
profile picture

grtrader

#1
What would be the script to return the bar # and values for the beginning and end of a manually drawn trendline "Resistance"?
profile picture

Eugene

#2
A manually drawn trendline does not have the beginning or end (lines can be extended left and/or right). With TrendlineValue you can get its current value as of bar.
profile picture

grtrader

#3
That is true. I have already done that. What I cannot do, and I don't know if it can be done, is just extend the line to the right Visually on the chart from the last bar of the manual trendline. To do this, I would have to find the bar and value of the end of the Manually Drawn Line. This changes daily.

Do you have a script to retrieve this info? If not, so be it.
profile picture

Eugene

#4
Are you talking about peeking into a future value of the trendline?
profile picture

grtrader

#5
No.

Right now, if I specify two manual bars in the script, I can get the values, and then extend the line VISUALLY to the right using LineExtendY. from the end of the manually drawn line. As time goes on, however, the end bar of the manually drawn line changes daily, and the Visully extended line may have a gap from the end of the manually drawn line. If I can retrieve the last bar of the manually drawn line in the script each day, I would not have to manually enter the first bar of the extended line each day to not have this gap.
profile picture

Cone

#6
You're looking for the "handles" of the trendline.

But it's a moot point. You don't have to extend a manually-drawn trendline from a script. Just right click it, select "Change Drawing Object Properties", and check "Extend Line Right". (And this will become the default for any line that you draw.)

If that's not what you need, please describe the outcome you need and a solution should be pretty straightforward.

Edit: By the way, you cannot extend a trendline into the future by drawing it from a script because DrawLine requires a bar number for the beginning and end of the line. Therefore, it's possible only to project a manually drawn line into the future as previously described. Use PadBars(5); for example, to add 5 bars of space to the right of the chart.
profile picture

grtrader

#7
Having only been using WealthLab about a month now, I missed that feature. You are right, it is a moot point now.

Thanks - I am finding Wealth Lab to be a tool with limitless potential!


This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).