Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 traderqz, Yesterday, 09:06 AM
    3 responses
    21 views
    0 likes
    Last Post NinjaTrader_ThomasC  
    Started by f.saeidi, Today, 10:19 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by kujista, Today, 06:23 AM
    5 responses
    15 views
    0 likes
    Last Post kujista
    by kujista
     
    Started by traderqz, Today, 12:06 AM
    3 responses
    6 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by RideMe, 04-07-2024, 04:54 PM
    5 responses
    28 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X