Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
RTH High Low Open and GLOBEX High Low Open
Collapse
X
-
RTH High Low Open and GLOBEX High Low Open
I'm using a 24 * 7 trading hour chart. I would like create high, low, open levels for globex, and high, low, open levels for the RTH. How can I do so? Thanks.Tags: None
-
Hello AdeptistJune,
You can add a data series using a different TradingHours template.
AddDataSeries(string instrumentName, BarsPeriod barsPeriod, string tradingHoursName)
You can use variables to track the highest high or lowest low. Below is a link to an example.
https://ninjatrader.com/support/foru...96#post1113896Chelsea B.NinjaTrader Customer Service
-
Hello,
I wrote the adddataseries like this: AddDataSeries("ES 03-22", new BarsPeriod {BarsPeriodType = BarsPeriodType.Tick, Value = 100}, "Overnight");
The script only works when I add it to a 100 tick chart. Is there a way I can write the script so that it will plot on any chart I add the script to?
Thanks.
Comment
-
Hello AdeptistJune,
The added series is a 100 tick series, but I would expect this to work with any primary bar type.
Are you printing the Time[0] and BarsInProgress to the script and finding that BarsInProgress 1 is not updating OnBarUpdate()? (Is this print at the top of OnBarUpdate and not within a condtiion?)
May I have the output from the prints saved to a text file so that I may take a look?
Chelsea B.NinjaTrader Customer Service
Comment
-
I think I did it correctly.Attached Files
Comment
-
Here's the attachment
Comment
-
Hello AdeptistJune,
This output is showing BarsInProgress 1 but is not showing BarsInProgress 0.
12/13/2021 8:29:58 AM | BarsInProgress: 1
Have you put the print at the top of OnBarUpdate? Is the print in a condition?
What is the primary series of the chart?Chelsea B.NinjaTrader Customer Service
Comment
-
If it's not too much trouble, can I just send you the code? I don't think I'm doing this properly. Thanks.
Comment
-
Hello AdeptistJune,
To export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:- Click Tools -> Export -> NinjaScript...
- Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
- Click the 'Export' button
- Enter a unique name for the file in the value for 'File name:'
- Choose a save location -> click Save
- Click OK to clear the export location message
- (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
http://ninjatrader.com/support/helpG...-us/export.htm
Once exported, please attach the file as an attachment to your reply.
(You could also create a test script with only the AddDataSeries() and print if you want to keep the other code private)Chelsea B.NinjaTrader Customer Service
Comment
-
-
Hello, Chris,
I can't get the code to work on anything other than a 100 tick chart. Am I suppose to take out the the BarsInProgress or keep it? Thanks.
Comment
-
Hello AdeptistJune,
If the code is in a condition to only process when BarsInProgress is 1, then the code will only be run when BarsInProgress is 1. The primary series is BarsInProgress 0 which will never run, because of the condition you put the code in. This is why in post #4 and post #8 I have asked that the code is not in a condtion and at the top of OnBarUpdate().
Have a look at this video where I remove the condition.
Chelsea B.NinjaTrader Customer Service
Comment
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
37 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
18 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
25 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
40 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
34 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment