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 NullPointStrategies, Yesterday, 05:17 AM
              0 responses
              65 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              139 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              75 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              45 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              50 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X