Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

ptcman

Shorten Trendline

Recommended Posts

Hi.

 

I'd like to plot trendlines but from the last bar forward (to the right side of the chart, not the standard way, to the left side of the chart.

 

Using the code below I'm able to achieve my goal but it's not working properly.

 

When zooming in the lines disappear after a while. I need to zoom out again so I can see them.

Also, the lines begin right at the last bar (time_s) but I'd like to have some space there between the last bar and the start of the line. Any idea to achieve this? I was looking of "sum" some time to time_s keyword but I can't figure out how to to this.

 

tl_delete(value1);
tl_delete(value2);
tl_delete(value3);
tl_delete(value4);

value1 = tl_new_s(date, time_s, close, date + 1, time_s, close);  
tl_setcolor(value1, red);
tl_setsize(value1, 1);
tl_setextright(value1, true);

value2 = tl_new_s(date, time_s, closeD(1), date + 1, time_s, closeD(1));  
tl_setcolor(value2, yellow);
tl_setsize(value2, 0);
tl_setextright(value2, true);

value3 = tl_new_s(date, time_s, highD(1), date + 1, time_s, highD(1));  
tl_setcolor(value3, darkcyan);
tl_setsize(value3, 2);
tl_setextright(value3, true);

value4 = tl_new_s(date, time_s, lowD(1), date + 1, time_s, lowD(1));  
tl_setcolor(value4, darkcyan);
tl_setsize(value4, 2);
tl_setextright(value4, true);

 

attachment.php?attachmentid=33364&stc=1&d=1355143941

extend_right.png.057e4b27983274c5960cce5be9d715b8.png

Share this post


Link to post
Share on other sites
Hi.

 

I'd like to plot trendlines but from the last bar forward (to the right side of the chart, not the standard way, to the left side of the chart.

 

Using the code below I'm able to achieve my goal but it's not working properly.

 

When zooming in the lines disappear after a while. I need to zoom out again so I can see them.

Also, the lines begin right at the last bar (time_s) but I'd like to have some space there between the last bar and the start of the line. Any idea to achieve this? I was looking of "sum" some time to time_s keyword but I can't figure out how to to this.

 

 

use time_s + 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.