Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MIN and MAX

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.
    Attached Files

    #2
    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]);
    Please let me know if you have any questions.
    Attached Files
    Last edited by NinjaTrader_ChrisL; 10-25-2018, 02:10 PM.

    Comment


      #3
      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


        #4
        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]);
        Please let me know if I can assist further.

        Comment


          #5
          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


            #6
            Hello Trader17,

            Thank you for the reply.

            You could use the Donchain Channel since it gives the highest highs and lowest lows of a selected period.

            Please let me know if I can assist further.

            Comment


              #7
              Got it. Thank you very much.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Mindset, 04-21-2026, 06:46 AM
              0 responses
              93 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by M4ndoo, 04-20-2026, 05:21 PM
              0 responses
              138 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Started by M4ndoo, 04-19-2026, 05:54 PM
              0 responses
              68 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Started by cmoran13, 04-16-2026, 01:02 PM
              0 responses
              123 views
              0 likes
              Last Post cmoran13  
              Started by PaulMohn, 04-10-2026, 11:11 AM
              0 responses
              73 views
              0 likes
              Last Post PaulMohn  
              Working...
              X