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 AaronKoRn, Today, 09:49 PM
      0 responses
      6 views
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Today, 08:42 PM
      0 responses
      9 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Today, 07:51 PM
      0 responses
      10 views
      0 likes
      Last Post strategist007  
      Started by StockTrader88, 03-06-2021, 08:58 AM
      44 responses
      3,976 views
      3 likes
      Last Post jhudas88  
      Started by rbeckmann05, Today, 06:48 PM
      0 responses
      9 views
      0 likes
      Last Post rbeckmann05  
      Working...
      X