Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bar before last bar of session

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

    Bar before last bar of session

    Hello everyone, how can I get a bar before the last bar of the session?

    I need the condition run on a bar thah before the last bar of the session

    how to define it?

    #2
    Hello memonolog,

    Thanks for your post.

    There is the property Bars.IsLastBarOfSession that will work on Historical data and live bars if you are using Calculate.OnbarClose. https://ninjatrader.com/support/help...rofsession.htm

    If you are using Calculate.OnEachTick or Calculate.OnpriceChange, on live data, then you would need to use the session iterator according to this note: When running Calculate.OnEachTick / OnPriceChange, this property will always return true on the most current real-time bar since it is the last bar that is updating in the trading session. If you need to find a bar which coincides with the session end time, please use the SessionIterator.ActualSessionEnd.
    Reference: https://ninjatrader.com/support/help...sessionend.htm


    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_PaulH View Post
      Hello memonolog,

      Thanks for your post.

      There is the property Bars.IsLastBarOfSession that will work on Historical data and live bars if you are using Calculate.OnbarClose. https://ninjatrader.com/support/help...rofsession.htm

      If you are using Calculate.OnEachTick or Calculate.OnpriceChange, on live data, then you would need to use the session iterator according to this note: When running Calculate.OnEachTick / OnPriceChange, this property will always return true on the most current real-time bar since it is the last bar that is updating in the trading session. If you need to find a bar which coincides with the session end time, please use the SessionIterator.ActualSessionEnd.
      Reference: https://ninjatrader.com/support/help...sessionend.htm

      the question was about how to get the bar before the last bar of the session

      So will I get the bar before the last bar of the session?

      if(Bars.IsLastBarOfSession)

      {
      Close[1]
      }

      Comment


        #4
        Hello memonolog,

        Thanks for your reply.

        What type of bars and bar size are you using?

        What Calculate setting are you using on the indicator?

        Does the indicator have any added data series?

        Can you provide context about what you are wanting to do?
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by TigerKiger, Today, 01:12 PM
        0 responses
        10 views
        0 likes
        Last Post TigerKiger  
        Started by tonynt, Today, 12:46 PM
        0 responses
        5 views
        0 likes
        Last Post tonynt
        by tonynt
         
        Started by ntdev, Today, 12:19 PM
        0 responses
        3 views
        0 likes
        Last Post ntdev
        by ntdev
         
        Started by RubenCazorla, Today, 12:02 PM
        0 responses
        4 views
        0 likes
        Last Post RubenCazorla  
        Started by pkr75, Today, 11:03 AM
        1 response
        9 views
        0 likes
        Last Post pkr75
        by pkr75
         
        Working...
        X