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

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 DavidHP, Today, 07:56 AM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by kujista, Today, 06:23 AM
      3 responses
      9 views
      0 likes
      Last Post kujista
      by kujista
       
      Started by Mindset, Yesterday, 02:04 AM
      2 responses
      18 views
      0 likes
      Last Post NinjaTrader_RyanS  
      Started by f.saeidi, Today, 08:03 AM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by samish18, 04-17-2024, 08:57 AM
      15 responses
      54 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X