Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Secondary bar series not correctly added.

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

    Secondary bar series not correctly added.

    There is a heavy bug related to the session close, when adding a secondary bar series.

    Idea: I want to calculate a SMA from the full session (as per trading hours from instrument settings) and display the result on a RTH chart.

    For that purpose I have added a secondary bar series via the indicator by using

    Code:
    AddDataSeries(BarsArray[0].Instrument.FullName, BarsArray[0].BarsPeriod, Instrument.MasterInstrument.TradingHours.Name, true);
    When applied to a regular session 15-min chart, this will add a secondary 15-min bar series for the primary instrument. The primary bars will only be processed for the regular trading hours, while the secondary bars will be processed for the entire trading day.

    What I expect to see is the values for the full session SMA being shown on the RTH chart. However, this does not work:

    For the last bar of the regular session (3:15 PM) the value shown on the chart is calculated from the last bar of the night session that closes at 8:30 AM in the morning. In my opinion this is a fat bug.

    I have attached a chart and a sample indicator to test the issue.
    Attached Files
    Last edited by Harry; 06-20-2017, 07:39 AM.

    #2
    Same problem for tick charts

    See a 3000 tick chart below.

    Again at the close of the regular session a false value is added which is taken from a time approximately 17 hours later which would be the last tick bar that closes prior to the start of the regular session.

    Also I want to point out that this is not the only problem where values from future bars are displayed for the current bar. The pivots indicator that ships with NinjaTrader also occasionally calculates today's pivots from today's high, low and close which is not yet known.

    The bar processing logic needs to be changed in these cases.
    Attached Files

    Comment


      #3
      Hello Harry,

      Thank you for your posts on this item.

      I will forward this to development as a feature request. Currently what you are seeing is expected as the value plotted on the last bar of the smaller session is using the last bar of the larger session before the new session open on the smaller session.

      Essentially, as bars are not considered closed until a new bar opens then the historical plot from the secondary series has it's final bar at a different time and therefore value.

      Please let me know if you have any questions.

      Comment


        #4
        Originally posted by NinjaTrader_PatrickH View Post
        Hello Harry,

        Thank you for your posts on this item.

        I will forward this to development as a feature request. Currently what you are seeing is expected as the value plotted on the last bar of the smaller session is using the last bar of the larger session before the new session open on the smaller session.

        Essentially, as bars are not considered closed until a new bar opens then the historical plot from the secondary series has it's final bar at a different time and therefore value.

        Please let me know if you have any questions.

        Patrick, thank you for your answer.

        If this is expected, it is dead wrong,

        Basically this means that the whole feature - adding a secondary bar series with a different trading hours template - cannot be used at all.

        What can be its use, if the plot shows a value from 17 hours ahead of the bar time?

        Alternatively, it would possible to delay the plot by one bar, but who wants delayed plots?

        I am very much disappointend. This is ridiculous!


        Summary:

        With NinjaTrader 8 it is not possible to add a secondary bar series with a trading hours template that covers a larger period than the trading hours template of the primary bars.

        For the last bar of the primary session, you will either see a future value that can be calculated from a bar 15 or 17 hours ahead (how do we know?).

        Alternatively, by using BarsInProgress as a filter, the information from the secondary bars can be retrieved with a delay of 1 bar (option not shown here).

        In short this is all useless and has no practical application, unless you wish to use displaced moving averages, which have been a fad 30 years ago.

        Comment


          #5
          Hello Harry,

          Thank you for your response.

          I will update you when I have further details.

          Comment


            #6
            Originally posted by NinjaTrader_PatrickH View Post
            Hello Harry,

            Thank you for your response.

            I will update you when I have further details.

            Thank you for your patience.

            I know that this is a special case.

            With the new feature to replicate the primary bars with a different trading hours template I had assumed that it would be possible to display indicator values calculated from ETH bars on a regular session chart.

            I have just learnt that this is not possible, because NinjaTrader uses a false secondary bar at the end of each session.

            This explains my disappointment.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by algospoke, Today, 06:40 PM
            0 responses
            2 views
            0 likes
            Last Post algospoke  
            Started by maybeimnotrader, Today, 05:46 PM
            0 responses
            6 views
            0 likes
            Last Post maybeimnotrader  
            Started by quantismo, Today, 05:13 PM
            0 responses
            6 views
            0 likes
            Last Post quantismo  
            Started by AttiM, 02-14-2024, 05:20 PM
            8 responses
            168 views
            0 likes
            Last Post jeronymite  
            Started by cre8able, Today, 04:22 PM
            0 responses
            8 views
            0 likes
            Last Post cre8able  
            Working...
            X