Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Median from DataSeries

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

    Median from DataSeries

    Hello,

    I try to get get the maximum / minimum of the median from a dataseries. Unfortunately it seems not to work. How is it possible to code it?

    Code:
    AddDataSeries(BarsPeriodType.Day, 1);    // 
    double max = MAX(Median, Length)[0];
    double min = MIN(Median, Length)[0];
    Kind regards
    Gerik

    #2
    Hello Gerik,

    Thanks for your note.

    I see that you are adding an additional data series to your script and you would like to get the maximum and minimum median values from that added series.

    You would need to check the BarsInProgress value of that added series before accessing values from it. For example, you would check if BarsInProgress == 1 to ensure the first added series is the series that is processing, then you would call your MAX and MIN methods.

    Note the primary data series has a BarsInProgress value of 0, the first added secondary series has a BarsInProgress value of 1, a second added secondary series would have a BarsInProgress value of 2, and so on.

    See the help guide documentation below for more information.
    AddDataSeries: https://ninjatrader.com/support/help...dataseries.htm
    BarsInProgress: https://ninjatrader.com/support/help...inprogress.htm
    MAX: https://ninjatrader.com/support/help...aximum_max.htm
    MIN: https://ninjatrader.com/support/help...inimum_min.htm

    Let us know if we may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    91 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    137 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    121 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    72 views
    0 likes
    Last Post PaulMohn  
    Working...
    X