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

StarDate and EndDate ?

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

    StarDate and EndDate ?

    Hi everybody

    How can I know the "Start Date" and the "End Date" of chart Data Series in my strategy code?

    Thanks!
    Last edited by ninjo; 03-02-2016, 06:57 AM.

    #2
    Somebody knows? Thank you !

    Comment


      #3
      Hello,

      Thank you for the question.

      If you are referring to the First and Last bars on the chart, you could use logic in OnBarUpdate to determine the specific bar times.

      Checking the First bar or bar 0's Time, and the Current Bars Time should achieve the Start and End times on the chart.

      Are you instead referring to the DataSeries menu and the EndDate and DaysToLoad?

      I look forward to being of further assistance.
      JesseNinjaTrader Customer Service

      Comment


        #4
        I want to know the "Data Series" window Sart Date and End Date.



        Thank you !

        Comment


          #5
          I am testing...

          Time[0].ToString() return the date of the firstbar
          but
          Time[Bars.Count].ToString() return next error: "Bar index needs to be greater/equal 0"

          any idea?
          Thank you
          Last edited by ninjo; 03-03-2016, 02:20 AM.

          Comment


            #6
            Hello,

            The Current time would of course be Time[0] or zero bars ago, for the First time on the chart you could use:
            if(CurrentBar == 0) Print(Time[0]);

            That is just a print, you could store this as a variable for later use as well.

            Regarding the items in the DataSeries menu, there are not documented ways to get these specific values, instead using logic you could store the Time of bar 0 and the Time[0] on the CurrentBar to get the span of dates.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              Is there a way to access those 2 controls using UIAutomationID in NT8?
              Would like to be able to programmatically access those Strategy Analyzer values during OnStateChange events.What are UI Automation IDs associated with them and any insights on how to use them would be appreciated.

              Thanks

              Comment


                #8
                Hello,

                Thank you for the reply.

                I am unsure if using an automation ID would be relevant in this case, the Automation ID points to a Control and the Property Grid is displaying an Objects data.

                You would need the actual Object to access its properties rather than the Property Grid.

                For any further assistance on this question, please post this question in the NT8 forum.

                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by TradeForge, Today, 02:09 AM
                1 response
                22 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by elirion, Today, 01:36 AM
                2 responses
                13 views
                0 likes
                Last Post elirion
                by elirion
                 
                Started by DJ888, 04-16-2024, 06:09 PM
                5 responses
                14 views
                0 likes
                Last Post NinjaTrader_Erick  
                Started by samish18, Yesterday, 08:31 AM
                4 responses
                14 views
                0 likes
                Last Post elirion
                by elirion
                 
                Started by funk10101, Yesterday, 09:43 PM
                1 response
                14 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Working...
                X