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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
67 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
36 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
60 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
62 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
53 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment