• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need to load historical chart values

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

    Need to load historical chart values

    Hi,

    Is there a way to load historical values mainly open ,high,low, close from the charts.

    What i want is .
    Suppose i run my strategy at 9:30 am.
    I wish to load the open at 7:30 am.
    and i wish to load all the close values at 15 minute interval before 9:30

    #2
    Hello Nemesis45,

    You can add a 15 minute data series and then grab those values using the Multi-TimeFrame capabilities with NinjaTrader -
    http://www.ninjatrader.com/support/h....html?add3.htm
    http://www.ninjatrader.com/support/h...nstruments.htm

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Yes, i read that.
      So,

      Lets say i start running my strategy at 8:30 am.
      CalculateonBarClose = false;
      Since i am accessing live market data from OnMarketData()

      Now, i want OHLC values at 7:30 am.

      I add in Initialise(), Add(PeriodType.Minute,15);

      And i can refer to this using, lets say close[0], which would return the close of the current bar.
      Now, if i want to refer to close value at 7:30 am i use close[4] ?
      Will it work if i have just started ninjatrader at 8:30 am(and loaded historical tick and second data from my provider)
      Also, Will it work if my ninjatrader connection had been running from 7:30- 8:30, but the strategy has started running at 8:30 ?

      Can it give an error message if the historical data is not found on my computer?

      Can i code a command to load this data from my provider?

      What is the maximum period in history that i can retrieve data for?Is there a limit?

      Is there a way to set the start of a 15 min data bar to a step function synced with my computer's clock eg. start the data bar at 8:30am, even if strategy starts running at 8:35 am, i.e 15 min bar from 8:30 to 8:45 am. ?

      Comment


        #4
        Nemesis,

        Yes, this logic will grab the 7:30 bars time that you are looking for.

        Example -
        Code:
        //in Initialize()
        Add(PeriodType.Minute, 15);
        
        //in OnBarUpdate()
        Closes[1][4] //This is will access the closing price of the 15M Data Series that we have added to the script and return the price 4 bars ago or //one hour.
        If there is no historical data found then yes it would return an error message in your Log Tab in the Control Center.

        You would not be able to code a command to load historical data. You would need to ensure that you are connected to your provider and if they provide historical data then this can be downloaded directly to a chart that is loading the instrument, or you can right click on the chart and select Reload All Historical Data.

        The maximum lookback for data is going to depend on your data provider and what they offer through their connection.

        Yes you can code the strategy to use time filters to run its calculations. This time is based off your PC clock.

        Let me know if I can be of further assistance.
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Atilla, Yesterday, 04:05 PM
        1 response
        49 views
        1 like
        Last Post im197
        by im197
         
        Started by vevbarrq, Today, 12:11 AM
        0 responses
        4 views
        0 likes
        Last Post vevbarrq  
        Started by johnnybegoode, Yesterday, 10:16 PM
        0 responses
        4 views
        0 likes
        Last Post johnnybegoode  
        Started by reedstickets, Yesterday, 07:53 PM
        0 responses
        9 views
        0 likes
        Last Post reedstickets  
        Started by Displacer, Yesterday, 02:57 PM
        2 responses
        17 views
        0 likes
        Last Post Displacer  
        Working...
        X