Extend Trendline to a few bars under different freq

Questions about MultiCharts and user contributed studies.
kkhorse
Posts: 7
Joined: 08 Jun 2010
Has thanked: 2 times

Extend Trendline to a few bars under different freq

Postby kkhorse » 13 Mar 2014

Hi, I have a few charts, some are in 5 min and some are daily.

I'd like to draw a trendline say 5 bars ago to 5 bars later. Under minutes chart I just do:

tl_new(olddate, oldtime, level, olddate, oldtime+25, level)

but then this code doesn't work with daily chart.

Is there a way to draw trendline based on how many bars into the future?

Thanks a lot!

Sean

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Extend Trendline to a few bars under different freq

Postby TJ » 13 Mar 2014

Hi, I have a few charts, some are in 5 min and some are daily.
I'd like to draw a trendline say 5 bars ago to 5 bars later. Under minutes chart I just do:
tl_new(olddate, oldtime, level, olddate, oldtime+25, level)
but then this code doesn't work with daily chart.
Is there a way to draw trendline based on how many bars into the future?
Thanks a lot!
Sean
Look up:

TL_NEW_Bn

kkhorse
Posts: 7
Joined: 08 Jun 2010
Has thanked: 2 times

Re: Extend Trendline to a few bars under different freq

Postby kkhorse » 13 Mar 2014

thanks a lot! didn't know there is this function.

however, i had some trouble with using BarNumber. When I click on the charts, there is a display of OHLC and bar number information.

Then I wrote a few code to print the bar number on top of each bar, and I notice that BarNumber printed is different from what is displayed if click the mouse. Any idea? Thanks!

Sean

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Extend Trendline to a few bars under different freq

Postby Andrew MultiCharts » 14 Mar 2014

however, i had some trouble with using BarNumber. When I click on the charts, there is a display of OHLC and bar number information.

Then I wrote a few code to print the bar number on top of each bar, and I notice that BarNumber printed is different from what is displayed if click the mouse. Any idea? Thanks!
Hello kkhorse,

Please use Symbol_CurrentBar.


Return to “MultiCharts”