Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Regular and extended hour close and open
Collapse
X
-
Hi tffmd, thanks for posting.
It depends on how you would want to do it. This could be done without using NinjaScript indicators by adding a second instrument of the same type and setting the session template to the RTH template, that would display both candlestick charts on the same window.
To complete this through an Indicator script, you would use AddDataSeries(), using an overload that takes a tradingHoursName parameter to load the same instrument with a different trading hours template. Then you can plot the price as an indicator line. See here for a guide on a multi time frame scripts.
Best regards,
-ChrisL
-
Hi Thanks for your response. Option 2 would be the way to accomplish what I am looking for. Only problem is, I have no experience coding such a script. Would you be able to point me to the steps necessary to learn what I would need to accomplish this? Thanks. Tom
Comment
-
Hi Tom thanks for your reply.
I have given you links in my previous reply for a guide on multi time frame scripts. If you are a beginner to Ninjascript, I recommend going through all of the material listed in this forum post for starting out:
https://ninjatrader.com/support/foru...sample-scripts
Best regards,
-ChrisL
Comment
-
Hi, thanks for your reply.
It can be done by running the script on a 1, 5, 10, 15, or 30 minute chart, and evaluating the Times[0][0]:
This can also be built in the strategy builder:Code:if (Times[0][0].TimeOfDay == new TimeSpan(9, 30, 0)) { //Beginning of Session } if (Times[0][0].TimeOfDay == new TimeSpan(16, 0, 0)) { //End of Session }
https://ninjatrader.com/support/help...imeComparisons
Best regards,
-ChrisL
Comment
-
Hello tffmd123,
NinjaScripts process OnBarUpdate bar-by-bar, so the conditions would be checked with each bar. If the strategy is run on multiple days, these conditions would also be checked and would not have to become true on the current day. This can be tested by placing Print(Time[0]); in the conditions Chris provided.
We look forward to assisting.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
597 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
343 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 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
556 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
555 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment