Thank you.
Announcement
Collapse
No announcement yet.
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:
Please let me know if you have any questions.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.
- 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.
Please let me know if I can assist further.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]);
- 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 NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
54 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
130 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
72 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
44 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
49 views
0 likes
|
Last Post
|

Comment