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

Query regarding Historical property

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

    Query regarding Historical property

    Hi,

    I have a quick question regarding the Historical property of indicators and strategies.

    When an indicator is first added to a chart it plays catch up and processes all the historical bars already on the chart. This I am fairly sure is correct.

    However, it would appear that even when processing these historical bars this.Historical == true.

    I have tested this and the Historical property is never false.

    What am I missing here? Shouldn't this.Historical == false for those bars?

    Thanks

    #2
    Without an active data connection, Historical is always true. At the point where NT is done with the history and starts processing live date, Historical appears to be true.

    Regards
    Ralph

    Comment


      #3
      Originally posted by Ralph View Post
      Without an active data connection, Historical is always true. At the point where NT is done with the history and starts processing live date, Historical appears to be true.

      Regards
      Ralph
      Sorry, I completely mistyped my question.

      The issue is that Historical always equals false.

      It what instances is it true?

      Comment


        #4
        I just performed a little test with an inicator. It consists of 30 minute bars. Data connection is on and every tick is counted. Here is the output:

        # Historical:True Time[0]: 22.05.2009 14:30:00 DateTime.Now :22.05.2009 15:04:55
        # Historical:True Time[0]: 22.05.2009 15:00:00 DateTime.Now :22.05.2009 15:04:55
        # Historical:True Time[0]: 22.05.2009 15:30:00 DateTime.Now :22.05.2009 15:04:55
        ---
        # Historical:False Time[0]: 22.05.2009 15:30:00 DateTime.Now :22.05.2009 15:04:56
        # Historical:False Time[0]: 22.05.2009 15:30:00 DateTime.Now :22.05.2009 15:04:56
        # Historical:False Time[0]: 22.05.2009 15:30:00 DateTime.Now :22.05.2009 15:05:01
        # Historical:False Time[0]: 22.05.2009 15:30:00 DateTime.Now :22.05.2009 15:05:01
        # Historical:False Time[0]: 22.05.2009 15:30:00 DateTime.Now :22.05.2009 15:05:04

        Please look how NT switches from historical to live date after line "---".

        Regards
        Ralph

        Comment


          #5
          Originally posted by Ralph View Post
          I just performed a little test with an inicator. It consists of 30 minute bars. Data connection is on and every tick is counted. Here is the output:

          # Historical:True Time[0]: 22.05.2009 14:30:00 DateTime.Now :22.05.2009 15:04:55
          # Historical:True Time[0]: 22.05.2009 15:00:00 DateTime.Now :22.05.2009 15:04:55
          # Historical:True Time[0]: 22.05.2009 15:30:00 DateTime.Now :22.05.2009 15:04:55
          ---
          # Historical:False Time[0]: 22.05.2009 15:30:00 DateTime.Now :22.05.2009 15:04:56
          # Historical:False Time[0]: 22.05.2009 15:30:00 DateTime.Now :22.05.2009 15:04:56
          # Historical:False Time[0]: 22.05.2009 15:30:00 DateTime.Now :22.05.2009 15:05:01
          # Historical:False Time[0]: 22.05.2009 15:30:00 DateTime.Now :22.05.2009 15:05:01
          # Historical:False Time[0]: 22.05.2009 15:30:00 DateTime.Now :22.05.2009 15:05:04

          Please look how NT switches from historical to live date after line "---".

          Regards
          Ralph
          This is truly bizarre.

          If I add the attached custom indicator to a chart I get the attached log output.

          You can see that this.Historical == false for the 55 calls to OnBarUpdate() which refer to the 55 bars already on the chart.

          Why does NT not treat these as historical data?

          I'm clearly missing something obvious here.

          Thanks.
          Attached Files

          Comment


            #6
            Would it behave differently, if you would set Overlay=true?

            Comment


              #7
              Overlay most likely should not matter. Looking over your code I am not sure how you managed to get that behavior. Please try without using this.Historical and just use Historical. That shouldn't really make a difference either though. Hmm. Please let us know.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by Ralph View Post
                Would it behave differently, if you would set Overlay=true?
                Just tried.

                Makes absolutely no difference.

                Comment


                  #9
                  Originally posted by NinjaTrader_Josh View Post
                  Overlay most likely should not matter. Looking over your code I am not sure how you managed to get that behavior. Please try without using this.Historical and just use Historical. That shouldn't really make a difference either though. Hmm. Please let us know.
                  No. No difference.

                  By the way, I tend to write quite verbose code and have got into the habit of always prefixing members of the current instance with this. just to provide me with an easy way of referencing local members when quicking scanning through my code. Works a treat when reading through complex code quickly. Well for me anyway. Don't attach any significance to it.

                  Comment


                    #10
                    Josh

                    Can you try plugging the indicator in at your end and seeing if you can replicate the output.

                    I am using a Zenfire feed of the 6E futures contract.

                    Comment


                      #11
                      Issue related to OnMarketDepth() from earlier. Resolved in NT7.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        Originally posted by NinjaTrader_Josh View Post
                        Issue related to OnMarketDepth() from earlier. Resolved in NT7.
                        Really?

                        OK, thanks for clarifying.

                        Comment


                          #13
                          Tell me Josh.

                          How much of a difference is there in the NT7 API?

                          Is it worth me starting to develop what will eventually be a complex strategy using NT6.5, or am I better waiting for NT7?

                          Will there be breaking changes to the API and/or big changes to the event model?

                          Comment


                            #14
                            ScoobyStoo,

                            Maintaining backwards compatibility is a major concern for us so most things you do in 6.5 will be able to translate over to 7 either effortlessly or at least very quickly with a few tweaks.
                            Josh P.NinjaTrader Customer Service

                            Comment


                              #15
                              OK.

                              I'll wait for NT7 then.

                              BTW, I personally reckon most developers will quite happily accept breaking changes if it sorts out a lot of the architectural issues.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by funk10101, Today, 12:02 AM
                              1 response
                              10 views
                              0 likes
                              Last Post NinjaTrader_LuisH  
                              Started by GLFX005, Today, 03:23 AM
                              1 response
                              6 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by nandhumca, Yesterday, 03:41 PM
                              1 response
                              12 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by The_Sec, Yesterday, 03:37 PM
                              1 response
                              11 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by vecnopus, Today, 06:15 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post vecnopus  
                              Working...
                              X