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

First Bar Painted

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

    First Bar Painted

    Hi,
    I am trying to get the time stamp of the first bar of a data series. I realize that I can use
    Code:
    ChartControl.FirstTimePainted
    and this works fine. However, how can I get the time stamp of the first bar for a series that is not being charted but rather is being added as a secondary series via AddSeries?

    #2
    Hello Zeos6,

    Thanks for opening the thread.

    This would involve referencing the Times[][] Series for the BarsInProgress of that data series and using the CurrentBars[] value of that data series as the barsAgo reference.

    Code:
    protected override void OnBarUpdate()
    {
    	if(CurrentBars[1] < 1)
    		return;
    	if(BarsInProgress == 0)
    		Print(Times[1][CurrentBars[1]]);
    }
    Times - https://ninjatrader.com/support/help...ries_times.htm

    CurrentBars - https://ninjatrader.com/support/help...urrentbars.htm

    Please let me know if this does not resolve your inquiry.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply Jim, but ...
      This doesn't answer the question. I asked for the time stamp of the first painted bar of the series.

      EDIT:
      Bars.GetTime(0) will get me the time stamp of the first bar on the chart.
      Last edited by Zeos6; 10-04-2017, 03:25 PM.

      Comment


        #4
        Hello Zeos6,

        I guess I am confused by your inquiry.

        A secondary series which is not drawn on a chart would not have a first bar painted.

        Could you provide more detail to what you are trying to accomplish?

        EDIT: I see that you have updated your post and resolved your inquiry. If there is something else you would like to address, please don't hesitate to bump this thread.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by f.saeidi, Today, 12:14 PM
        2 responses
        5 views
        0 likes
        Last Post f.saeidi  
        Started by TradeForge, 04-19-2024, 02:09 AM
        2 responses
        28 views
        0 likes
        Last Post TradeForge  
        Started by aprilfool, 12-03-2022, 03:01 PM
        3 responses
        327 views
        0 likes
        Last Post NinjaTrader_Adrian  
        Started by giulyko00, Today, 12:03 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by AnnBarnes, Today, 12:17 PM
        1 response
        2 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Working...
        X