Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 kaywai, Today, 06:26 AM
        1 response
        6 views
        0 likes
        Last Post kaywai
        by kaywai
         
        Started by ct, 05-07-2023, 12:31 PM
        6 responses
        203 views
        0 likes
        Last Post wisconsinpat  
        Started by kevinenergy, 02-17-2023, 12:42 PM
        118 responses
        2,780 views
        1 like
        Last Post kevinenergy  
        Started by briansaul, Today, 05:31 AM
        0 responses
        10 views
        0 likes
        Last Post briansaul  
        Started by traderqz, Yesterday, 12:06 AM
        11 responses
        28 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X