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 Barry Milan, Yesterday, 10:35 PM
        4 responses
        15 views
        0 likes
        Last Post Barry Milan  
        Started by DanielSanMartin, Yesterday, 02:37 PM
        2 responses
        13 views
        0 likes
        Last Post DanielSanMartin  
        Started by DJ888, 04-16-2024, 06:09 PM
        4 responses
        12 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by terofs, Today, 04:18 PM
        0 responses
        11 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by nandhumca, Today, 03:41 PM
        0 responses
        8 views
        0 likes
        Last Post nandhumca  
        Working...
        X