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 iceman2018, Today, 05:07 PM
        0 responses
        4 views
        0 likes
        Last Post iceman2018  
        Started by rhyminkevin, Today, 04:58 PM
        0 responses
        25 views
        0 likes
        Last Post rhyminkevin  
        Started by lightsun47, Today, 03:51 PM
        0 responses
        6 views
        0 likes
        Last Post lightsun47  
        Started by 00nevest, Today, 02:27 PM
        1 response
        14 views
        0 likes
        Last Post 00nevest  
        Started by futtrader, 04-21-2024, 01:50 AM
        4 responses
        49 views
        0 likes
        Last Post futtrader  
        Working...
        X