Thanks.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
HighestBar(High,Length)[x]
Collapse
X
-
HighestBar(High,Length)[x]
I'm trying to reference the High or Low value of a DataSeries starting from a lookback period which is not the Current Bar (ie High[HighestBar(High,lookback)[x]]. I tried creating a DataSeries for HighestBar but all DataSeries are created as double yet previous data references are referenced as [int]. Any suggestions on how to accomplish this?
Thanks.Tags: None
-
Hawk Arps,
Are you attempting to store the index as well as the value or just the value of the highest high over lookback?
A simple dataseries should work in the latter cast, you just use MyDataseries.Set( High[HighestBar(High,lookback)] )
High[HighestBar(High,lookback)[x]] is incorrect, the HighestBar() function returns only 1 integer, not an array.
Please let me know if I may assist further.Adam P.NinjaTrader Customer Service
-
That is what MAX() and MIN() are used to do.Originally posted by Hawk Arps View PostI'm trying to reference the High or Low value of a DataSeries starting from a lookback period which is not the Current Bar (ie High[HighestBar(High,lookback)[x]]. I tried creating a DataSeries for HighestBar but all DataSeries are created as double yet previous data references are referenced as [int]. Any suggestions on how to accomplish this?
Thanks.
Comment
-
-
I am not going to call an indicator. All I wanna do is to get the maximum high of 5 bars back within my strategy and compare it to the current bar high so that I can put an order at the higher price.Originally posted by koganam View PostAll indicator methods can be called from a strategy.
Comment
-
-
Follow-Up question
So, how would you get the index (how far back) for the MAX value?Originally posted by NinjaTrader_AdamP View PostHawk Arps,
Are you attempting to store the index as well as the value or just the value of the highest high over lookback?
A simple dataseries should work in the latter cast, you just use MyDataseries.Set( High[HighestBar(High,lookback)] )
High[HighestBar(High,lookback)[x]] is incorrect, the HighestBar() function returns only 1 integer, not an array.
Please let me know if I may assist further.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
579 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 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
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment