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

Referencing Time

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

    Referencing Time

    Hi,
    I'm writing an indicator that is look at a time analysis. I'm wondering if there is simple reference to the the fist bar of the DataSeries in the reference of Time. IE: DateTime variable. I've been looking but haven't found it yet. I love the DateTime.now. but I want to reference the first bar in a DateTime fashion

    Another question, what's the best way to compare 2 points in time if you are looking for a recurring event. IE:
    Let's say you look back in time for when price has closed below a certain price level and you store that in time. IE: ES < 800 and you want to save that time to an array or list and see when and if it's done that at a later time still in the past but that next time maybe days,weeks, or months different.
    Thanks

    #2
    doubletop, you can simply access Time[0] on the first OnBarUpdate() call (CurrentBar == 0), that's the first bar then.

    For the second question, we're not really clear what you seek unfortunately - you would store the DateTime of the event happening (your condition) and then would need to create your custom comparison logic to generate your signals out of this mining process.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks Bertrand,
      I didn't want to have to resort OnBarUpdate first bar logic. I thought there must be another way to reference that like GetBarsTime() or something.

      Comment


        #4
        Hello,

        Nothing that is supported or mentioned in our help guide, I will send the suggestion into development.

        Thank You.

        Comment


          #5
          Thanks doubletop, added into our product enhancement tracking lists under id # 1879.

          We appreciate your input to further evolve our NinjaTrader platform,
          BertrandNinjaTrader Customer Service

          Comment


            #6
            difficult question , search in https://www.google.com/ better

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by traderqz, Today, 12:06 AM
            2 responses
            4 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  
            Started by f.saeidi, Today, 08:13 AM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by DavidHP, Today, 07:56 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by kujista, Today, 06:23 AM
            3 responses
            11 views
            0 likes
            Last Post kujista
            by kujista
             
            Working...
            X