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

Price data on specific time frame.

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

    Price data on specific time frame.

    Hi,

    Is it possible to take the data from 9:30AM - 10:30AMtime frame and get the high, low, median, and close of that time frame so I can plot this on a chart without using a 60 minute chart?

    I would like to be able to get that information from the first 5 and 60 minutes of market data after 9:30 AM. This would be based off a 1 minute or 5 minute chart.

    On a 5 minute chart this would be easy as I just need the first 5 minute bar but I do not want to have a seperate 60 minute chart in order to calculate the first 60 minutes.

    Thanks,

    Matt

    #2
    imported post

    Yes, you have to write code which after 10:30 goes X bars back until you cross the 9:30 and manually calculate the values you are looking for.

    Comment


      #3
      imported post

      Currently I am using this code to get to a certain time on the chart. Is there a better method for this as it seems this will not work for scrolling to past days on the chart. It only works on the current day.


      CurrentBar - Bars.GetBar(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 9, 35, 0);


      Thanks,

      Matt

      Comment


        #4
        imported post

        - you should refer to "current" time by Time[0] and not DateTime.Now
        - you should use the Open[barsAgo] (or High[barsAgo] etc.) to access the OHLC values and make sure barsAgo >= CurrentBar >= 0

        Comment


          #5
          imported post

          Thanks, everything is working now.

          Matt

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by jackiegils, Yesterday, 11:05 PM
          0 responses
          5 views
          0 likes
          Last Post jackiegils  
          Started by cre8able, 05-09-2024, 09:15 PM
          2 responses
          17 views
          0 likes
          Last Post cre8able  
          Started by Trader146, Yesterday, 09:17 PM
          0 responses
          9 views
          0 likes
          Last Post Trader146  
          Started by ttrader23, 05-08-2024, 09:04 AM
          9 responses
          43 views
          0 likes
          Last Post ttrader23  
          Started by ZeroKuhl, 05-09-2024, 04:31 PM
          8 responses
          46 views
          0 likes
          Last Post ZeroKuhl  
          Working...
          X