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 MJ123, Today, 04:06 PM
      2 responses
      15 views
      0 likes
      Last Post MJ123
      by MJ123
       
      Started by Skifree, Yesterday, 01:33 PM
      5 responses
      49 views
      0 likes
      Last Post Skifree
      by Skifree
       
      Started by dgutz15, 12-12-2022, 11:50 PM
      4 responses
      62 views
      0 likes
      Last Post drsclaud23  
      Started by xtremel, Today, 08:48 PM
      0 responses
      14 views
      0 likes
      Last Post xtremel
      by xtremel
       
      Started by SilverSurfer1, Today, 08:27 PM
      0 responses
      5 views
      0 likes
      Last Post SilverSurfer1  
      Working...
      X