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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
666 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
376 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
110 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
575 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
580 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment