Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

using close price in moti-instrument strategy

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

    using close price in moti-instrument strategy

    Hi, I have learned that we can use "CCI(BarsArray[1], 20)[0]" in a multi-instrument strategy. But when I similarly write "Close(BarsArray[1])", I'm informed that "NinjaTrader.Strategy.StrategyBase.Close" is a "property" but is used like a "method". How can I use the close price of a second instrument?

    Thank you!

    #2
    Hi scyche, there is an array for multi-instrument strategies called Closes that contains the closes for each instrument.

    In OnBarUpdate(), you can access the close of the secondary instrument with:
    Code:
    secondaryClose = Closes[1][0];
    Another option to access the close for a secondary instrument is to check the BarsInProgress index:
    Code:
    OnBarUpdate()
    {
         if (BarsInProgress == 1) // secondary instrument update
         {
              secondaryClose = Close[0];
         }
    }
    In addition, this is the link to the help guide entry for multi-instrument strategies if you'd like to review more.
    Last edited by NinjaTrader_Austin; 07-15-2009, 11:06 AM.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Thank you very much! I really appreciate your help! It helps a lot!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      633 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      364 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      567 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      568 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X