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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
133 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
75 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
117 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
113 views
1 like
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
90 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment