Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
how to data for multiple stocks into one OnBarUpdate() eventHandler
Collapse
X
-
how to data for multiple stocks into one OnBarUpdate() eventHandler
if I create a strategy that requires multiple to stocks how do I submit multiple to stock to pull for into my OnBarUpdate() eventHandler. I would like this to dynamic and not not static where I have to select my stocks at design time (hard coded)...I'd like to be able to select a list of stocks and have them ALL submitted to my strategy not individually.Tags: None
-
Hi d.allen101,
You can see a sample Multi instrument strategy through Tools > Edit NinjaScript > Strategy > Sample MultiTime Frame.
We support only hard coding additional instruments in Initialize() with a separate Add statement for each instrument.
Orders are submitted to a specific BarsInProgress using the advanced signature available for all order methods. To submit to all series at once, you could loop through.
Below is the advanced signature for EnterLong()
EnterLong(int barsInProgressIndex, int quantity, string signalName)Ryan M.NinjaTrader Customer Service
-
ok I understand the code, so how is this run? I assume since I've 'added' the stocks I want to follow within the Initialize() there's no need to create a chart to added my strategy to. How do i run this?
Comment
-
is it realistic to add 100 or more stocks like this? I was thinking about adding 100 stocks and moving the calculations to a class which would process quote and indicator data from OnBarUpdate() on another thread?
is this the correct way to go about this?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
59 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
143 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
161 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
97 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
276 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|

Comment