Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi time Frame hidden errors = Dangerous

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

    Multi time Frame hidden errors = Dangerous

    After numerous unsuccessful attempts at getting a resolution from the internal support thought I'd throw it to the general audience:-

    I am running a strategy at minute bar granularity

    I am using Kinetic market data.

    I am using NYMEX instruments, Session Manager Template has all sessions set to a 6pm open and a 5.15pm close.


    I add the Daily time series as I need to know the previous daily sessions closing price:-
    Add(PeriodType.Day, 1);

    which I request on the first open minute(Open[0]):-
    with Closes[1][0]

    It invariably gives me an incorrect price regardless of what time I specify the end of the session to end.


    The following give correct prices:-
    Opens[1][0], High[1][0], Lows[1][0] give correct results

    Has anyone else experienced similar when extracting the closing price from a Higher time frame BarsArray when using Kinetick data with closing times set via the Session Manager?

    #2
    Use Times[] to display the bar time to get a further understanding, so see where the value is coming from.

    See this post:



    I've had some strange things happen in early version of 7. I've also seen something odd recently, but I think it has to do with updating/installing NinjaScript. If you've done anything with importing ninjascript, try rebooting.




    Originally posted by abfc123 View Post
    After numerous unsuccessful attempts at getting a resolution from the internal support thought I'd throw it to the general audience:-

    I am running a strategy at minute bar granularity

    I am using Kinetic market data.

    I am using NYMEX instruments, Session Manager Template has all sessions set to a 6pm open and a 5.15pm close.


    I add the Daily time series as I need to know the previous daily sessions closing price:-
    Add(PeriodType.Day, 1);

    which I request on the first open minute(Open[0]):-
    with Closes[1][0]

    It invariably gives me an incorrect price regardless of what time I specify the end of the session to end.


    The following give correct prices:-
    Opens[1][0], High[1][0], Lows[1][0] give correct results

    Has anyone else experienced similar when extracting the closing price from a Higher time frame BarsArray when using Kinetick data with closing times set via the Session Manager?

    Comment


      #3
      Hi,

      Times[0] will just give me the time of the first minute bar of the new session, which is correct.
      It is on his bar that I request the last daily close Closes[1][0], which is wrong.

      Don't think it has anything to do with local install of scripts as two other developers are having the identical problem.

      I am curious if anyone can get the correct last daily close using the BarsArray whilst running a minute strategy and using Kinetic and the Nymex / ETH session template.

      (Bet you can't!!)

      Comment


        #4
        It's not exactly clear what you're trying to do, but a couple of things come to mind.

        1) If you're trying to get a previous bars close of a secondary time frame, you would want to use Closes[1][1], not Closes[1][0].

        2) Could CalculateOnBarClose be throwing off your expected results.

        3) If you're adding daily data, it is a different data set than minute data. The OHLC for the daily data will be determined by the data providers defined "session", not the one you set. As a work around, you could try using just the minute data, and get the prices based on the time of the session you want. Data can be rather quirky outside of official settlement times for the session.

        Comment


          #5
          What it looks like to me is that he wants to add a daily timeframe, and get the close/open/high/low of previous day.

          I'm going to guess Closes[1][0] is returning current day.

          That's why printing Times[1][0] to verify what is happening.

          Closes[1][1] might be what is needed.


          Sent from my HTC Hero on the Now! Network!



          Originally posted by lefevreed View Post
          It's not exactly clear what you're trying to do, but a couple of things come to mind.

          1) If you're trying to get a previous bars close of a secondary time frame, you would want to use Closes[1][1], not Closes[1][0].

          2) Could CalculateOnBarClose be throwing off your expected results.

          3) If you're adding daily data, it is a different data set than minute data. The OHLC for the daily data will be determined by the data providers defined "session", not the one you set. As a work around, you could try using just the minute data, and get the prices based on the time of the session you want. Data can be rather quirky outside of official settlement times for the session.

          Comment


            #6
            After a year of playing ping-pong with support on this issue would like to get resolved. I still don't know whether I'm at fault or Ninja/Kinetick has a bug.

            Attached is a very simple utility with a not so simple problem.

            Can you see if you can get a closing price on the output that actually matches its corresponding price bar on the chart.

            Regards
            Attached Files

            Comment


              #7
              abfc123, we're going to test your script here shortly - could you please PM me the ticket # that you've been working with our support team on the issue?

              Thanks,

              Comment


                #8
                Using that file with Zen Fire, the output matches the daily chart. However, it doesn't always match the price of the 1 minute bar. That is not unexpected though, since as I explained in my previous post, it is a different data set. NinjaTrader is outputting the data correctly.

                The daily bars will be set with how the data provider reports session settlements, which doesn't always line up with a 1 minute bar, or even that of a different data provider. That is just how market data works, since it is 2 different data sets. If you look in the historical data manager, under the edit tab, and locate the actual data, you should see that it matches your output for the daily data.

                If you must have the daily close match your minute prices, then you should work with just minute data and the close of the 1 minute bar.

                Comment


                  #9
                  Originally posted by abfc123 View Post
                  After a year of playing ping-pong with support on this issue would like to get resolved. I still don't know whether I'm at fault or Ninja/Kinetick has a bug.

                  Attached is a very simple utility with a not so simple problem.

                  Can you see if you can get a closing price on the output that actually matches its corresponding price bar on the chart.

                  Regards
                  I loaded ES 12-11 with 8 days, and started subtracting since the other way wouldn't work. As you can see, it actually started coming towards me as I went more negative.
                  calculateonbarclose=false

                  Code:
                                  String str = "-xx-----" + BarsInProgress + "---------------------------------------------";
                                  Print(str);    
                                  str = "---(" + Instrument.MasterInstrument.Name + ") New Session at " + Time[0].ToString();
                                  Print(str);
                                  str = "-Open of Today("+Open[0]+") at " + Time[0].ToString();
                                  Print(str);
                                  str = "O(" + Opens[1][0] +") H("+Highs[1][0]+") L(" + Lows[1][0] + ") C("+Closes[1][0]+") at " + Times[1][0].ToString();
                                  Print(str);
                                  str = "O(" + Opens[1][-1] +") H("+Highs[1][-1]+") L(" + Lows[1][-1] + ") C("+Closes[1][-1]+") at " + Times[1][-1].ToString();
                                  Print(str);
                                  str = "O(" + Opens[1][-2] +") H("+Highs[1][-2]+") L(" + Lows[1][-2] + ") C("+Closes[1][-2]+") at " + Times[1][-2].ToString();
                                  Print(str);
                  Code:
                  -xx-----0---------------------------------------------
                  ---(ES) New Session at 11/14/2011 4:43:16 PM
                  -Open of Today(1251.5) at 11/14/2011 4:43:16 PM
                  O(1248.5) H(1258.5) L(1236.5) C(1257.25) at 11/7/2011 4:15:00 PM
                  O(1263.75) H(1275.25) L(1251.5) C(1273.25) at 11/8/2011 4:15:00 PM
                  O(1243.5) H(1249.25) L(1222.75) C(1225.75) at 11/9/2011 4:15:00 PM
                  Last edited by sledge; 11-14-2011, 07:34 PM.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  648 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  369 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  108 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  572 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  573 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X