Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

High/Low since session start

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

    High/Low since session start

    Hi,

    I'm developing a multi-instrument stocks 5m intraday strategy on US session.
    I want to find out for each instrument the High/Low points since the session start.
    For example for stocks XYZ 2 hours from the start of the trading day(9:30EST) I want to know what was the High point and the low point.
    I thought about using the Max/Min function and to give them the number of bars since the session started something like that:
    Code:
    max = MAX(Highs[5], BarsSinceSession)[0];
    My problem is that I don't know how many bars there are for each instrument, Maybe the primary BIP has more bars since the other BIP.
    What do you think is the best approach to solve this?

    TX,
    Roy

    #2
    Originally posted by freewind View Post
    Hi,

    I'm developing a multi-instrument stocks 5m intraday strategy on US session.
    I want to find out for each instrument the High/Low points since the session start.
    For example for stocks XYZ 2 hours from the start of the trading day(9:30EST) I want to know what was the High point and the low point.
    I thought about using the Max/Min function and to give them the number of bars since the session started something like that:
    Code:
    max = MAX(Highs[5], BarsSinceSession)[0];
    My problem is that I don't know how many bars there are for each instrument, Maybe the primary BIP has more bars since the other BIP.
    What do you think is the best approach to solve this?

    TX,
    Roy
    Reference specific bar series by either;
    Using a BarsInProgess filter when needed: http://www.ninjatrader.com/support/h...inprogress.htm,
    or by specifying the bar series with an index: http://www.ninjatrader.com/support/h...html?highs.htm

    Comment


      #3
      If I understood what you meant the BarsSinceSession is tight to the BIP the called the OnBarUpdate(), am I correct?

      Comment


        #4
        Originally posted by freewind View Post
        If I understood what you meant the BarsSinceSession is tight to the BIP the called the OnBarUpdate(), am I correct?
        Not quite. You said that you want to find when each instrument in a multi-instrument ...

        The BarsInProgress will filter calculations to the instrument which matches its BarsInProgress index, and exclude the other instruments.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        152 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        89 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        131 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        127 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        107 views
        0 likes
        Last Post CarlTrading  
        Working...
        X