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 bmartz, 03-12-2024, 06:12 AM
        4 responses
        32 views
        0 likes
        Last Post bmartz
        by bmartz
         
        Started by Aviram Y, Today, 05:29 AM
        4 responses
        12 views
        0 likes
        Last Post Aviram Y  
        Started by algospoke, 04-17-2024, 06:40 PM
        3 responses
        28 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by gentlebenthebear, Today, 01:30 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by cls71, Today, 04:45 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X