Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Price data on more than one instrument
Collapse
X
-
Price data on more than one instrument
I'm wondering if NinjaScript can see current bid/ask on any other instrument? For example I trade DAX and want quotes on S&P to be taken into account.Tags: None
-
Hello alexeymarvel,
A non coding solution is to pull up multiple Superdom windows for each instrument that you want to view bid / ask data for.
Yes, this is possible in our multiseries NinjaScript framework. You can add additional instruments in the Initialize method. There are a couple ways to access bid/ask for multiple series in real time. The methods GetCurrentBid() and GetCurrentAsk() will accept an input for the BarsInProgress that you want to access.
You can also work in the OnMarketData stream for more control. To access real time bid / ask data for secondary instruments, you filter the specific BarsInProgress within the OnMarketData() handler.
protected override void OnMarketData(MarketDataEventArgs e)
{
if (BarsInProgress == 0)
//Handle primary series bid/ask here.
if (BarsInProgress == 1)
//Handle secondary series bid/ask here.
}
The basic structure for multiseries scripts is available in all nt installations. To view: Click Tools > Edit NinjaScript > Strategy > SampleMultiInstrument. It's also documented here:
Ryan M.NinjaTrader Customer Service
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
90 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
58 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 12:02 AM
|
||
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
119 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
195 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
176 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment