Thank you!
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
using close price in moti-instrument strategy
Collapse
X
-
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!Tags: None
-
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:
Another option to access the close for a secondary instrument is to check the BarsInProgress index:Code:secondaryClose = Closes[1][0];
In addition, this is the link to the help guide entry for multi-instrument strategies if you'd like to review more.Code:OnBarUpdate() { if (BarsInProgress == 1) // secondary instrument update { secondaryClose = Close[0]; } }Last edited by NinjaTrader_Austin; 07-15-2009, 11:06 AM.AustinNinjaTrader Customer Service
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by SalmaTrader, 07-07-2026, 10:26 PM
|
0 responses
46 views
0 likes
|
Last Post
by SalmaTrader
07-07-2026, 10:26 PM
|
||
|
Started by CarlTrading, 07-05-2026, 01:16 PM
|
0 responses
22 views
0 likes
|
Last Post
by CarlTrading
07-05-2026, 01:16 PM
|
||
|
Started by CaptainJack, 06-17-2026, 10:32 AM
|
0 responses
14 views
0 likes
|
Last Post
by CaptainJack
06-17-2026, 10:32 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:15 AM
|
0 responses
20 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:15 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:06 AM
|
0 responses
22 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:06 AM
|

Comment