easylanguage TL_new in tickchart

Questions about MultiCharts and user contributed studies.
KhaosTrader
Posts: 186
Joined: 10 May 2012
Has thanked: 14 times
Been thanked: 10 times

easylanguage TL_new in tickchart

Postby KhaosTrader » 21 Oct 2012

Hi,

the tl_new function uses beginning time and end time for drawing a trendlines. What if I am putting this on a tick chart? and I want it to move forward 5 bars? I dont know the time of the 5th bar, as its a tick chart, what do i do?

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

Re: easylanguage TL_new in tickchart

Postby Andrew MultiCharts » 22 Oct 2012

Hello KhaosTrader,

Unfortunately you cannot reference bar numbers or something else. You will have to use approximate bar time for plotting your trendlines on tick resolution. .

KhaosTrader
Posts: 186
Joined: 10 May 2012
Has thanked: 14 times
Been thanked: 10 times

Re: easylanguage TL_new in tickchart

Postby KhaosTrader » 22 Oct 2012

Well, I think a more clever approach would be to move it to one minute in the future, and then adjust it to the current time of the current tick and once current time is exceeded you end the bar length change.

Would you agree?

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

Re: easylanguage TL_new in tickchart

Postby Andrew MultiCharts » 26 Oct 2012

Try this example:

Code: Select all

var: id(0);

if id=0 then
   id = tl_new_s(d,time_s,close,d,time_s,close);
   
tl_setbegin_s(id, d,time_s,close);
tl_setend_s(id, d,time_s+100,close);


Return to “MultiCharts”