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 TradeForge, 04-19-2024, 02:09 AM
        2 responses
        28 views
        0 likes
        Last Post TradeForge  
        Started by aprilfool, 12-03-2022, 03:01 PM
        3 responses
        327 views
        0 likes
        Last Post NinjaTrader_Adrian  
        Started by giulyko00, Today, 12:03 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by f.saeidi, Today, 12:14 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by AnnBarnes, Today, 12:17 PM
        1 response
        2 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Working...
        X