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
MIN and MAX
Collapse
X
-
MIN and MAX
I am using MIN(3)[0] and MAX(3)[0] in my Strategy and it seems it is not placing them in the right spot. If 0 is the bar that just opened and 1 was the bar that just closed and on which the calculation was done then I do not see the stops being placed at high/low of Bar 3.
Thank you.Tags: None
-
Hello Trader17.
Thanks for the post.
I would advise confirming that the MIN and MAX methods are outputting the correct value. I have attached a script that demonstrates simple debugging of this.
You might want to evaluate the maximum high in the High series and the minimum low in the Low series. You can do that like so:
Code:Print("The maximum price 3 bars ago was " + MAX(High,3)[0]); Print(""); Print("The minimum price 3 bars ago was " + MIN(Low,3)[0]);
Attached FilesLast edited by NinjaTrader_ChrisL; 10-25-2018, 02:10 PM.Chris L.NinjaTrader Customer Service
- Likes 1
-
Maybe I am using the wrong indicator. I do not want to the minimum 3 bars ago, rather I want the highest high or lowest low of the last X bars. So MIN and MAX look for a specific number bar ho or lo, correct? I want the highest or lowest in a series of bars.
Thank you.
Comment
-
Hello Trader17,
I added that as an addendum to my last post. You can pass in the Low or High series into the Min or Max functions.
Code:Print("The maximum price 3 bars ago was " + MAX(High,3)[0]); Print(""); Print("The minimum price 3 bars ago was " + MIN(Low,3)[0]);
Chris L.NinjaTrader Customer Service
- Likes 1
Comment
-
Thank you very much. And I just realized that I could also probably use the Donchian Channel in the stop as an indicator because it achieves similar outcome. Am I right? Either I pass the Low or High series in the MIN or MAX functions or use the Donchian Channel.
Thank you.Last edited by Trader17; 10-25-2018, 06:31 PM.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by andrewtrades, Today, 04:57 PM
|
1 response
8 views
0 likes
|
Last Post Today, 05:02 PM | ||
Started by chbruno, Today, 04:10 PM
|
0 responses
5 views
0 likes
|
Last Post
by chbruno
Today, 04:10 PM
|
||
Started by josh18955, 03-25-2023, 11:16 AM
|
6 responses
436 views
0 likes
|
Last Post
by Delerium
Today, 03:42 PM
|
||
Started by FAQtrader, Today, 03:35 PM
|
0 responses
7 views
0 likes
|
Last Post
by FAQtrader
Today, 03:35 PM
|
||
Started by rocketman7, Today, 09:41 AM
|
5 responses
19 views
0 likes
|
Last Post Today, 03:33 PM |
Comment