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 Option Whisperer, Today, 09:55 AM
      0 responses
      3 views
      0 likes
      Last Post Option Whisperer  
      Started by geddyisodin, 04-25-2024, 05:20 AM
      8 responses
      58 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by halgo_boulder, 04-20-2024, 08:44 AM
      2 responses
      22 views
      0 likes
      Last Post halgo_boulder  
      Started by mishhh, 05-25-2010, 08:54 AM
      19 responses
      6,189 views
      0 likes
      Last Post rene69851  
      Started by gwenael, Today, 09:29 AM
      0 responses
      5 views
      0 likes
      Last Post gwenael
      by gwenael
       
      Working...
      X