Thank you.
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Donchian Channel
Collapse
X
-
Donchian Channel
In Strategy Builder if I want to compare the high or close of the last bar (1) to say the highest high or close of the prior 5 bars (2 through 6) is it possible? I think I can use the Donchian Channel for the highest high but can it also be used in comparing closes?
Thank you.Tags: None
-
Hello Trader17,
Thanks for your additional question.
It would be possible to use the MAX and MIN indicators to return the highest high and the lowest low from a requested period of time based off of the desired input series. For example, you could use High as Input for MAX for the the "Highest high" in a requested period of time. You could use Close as the input series as well.
The indicator would be set up similarly where you would be looking at a bars ago reference to retrieve a value, and the period would be how far back to look from that point. So a bars ago index of 2 and a period of 5 would be the indicator value given from the bar before last, going back 5 bars.
In case you have not seen the Strategy Builder 301 tutorial, I highly recommend viewing it to learn the ins and outs of the Strategy Builder.
Strategy Builder 301 - https://www.youtube.com/watch?v=HCyt90GAs9k
I will also include documentation links for MAX and MIN if you wish to reference further how these methods work.
Max - https://ninjatrader.com/support/help...aximum_max.htm
Min - https://ninjatrader.com/support/help...inimum_min.htm
If you have any additional questions, please don't hesitate to ask.JimNinjaTrader Customer Service
-
Hello Trader17,
I am not entirely clear on what you mean by "So the indicator value is the bars to look for." An indicator will return a value depending on its bars Ago reference and the amount of data it should look at which would be the period. The bars Ago would refer to complete indicator calculations based on the input data.
Code:double value = MAX(High, 20)[0];
Code:double value = MAX(High, 20)[1];
Displacement refers to how that plot should be visually offset, into the future.
I've included documentation on Displacement for your reference - https://ninjatrader.com/support/help...splacement.htm
If there is something you would like clarified on indicator plots, please let me know.JimNinjaTrader Customer Service
Comment
-
Yes, the number of bars you want to use in the calculation would be the Period and the point you want to look back from would be the barAgo value.
Max(High, Period)[barsAgo]
Max(High, 7)[3]
Max(High, 5)[3]
Keep in mind, a barsAgo index starts at the current bar going backwards. Using CurrentBar in a barsAgo reference can reference the first bar that is drawn in the data series.
CurrentBar - https://ninjatrader.com/support/help...currentbar.htm
Please let me know if you have any additional questions.JimNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by zstheorist, Today, 07:52 PM
|
0 responses
3 views
0 likes
|
Last Post
by zstheorist
Today, 07:52 PM
|
||
Started by pmachiraju, 11-01-2023, 04:46 AM
|
8 responses
149 views
0 likes
|
Last Post
by rehmans
Today, 06:44 PM
|
||
Started by mattbsea, Today, 05:44 PM
|
0 responses
5 views
0 likes
|
Last Post
by mattbsea
Today, 05:44 PM
|
||
Started by RideMe, 04-07-2024, 04:54 PM
|
6 responses
33 views
0 likes
|
Last Post
by RideMe
Today, 05:31 PM
|
||
Started by tkaboris, Today, 05:13 PM
|
0 responses
5 views
0 likes
|
Last Post
by tkaboris
Today, 05:13 PM
|
Comment