Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

draw commands mix both time and bar

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

    draw commands mix both time and bar

    If I draw a text or draw object at a specific time what is the best way to draw a second object so it will be in the next bar of the chart after the first object I just drew?

    I want the indicator to be independent of the chart time frame so the objects are drawn correct. I was using the bar number and that made it easy but now I am using time so I don't have a constant anymore.

    Do I need to determine the chart time frame and compute the object's destination time?
    Last edited by ct; 08-19-2012, 01:42 AM.

    #2
    ct,

    If you are using datetime here you would need to compute the correct times yourself unfortunately.

    This has some useful methods for adding / subtracting time from some time frame : http://msdn.microsoft.com/en-us/libr....datetime.aspx

    Otherwise, you could use the drawing object override that uses the "BarsAgo" property instead.
    Adam P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    244 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    157 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    165 views
    1 like
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    250 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    201 views
    0 likes
    Last Post CarlTrading  
    Working...
    X