Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
dynamically change traded instrument list
Collapse
X
-
dynamically change traded instrument list
Hello. I developed a strategy that applies to all stocks in Russell 3000 Index. However, on a particular day, only a small number of stocks are traded. The stock symbols traded on a particular day are pre-determined and can be imported daily from a file. In the Initialize() method, do I need to add all 3000 stocks, or is there a way to only add the stocks traded for a particular day and change that list dynamically? Thank you for your help!Tags: None
-
Hi Tony, welcome to our forums here - unfortunately dynamically adding symbols would not be something we can support - it's on our list for future consideration though (I've added a vote into this tracking item on your behalf). So one way would be adding in all stocks and then drive logic dynamically per your file for the day, or to amend the Initialize() as needed on changes, but this would mean code changes as well, as the # of instruments that would be traded each day (as I understand) could vary.BertrandNinjaTrader Customer Service
-
Hi Bertrand. Thank you for your reply. You mentioned that I can amend the Initialize() method as needed to change the traded instrument list. My understanding is that this approach only works for live trading, where I can program to add the instruments traded for the given trading day. How do I do it for backtesting over multiple days? My understanding is that the Initialize() method only runs once when the backtest is started, therefore the instrument list cannot change over the backtest period. Is that correct? Thanks.
Comment
-
Hello upshot,
Thanks for your reply.
This would have to be coded into the BarsInProgress, it would not be possible to call Initialize() like this.Last edited by NinjaTrader_Brandon; 03-27-2014, 02:56 PM.BrandonNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by jpeep, 08-16-2020, 08:31 AM
|
17 responses
502 views
0 likes
|
Last Post
by notenufftime
Today, 08:46 PM
|
||
Started by ETFVoyageur, 05-07-2024, 07:05 PM
|
15 responses
124 views
0 likes
|
Last Post
by ETFVoyageur
Today, 08:46 PM
|
||
Started by esmall, Today, 07:14 PM
|
0 responses
11 views
0 likes
|
Last Post
by esmall
Today, 07:14 PM
|
||
Started by Option Whisperer, 05-09-2024, 07:58 PM
|
6 responses
26 views
0 likes
|
Last Post Today, 06:52 PM | ||
Started by rayyyu12, Today, 05:38 PM
|
0 responses
13 views
0 likes
|
Last Post
by rayyyu12
Today, 05:38 PM
|
Comment