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

Difference of Intraday Time Range

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

    #16
    Hello Lee,

    Using the Kinetick - End of Day (Free) and Yahoo data providers provides access to historical daily data only, allowing you to access Daily, Weekly, Monthly and Yearly data for free. For any other historical data or Live data you would need connect to a different data provider.

    Click here to view more information on Historical Data and Understand the data provided by your connectivity provider

    This means you will only have access to intraday data.

    If you're trying to test on an intraday interval, such as a minute, tick, range, second, volume, etc, you will have to connect to a data provider that support it.

    For Example, you can get a subscription to Kinetick, which has been optimized to work with NinjaTrader 7, on a monthly basis.

    You may see the following link to their website. http://www.kinetick.com
    Last edited by NinjaTrader_JC; 12-06-2012, 08:44 AM.
    JCNinjaTrader Customer Service

    Comment


      #17
      Ok,

      well this makes sense. It actually seems like my code may be correct, I just don't have the available historic minute data.

      JC, I'm going to take a look at the link you sent on data providers.

      Since all I actually need is historic minute data, do you guys know off hand if there are any free feeds that provide historic minute data?? I'm not trying to do real-time analysis of the data, just looking for historic minute to complement the daily data for the code.

      Thanks again,

      Lee

      Comment


        #18
        Lee,

        Unfortunately I do not know of any providers who offer free intraday data. You may be able to open a demo with a supported broker for a trial period which would give you access for that time, but ultimately you'd need to subscribe to a data provider or open a brokerage account to get continuous access.
        MatthewNinjaTrader Product Management

        Comment


          #19
          Ok, so I retrieved some intraday data to test my script.... I looked at a one day period using a timeframe of 1 and 5 minutes (setup looking at bars). I am getting price data, but all I really want is the open or close price from one specific time (bar I guess). So, do I even need all this other code I have? Lets say I have intraday data for either 1 or 5 minute intervals, how do I say I want the open price or close price from one point, and that is all I want from that day, then the same thing for the next day? Is this possible? It is giving me price data from all of the bars it seems. And when I tried just using the Open[ ] or Close[ ] command, assuming n (I tried, 1, 2, 70, etc...) bars ago, I got no data. Maybe someone can shed some light on this as I think it must be something simple I'm missing.

          I've attached the text for the intradata I used.

          Thanks,
          Attached Files

          Comment


            #20
            Originally posted by lee612801 View Post
            Ok, so I retrieved some intraday data to test my script.... I looked at a one day period using a timeframe of 1 and 5 minutes (setup looking at bars). I am getting price data, but all I really want is the open or close price from one specific time (bar I guess). So, do I even need all this other code I have? Lets say I have intraday data for either 1 or 5 minute intervals, how do I say I want the open price or close price from one point, and that is all I want from that day, then the same thing for the next day? Is this possible? It is giving me price data from all of the bars it seems. And when I tried just using the Open[ ] or Close[ ] command, assuming n (I tried, 1, 2, 70, etc...) bars ago, I got no data. Maybe someone can shed some light on this as I think it must be something simple I'm missing.

            I've attached the text for the intradata I used.

            Thanks,
            I am not quite sure what you are asking here, so I will give a generalized response. In order to extract information, you have to process all the data that you have that covers the information that you want to extract.

            As far as processing a stream of data, you can always use a time filter to process only that data that is within the timespan that you wish to handle.

            Comment


              #21
              Hello Lee,

              The intraday data looks to be in the correct format, note that it is broken up into only 5 Min segments so you will not have 1 Min data.

              The reason why you are not getting values might be due to your code being stopped by a "return;" statement that you have inside your code. Your NinjaScript / C# Code will always be logically processed and evaluate according to your set logic – this can of course lead to unexpected results at times, thus we would suggest to simplify and debug your code to better understand the event sequence it would go through - unfortunately we cannot offer such debug or code modification services here, but please see the provided resources below to help you proceed productively :

              First of all you would want to use Print() statements to verify values are what you expect and how your code is being processed - Debugging your NinjaScript code.

              For Example:
              Code:
              protected override void OnBarUpdate()
              {
                      // Prints out the Close value of the current bar and time when OnBarUpdate is called
              	Print("Close: "+Close[0]+" Time: "+Time[0]);
                      // Rest of Code
              }

              It may also help to add drawing objects to your chart for signal and condition confirmation - Drawing Objects.

              If you would prefer the debug assist of a professional NinjaScript consultant, please check into the following listings - Click here for a list of certified NinjaScript Consultants

              Let us know if we can be of further assistance.
              JCNinjaTrader Customer Service

              Comment


                #22
                Ok, thanks guys. I will keep working it. I'm determined to get something to work

                Comment


                  #23
                  Hi JC,

                  I have hopefully a relatively easier question this time. I have reworked my code and can retrieve the values I want now, but when I go to make a simple calculation using these values, I get an error saying "the name does not exist in current context" (lines 128 & 129). Is there an easy way around this by declaring these before hand? I have my 4 value statements broken up into different contexts. Do I have to combine them all? Hopefully that will not change the logic (what little I have) Hope this makes sense.

                  Thanks,
                  Attached Files

                  Comment


                    #24
                    Hello Lee,

                    Thanks for the code.

                    This is due to using local variable inside a condition. Since, you are declaring a variable inside a condition and accessing the variable outside, the compiler will throw an error check because that condition may not always exist thus creating a call to a variable that does not exist.

                    You may want to either declare them in the beginning of OnBarUpdate() so they will always exist or inside the variables #region.

                    Code:
                    protected override void OnBarUpdate()
                    {
                    	double openStartPrice = 0;
                            // Rest of Code
                    }
                    or
                    Code:
                            #region User Variables
                            private double openStartPrice = 0;
                            // Rest of Code
                            #endregion
                    Let us know if we can be of further assistance.
                    JCNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by pechtri, 06-22-2023, 02:31 AM
                    10 responses
                    124 views
                    0 likes
                    Last Post Leeroy_Jenkins  
                    Started by judysamnt7, 03-13-2023, 09:11 AM
                    4 responses
                    59 views
                    0 likes
                    Last Post DynamicTest  
                    Started by ScottWalsh, Yesterday, 06:52 PM
                    4 responses
                    36 views
                    0 likes
                    Last Post ScottWalsh  
                    Started by olisav57, Yesterday, 07:39 PM
                    0 responses
                    7 views
                    0 likes
                    Last Post olisav57  
                    Started by trilliantrader, Yesterday, 03:01 PM
                    2 responses
                    22 views
                    0 likes
                    Last Post helpwanted  
                    Working...
                    X