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 benmarkal, Yesterday, 12:52 PM
        3 responses
        22 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by helpwanted, Today, 03:06 AM
        1 response
        17 views
        0 likes
        Last Post sarafuenonly123  
        Started by Brevo, Today, 01:45 AM
        0 responses
        11 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        6 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        244 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Working...
        X