Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DataSeries vs Close of Bar

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

    DataSeries vs Close of Bar

    Hi,

    In the below example, which one is the data series versus the close of bar? Is the [0] close of bar and [3] data series?

    minlow = MIN(Lows[0],2)[3];


    Thanks

    #2
    Hello AgriTrdr,

    Thank you for your post.

    I'm not sure what you are referring to as the data series versus the close of bar. The syntax available for the MIN indicator is as follows:
    MIN(int period)
    MIN(ISeries<double> input, int period)

    Returns default value
    MIN(int period)[int barsAgo]
    MIN(ISeries<double> input, int period)[int barsAgo]

    In the case of MIN(Lows[0],2)[3] this would be getting the MIN value from 3 bars ago based on the Lows[0] as the ISeries<double> input series with a period of 2.

    Please let us know if we may be of further assistance.

    Comment


      #3
      Hi Emily,

      What i'm trying to find out is the low of the last 2 bars on the 3rd data series. Would that be the correct way to do it?

      Thanks

      Comment


        #4
        Hello AgriTrdr,

        Thank you for your reply.

        When working with Lows as the ISeries<double> input series, the number inside of the brackets determines the barSeriesIndex that you are referring to. If you want the 3rd data series, as in there is a primary series and two added data series, that would be Lows[3]. The primary series would be index 0, the first added series is index 1, and the second added series (or the 3rd series altogether) is index 2.

        What this would look like to find the lowest low of the last 2 bars on the 3rd data series is:
        Code:
        MIN(Lows[2], 2)[0];
        Another option would be to add a condition that checks if the BarsInProgress is 2, meaning that OnBarUpdate() is being called for an update on that 3rd data series, and then you could use the following syntax instead:
        Code:
        if (BarsInProgress == 2)
        {
        Min(Low, 2)[0];
        }
        I suggest reviewing the Multi-Time Frame & Instruments page in the help guide for a more detailed explanation of working with multiple data series. The section for accessing the price data in a multi-bars script may be especially helpful for this example:


        Here are the help guide pages for MIN and Lows as well:



        Please let us know if we may be of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        66 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X