Also, I just upgraded to the new NT and this was not happening with the version I had before. If it makes any difference, I am using two data connections (zen-fire is the primary). Any suggestions?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Multi Instrument Price Reference
Collapse
X
-
Multi Instrument Price Reference
I am running a 15 minute chart with the symbol "ES 09-08". I am running a multi-instrument strategy on this chart which references "YM 09-08". Since the primary instrument is ES, the code Closes[0][0] should reference the most recent close price for the primary instrument.. however, it is not. The price for the ES right now is 1283.25.. Closes[0][0] is returning 1403.25. Since this is not the price for any instrument being used, I am not sure what the problem is :/
Also, I just upgraded to the new NT and this was not happening with the version I had before. If it makes any difference, I am using two data connections (zen-fire is the primary). Any suggestions?Tags: None
-
There should be no difference with the prior version to this version with respect to multi-time instrument strategies.
I suggest adding a print statement such as:
Print(Times[0][0] + " " + Closes[0][0]);
To confirm exactly the bar time you are looking at and correlate to your chart.RayNinjaTrader Customer Service
-
It turns out that the error had nothing to do with the how NT is referencing price data. I used the tip you gave me Ray, and I was able to identify at what bar the strategy stopped working.. it was an error in the strategy code. I send a CancelOrder request at the first tick of every bar if the strategy is flat, and the strategy was sending the CancelOrder request for the variable entryOrder without ensuring that entryOrder was not set to null. Since entryOrder was set to null (not defined), the strategy encountered an error, stopped, and just kept referencing the price from that bar for every bar after it. The code below fixed the problem:
if(entryOrder != null)
{
CancelOrder(entryOrder);
}
The above code ensures that the entryOrder variable is set before attempting to send a cancel request for it. I figured I'd post it to help anyone else that might be running into this problem for the same reason.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
634 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
364 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
567 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment