In Strategy Analyzer, under "Time frame" there is a setting called "Trading hours" which is typically set to "<Use instrument settings>" by default. I would like to have certain strategies default to "US Equities RTH". Is there a way to programatically change this default value within the strategy NinjaScript code? Defaults for other values such as Slippage, OrderFillResolution and IncludeCommission can be changed quite easily, but I'm not sure how to refer to the correct TradingHours type.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Set Default TradingHours Programatically
Collapse
X
-
Set Default TradingHours Programatically
Hi,
In Strategy Analyzer, under "Time frame" there is a setting called "Trading hours" which is typically set to "<Use instrument settings>" by default. I would like to have certain strategies default to "US Equities RTH". Is there a way to programatically change this default value within the strategy NinjaScript code? Defaults for other values such as Slippage, OrderFillResolution and IncludeCommission can be changed quite easily, but I'm not sure how to refer to the correct TradingHours type.Tags: None
-
Hello wuileng,
Thanks for your post.
There are no means to change the trading hours of an existing data series. An existing data series would be a chart or the data series you specify in the strategy analyzer. The strategy adopts the trading hours of the data series, not the other way around.
If you are Adding a data series in your script, there are cases where you can specify the trading hours to use for that data series, please see AddDataSeries for further details: https://ninjatrader.com/support/help...dataseries.htm
You can use Time filters within your code to provide RTH boundaries. :Please see example here: https://ninjatrader.com/support/help...to_limit_t.htm
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
113 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
60 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
40 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
43 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
81 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment