Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market Data Query

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

    Market Data Query

    Is it possible to query market data such as "query all High Prices by day for the month of March for ES"?

    Thank you.

    #2
    Hello scottreynolds,
    Thanks for your post.

    Yes, you can do it. To assist you further may I know:
    • From what bars period (daily, minute etc) you are trying to pull the data.
    • Are you looking for the highest high value for the month of March, or something else?


    Looking forward to assisting you further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Using March as the example, I would like to be able specify a time range, say, 9am to 10am and then for each trading day in March, retrieve the highest price in that time period for each day. So if there were 22 trading days in March, I would get 22 "highest" prices, one for each day restricted to the time period 9am to 10am.

      Comment


        #4
        Hello scottreynolds,
        Thanks for the clarification.

        You can find the high low using the following code.
        Code:
        //in variable
        double high = 0;
        double low = double.MaxValue;
        
        //in OnBarUpdate
        if (Time[0].Month == 3)
        {
        	if(ToTime(Time[0]) >= 90000 && ToTime(Time[0]) <= 100000)
        	{
        		high = Math.Max(high, High[0];
        		low = Math.Min(low, Low[0]);
        	}
        }
        You can store the value in a list, or an array. This is however more of a C# query and beyond what we could support. However you may refer here to know more.
        Create a new List, add elements to it, and loop over its elements with for and foreach.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Just to clarify - what you are doing is actually writing a strategy - so then I would need to download all the market replay data myself (say the month of March for some instrument) and then open a connection to Market Reply using a start date of 3/1/2012 and end date of 3/31/2012 and then run the strategy - is that the idea?

          Comment


            #6
            Hello scottreynolds,
            Yes, you have to write a NinjaScript code to do it.

            You can simply run the code on a chart (make sure data for the month of March is there).
            JoydeepNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by jclose, Today, 09:37 PM
            0 responses
            5 views
            0 likes
            Last Post jclose
            by jclose
             
            Started by WeyldFalcon, 08-07-2020, 06:13 AM
            10 responses
            1,413 views
            0 likes
            Last Post Traderontheroad  
            Started by firefoxforum12, Today, 08:53 PM
            0 responses
            11 views
            0 likes
            Last Post firefoxforum12  
            Started by stafe, Today, 08:34 PM
            0 responses
            11 views
            0 likes
            Last Post stafe
            by stafe
             
            Started by sastrades, 01-31-2024, 10:19 PM
            11 responses
            169 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Working...
            X