Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsArray[ ] with Technical Indicators

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

    BarsArray[ ] with Technical Indicators

    Most technical indicators (MACD, SMA, EMA, etc) use closing price to calculate intra-bar or historical bar plots.

    When using BarsArray[ ] as input to technical indicators, is there a way to enforce or make sure the indicator will use other than closing price?

    I assume this code will use "High" prices to compute the DonchainChannel indicator...

    Code:
    bool isHigher = DonchainChannel(BarsArray[1], 20).Upper[2] <= Closes[1][0];
    
    ....
    How would I modify this code to enforce this or other technical indicators to use the high(s) prices of each bar?

    Thanks

    #2
    Hello borland,

    Thank you for writing in.

    Rather than passing BarsArray, pass Highs: https://ninjatrader.com/support/help...nt7/?highs.htm

    So, rather than BarsArray[1], pass Highs[1]. This will pass the high prices of your secondary Bars object.

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by borland View Post
      Most technical indicators (MACD, SMA, EMA, etc) use closing price to calculate intra-bar or historical bar plots.

      When using BarsArray[ ] as input to technical indicators, is there a way to enforce or make sure the indicator will use other than closing price?

      I assume this code will use "High" prices to compute the DonchainChannel indicator...

      Code:
      bool isHigher = DonchainChannel(BarsArray[1], 20).Upper[2] <= Closes[1][0];
      
      ....
      How would I modify this code to enforce this or other technical indicators to use the high(s) prices of each bar?

      Thanks
      Instead of BarsArray[x], use Highs[x].

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      576 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      334 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      553 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X