• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Making Line auto adjust/extend till end time on 300 tick chart

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Making Line auto adjust/extend till end time on 300 tick chart

    I am trying to draw a line from start time (6am) till close time next day (Day+1, 5am)

    However as I am using 300 ticks chart, there is no way I can determine the length of today's chart ( as in the number of candles within the day's trade session).

    But for the DrawLine function it draws a fixed length. When the number of candles exceed this line line, the line will not readjust or auto extend.

    Is there anyway to fix this?

    The codeI am using is:
    DateTime NextDay = Time[0].Add(tsOneDay);
    DateTime StartTime = new DateTime(Time[0].Year, Time[0].Month,Time[0].Day,6,0,0);
    DateTime EndTime = new DateTime(NextDay.Year, NextDay.Month, NextDay.Day,5,0,0);

    DrawLine(cirrentbar.tostring(), false, StartTime , High[0], EndTime, High[0],Color.Aquamarine,DashStyle.DashDotDot, 2);

    Thanks
    Last edited by ystan79; 07-30-2014, 11:03 PM.

    #2
    ystan79, welcome to our forums here - I think the issue is rather in the unique tag you use for the line per bar, meaning you create a high amount of lines. Drawing this time based on the tick charts should be fine, but I would look into just using one tag per session here. For example Bars.SessionBreak would give you an event in OnBarUpdate() to create a session count which you could potentially use a suffix for your tag to make a unique one per session for the line.
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Steve L, Today, 05:01 PM
    0 responses
    6 views
    0 likes
    Last Post Steve L
    by Steve L
     
    Started by Trader-Joe, Today, 04:06 PM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by vantojo, Today, 04:06 PM
    0 responses
    5 views
    0 likes
    Last Post vantojo
    by vantojo
     
    Started by tonynt, Today, 02:39 PM
    2 responses
    13 views
    0 likes
    Last Post tonynt
    by tonynt
     
    Started by StevenNelson, Today, 12:23 PM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_PatrickG  
    Working...
    X