Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8B8 Bars.SessionIterator initial values

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

    NT8B8 Bars.SessionIterator initial values

    Hi,

    I am using in an indicator

    Bars.SessionIterator.ActualTradingDayEndLocal method in NT8 beta 8 with an ES (S&P500 Future) chart (Default trading hours) and data feed provided by Continuum Demo on state DataLoaded or in method OnBarUpdate, but it always returns 1800/01/01 00:00:00.

    So it seems to be intial. Is it a bug in NT8 or a problem of the demo data feed or the data series or or or....?

    Thank you for your assistance.

    Regards,
    patapata
    Last edited by patapata; 01-26-2016, 03:12 PM.

    #2
    Hello patapata,

    Thank you for your post.

    You would need to create your own SessionIterator. For example:
    Code:
    SessionIterator sessionIterator = null;
    
    protected override void OnStateChange()
    {
    if (State == State.Historical)
    {
    if(sessionIterator == null)
    {
    // create a new session iterator bases on the primary bars
    sessionIterator = new SessionIterator(BarsArray[0]);
    }
    }
    }
    
    protected override void OnBarUpdate()
    {
    if(Bars.IsFirstBarOfSession)
    sessionIterator.GetNextSession(Time[0], true);
    }

    Comment


      #3
      Hello Patrick,

      thank you very much, I understand that so far. But what about the sessioniterator of the bars object?

      Excerpt from http://ninjatrader.com/support/helpG...oniterator.htm

      "The default bars object will provide information related to real-time trading hours information".

      The examples in the help guide and here in the forum always refer to the Bars.SessionIterator object, e.g. the example here:



      Thank you for clarification,
      patapata

      Comment


        #4
        patapata,

        Thank you for your response.

        The documentation will soon change to reflect that Bars.SessionIterator will be removed as it can cause errors in bar types. We can still create our own SessionIterator based on the BarsArray[0] though, which would be accurate to the bars object we need.

        If you have questions on this please let me know.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by helpwanted, Today, 03:06 AM
        1 response
        12 views
        0 likes
        Last Post sarafuenonly123  
        Started by Brevo, Today, 01:45 AM
        0 responses
        9 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        5 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        242 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        387 views
        1 like
        Last Post Gavini
        by Gavini
         
        Working...
        X