Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Scrollable ATR

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

    Scrollable ATR

    Sometimes we might want to scroll back the chart and find ATR values without using a plot,
    but just by using OnRender.

    I've been trying and let's just say my head hurts

    high0 = BarsArray[0].GetHigh(ChartBars.ToIndex - 1);
    low0 = BarsArray[0].GetLow(ChartBars.ToIndex - 1);
    close1 = BarsArray[0].GetClose(ChartBars.ToIndex);
    double trueRange =
    Math.Max(Math.Abs(low0 - close1),
    Math.Max(high0 - low0,
    Math.Abs(high0 - close1)));​

    the default Ninja atr uses a plot with Value, but I would have to reconstruct the values necessary for the period.

    If only I could use ATR(12)[ChartBars.ToIndex];

    Long shot, but any advice from the community and I'm all ears
    Last edited by davydhnz; 01-28-2024, 05:11 AM.

    #2
    Hello davydhnz,

    Thanks for your notes.

    You could consider accessing the ATR indicator value in OnRender() using .GetValueAt() on the ATR() system indicator method.

    For example: ATR(20).Values[0].GetValueAt(123);

    See the help guide documentation below for more information.

    GetValueAt(): https://ninjatrader.com/support/help...getvalueat.htm
    ATR: https://ninjatrader.com/support/help..._range_atr.htm

    Otherwise you would need to come up with your own custom logic to calculate that information. This forum thread will be open for other community members to share their insight on possible custom logic to accomplish this.
    <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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    650 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    370 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    577 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X