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

Date & Time Series

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

    Date & Time Series

    Hello,

    When writing indicator, we can access bar close, open, high, low & volume values via series like this Close[0], for 1 bar ago Close[1]. Also can i access Date & Time series? I mean Date[0], Date[1], Time[0], Time[1].

    Thanks.

    #2
    Hello aytacasan,

    Yes, all bars will have a date / time structure accessible with Time[0], Time[1], Time[2], etc.

    You can access specific elements (date, hour, seconds, etc) with this Time property. This reference sample can help with this:
    Manipulating DateTime objects
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks for your response,

      So we don't have date[] & time[] series separately. We have only time[] series but time[0] which current bar time contain Date&time values together.

      And We can change current bar color via BarColor = Color.Blue. Could you please tell me how can i change bars ago bar bar color property? I mean how can i write this X bars ago bar color = Color.Red.

      Regards.

      Comment


        #4
        Correct - Time[0] contains the entire date / time structure.

        You can use BarColorSeries to change color for the specified number of bars back.

        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Yes, all bars will have a date / time structure accessible with Time[0], Time[1], Time[2], etc.
          Yes but the documentation does not tell you the contents will all be zero (so useless) if you are using another indicator as input series. See this thread http://www.ninjatrader.com/support/f...ad.php?t=35107

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by reynoldsn, Yesterday, 04:40 PM
          4 responses
          15 views
          0 likes
          Last Post reynoldsn  
          Started by ETFVoyageur, 04-30-2024, 06:05 PM
          10 responses
          71 views
          0 likes
          Last Post ETFVoyageur  
          Started by Graci117, Yesterday, 11:40 PM
          4 responses
          25 views
          0 likes
          Last Post Graci117  
          Started by cmtjoancolmenero, Today, 02:31 PM
          4 responses
          10 views
          0 likes
          Last Post cmtjoancolmenero  
          Started by mintos, 04-02-2024, 08:22 PM
          2 responses
          17 views
          0 likes
          Last Post mintos
          by mintos
           
          Working...
          X