Programmatically extending lines without specifying price
Programmatically extending lines without specifying price
I often need to extend a line in EL by using the tl_setend_bn function keeping the slope the same. To do so I need to compute the projected price by first computing the slope and applying the linear equation to compute the end price at the requisite bar number. I've written my own function to do all that. Is there a built-in function that allows me just to specify the new end bar number and EL does the rest, keeping the slope of the line constant?
- ABC
- Posts: 723
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
Re: Programmatically extending lines without specifying price
janus,
TL_GetValue_BN might do what you have in mind.
Regards,
ABC
TL_GetValue_BN might do what you have in mind.
You would still have to update the line end point, though. As far as I am aware, there is no reserved word for updating trendlines that would allow specifying just the bar number.Returns a price value, at the specified bar number, of a trendline with the specified ID number; returns a value of -2 if the specified trendline ID number is invalid.
If the trendline does not extend to the specified bar, a price value along the same slope as the trendline will be returned.
Regards,
ABC
I often need to extend a line in EL by using the tl_setend_bn function keeping the slope the same. To do so I need to compute the projected price by first computing the slope and applying the linear equation to compute the end price at the requisite bar number. I've written my own function to do all that. Is there a built-in function that allows me just to specify the new end bar number and EL does the rest, keeping the slope of the line constant?
Re: Programmatically extending lines without specifying price
Tried that. Returns 0 when the bar number is outside the range of the line. Not to worry. I'll keep using my function that computes the extended price given details of the line.TL_GetValue_BN might do what you have in mind.
- ABC
- Posts: 723
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
Re: Programmatically extending lines without specifying price
I must admit I have not tried it, but it sounds like this could be a bug. At least it goes against the description from the help file (the bold part in my first reply).
Can someone from Multicharts please comment if this is bug or intended behavior?
Regards,
ABC
Can someone from Multicharts please comment if this is bug or intended behavior?
Regards,
ABC
Tried that. Returns 0 when the bar number is outside the range of the line. Not to worry. I'll keep using my function that computes the extended price given details of the line.TL_GetValue_BN might do what you have in mind.
- Tammy MultiCharts
- Posts: 200
- Joined: 06 Aug 2020
- Has thanked: 6 times
- Been thanked: 65 times
Re: Programmatically extending lines without specifying price
Hello all,
There is a known bug when TL_getValue_BN returns 0 when the bar number is outside the range of the line.
This will be fixed in one of the nearest releases. We will notify you here as soon as the fix is out.
There is a known bug when TL_getValue_BN returns 0 when the bar number is outside the range of the line.
This will be fixed in one of the nearest releases. We will notify you here as soon as the fix is out.