• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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, 02: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);
    }
    Patrick H.NinjaTrader Customer Service

    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:

      http://ninjatrader.com/support/helpG...beginlocal.htm

      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.
        Patrick H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by MARTIN MARTIN, Today, 01:01 PM
        0 responses
        6 views
        0 likes
        Last Post MARTIN MARTIN  
        Started by bouncetherubble, Today, 10:21 AM
        2 responses
        12 views
        1 like
        Last Post bouncetherubble  
        Started by tcbarrow, Today, 10:53 AM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by dmking, Today, 11:31 AM
        2 responses
        17 views
        0 likes
        Last Post dmking
        by dmking
         
        Started by TazoTodua, Yesterday, 03:01 PM
        4 responses
        28 views
        0 likes
        Last Post koganam
        by koganam
         
        Working...
        X