Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Is there a programmable way to find the Daily High/Low?
Collapse
X
-
Is there a programmable way to find the Daily High/Low?
Is there a programmable way to find the Daily High/Low? ThanksTags: None
-
-
ChunkyBrown, glad to hear you've got it figured out. In case anyone stumbles upon this thread with the same question, the best way to get the daily high/low would be to reference the CurrentDayOHL values, like this:
Code:double currentHigh = CurrentDayOHL().CurrentHigh[0]; double currentLow = CurrentDayOHL().CurrentLow[0];
AustinNinjaTrader Customer Service
Comment
-
Oh I apologize. Should have wrote my solution instead of just saying that i got it. Thanks Austin for providing the answer for the rest.
Comment
-
ChunkyBrown, would you mind at all helping me out with that? Also, is there a way to get the daily high/low over a period of say 3-4 days and have the horizontal lines distinguish each?Originally posted by ChunkyBrown View PostOh I apologize. Should have wrote my solution instead of just saying that i got it. Thanks Austin for providing the answer for the rest.
Thank you!
Comment
-
gravitas,
If you want to grab values from prior trading days you can use PriorDayOHLC() indicator similar to CurrentDayOHL(). With that you can grab the values from the prior trading days and then just check which trading day has the highest high and lowest low to offer you the information for where to draw the lines you want.Josh P.NinjaTrader Customer Service
Comment
-
Are you sure?
Doesn't seem that you can get values of bars beyond Previous Day.
//This works
//double val = (PriorDayOHLC().PriorHigh[0] - PriorDayOHLC().PriorLow[0]) / 2;
// This doesn't
double val = (PriorDayOHLC(High).PriorHigh[1] - PriorDayOHLC(Low).PriorLow[1]) / 2;
StopInLong.Set(val);
Thank you and regards.
Comment
-
Hi Betrand,
Thank you for your speedy response.
So presumably if i need a lookback of 3 days worth of OHLC's and my lowest/primary interval was 5min, I would need to make sure that there were at least 4days worth of 5 min bars? ie 1152, onBarUpdate
Thank you
Comment
-
Regarding Multi-Time Frame Indicator Construction:
If my indicator is using 5m interval primary bars, what would the best solution be to plot Daily ATR's?
As it is not possible to Add(PeriodType.Day, 1) like in Strategy construction, would I have to write my own method using calls to PriorDayOHLC?
Thank you
Comment
-
Correct, to get reasonable values you need a good amount of bars for the initialization - the error you ran into was more general - the way you coded it up likely produced a log error in the Control Center's log tab, right? As on your first bar you can't access a bar (the [1] one) that is not present, thus you have to ensure this is not attempted codewise, therefore the check I pointed you to is needed in indicators.
For the MTF indicator, yes you can just Add() a daily series and then calculate the ATR indicator on this BarsArray then.
Comment
-
Can you please be more specific regarding adding a Daily series to an Indicator.
I am using version 6.5.
I read somewhere that you cant create MTF Indicators in the same manner as for Strategies, and that this would be corrected in ver. 7. Is this correct.
Also could you please advise on how to actually add the series, the below gives compile error.
protected override void Initialize()
{
// Compile Error
Add(PeriodType.Daily, 1);
Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Line, "StopInLong"));
Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "TargetLong"));
Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Line, "StopInShort"));
Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "TargetShort"));
CalculateOnBarClose = true;
Overlay = true;
PriceTypeSupported = false;
}
Thankyou
Comment
-
This is the correct approach for NT 6.5 and strategies, this will unfortunately not compile in indicators here, as it's not possible....it was added for NT7.
A good overview on this framework is found here (valid 'prep' for NT7's MultiSeries indicator approach, too) - http://www.ninjatrader-support.com/H...struments.html
Comment
-
Correct, this will work NT 7 only, as NT 6.5 does not support MultiSeries indicators.Originally posted by abfc123 View PostNow I am really confused.
Are you saying that "For the MTF indicator, yes you can just Add() a daily series and then calculate the ATR indicator on this BarsArray then." for ver.7 only?
Thank you
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
633 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
364 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 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
567 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment