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 GLFX005, Today, 03:23 AM
        0 responses
        1 view
        0 likes
        Last Post GLFX005
        by GLFX005
         
        Started by XXtrader, Yesterday, 11:30 PM
        2 responses
        11 views
        0 likes
        Last Post XXtrader  
        Started by Waxavi, Today, 02:10 AM
        0 responses
        6 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by TradeForge, Today, 02:09 AM
        0 responses
        12 views
        0 likes
        Last Post TradeForge  
        Started by Waxavi, Today, 02:00 AM
        0 responses
        2 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Working...
        X