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

Get data from another timeframe without adding new DataSerie

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

    Get data from another timeframe without adding new DataSerie

    Hello.

    Tell, me please, is there any way to get data from anоther timeframe without adding this timeframe?

    For example, I want put my indicator on 1 min chart, but for calculations I need daly data over 4 years.

    Thanks.
    Last edited by fx.practic; 02-24-2013, 03:33 AM.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Originally posted by fx.practic View Post
    Hello.

    Tell, me please, is there any way to get data from anither timeframe without adding this timeframe?

    For example, I want put my indicator on 1 min chart, but for calculations I need daly data over 4 years.

    Thanks.
    Data must come from somewhere. If you want data from the daily chart, then you need to add the necessary data stream, so the answer to your question is "no".

    Edit: For the special case of daily bars, however, you can use the GetDayBar() method or the PriorDayOHLC() class.
    Last edited by koganam; 02-24-2013, 04:18 AM.

    Comment


      #3
      Hello.

      Tell, me please, is there any way to get data from another time frame without adding this time frame?

      For example, I want put my indicator on 1 min chart, but for calculations I need daily data over 4 years.

      Thanks.
      Actually in this case you can compute the daily data from your 1 minute data. Each day equals 1440 minutes.
      Just remember that you still need to load this data to a chart and bars request should be 4 (years) * 365(days) * 1440 (min)
      Or a better way is to calculate this number in advance and just use it.
      What ever the calculation is on so much data it won't change in one or even 10 days.

      Comment


        #4
        Thank you, koganam and Baruch!

        Now I exactly know what to do.

        I will make strategy, that write daly prices to file, and my indicator will read daly data from that file in Initialise().

        Why I don't want to add second DataSeries on chart and to load 4 years (or more) of 1 min data:
        1) I haven't 4 years 1 min history
        2) Speed of chart loading and chart calculations.
        fx.practic
        NinjaTrader Ecosystem Vendor - fx.practic

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by trilliantrader, 04-18-2024, 08:16 AM
        5 responses
        22 views
        0 likes
        Last Post trilliantrader  
        Started by Davidtowleii, Today, 12:15 AM
        0 responses
        3 views
        0 likes
        Last Post Davidtowleii  
        Started by guillembm, Yesterday, 11:25 AM
        2 responses
        9 views
        0 likes
        Last Post guillembm  
        Started by junkone, 04-21-2024, 07:17 AM
        9 responses
        68 views
        0 likes
        Last Post jeronymite  
        Started by mgco4you, Yesterday, 09:46 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X