Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
High/low based on duration
Collapse
X
-
Josh, I managed to just take the snippet of the problematic bit of code and I could get it to run on 6 days data without crashing but with punching out errors. I had the Trace Order command on. This is the output I got...does it mean anything to you?Attached Files
Comment
-
Red Fish,
The TraceOrders output is useful for when you are having problems with your orders. In this case you are having problems with the hh/ll loop so you will want to follow the tip regarding adding Print(). You want to print the time and what its doing along each step inside the loop.
Basically you want to determine why the loop is sucking so much resources. The loop is only suppose to perform once per day.
Sorry Red Fish I cannot assist in debugging. You will just need to find out what is eating away your resources and then make the adjustments needed to stop it from doing so.Josh P.NinjaTrader Customer Service
Comment
-
Hey Josh - I found my solution! Instead of coding if price is higher than the highest high, I inserted the condition if price high crosses above highest high - it works!
Amazing what a good night's sleep does!!
Thank you for all your help in this, I really appreciate the time and trouble you gave to support my strategy development! You guys are the best!!
Comment
-
Hello djdinut1,
We do not have a built in indicator that does this. One approach in NinjaScript can be found in the reference sample below:
Calculating the highest high or lowest low for a specified time range.
The snippet below will capture OHLC values for the time you specify. Note that you need a time stamp on your chart to match the time specified exactly.(16:15:00)
Code:if (ToTime(Time[0]) == 161500) { double myClose = Close[0]; double myOpen = Open[0]; double myHigh = High[0]; double myLow = Low[0]; }Ryan M.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
670 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
379 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
111 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
575 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
582 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment