Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Searching for the low on an indicator from entry

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

    Searching for the low on an indicator from entry

    Hi all,

    I know this is a somewhat newb question, but I'm stumped.

    I'd like to find the low value of an indicator, not closes. I've checked out the SampleGetHighLowByTimeRange, and it's close to what I would like to do. However, where I'm stumped is applying this to an indicator, for example, the Diff on MACD. If I wanted to see where the lowest Diff is while I'm in the position, how can I do this?

    Thanks!

    #2
    bigfatdrunk, you could look into the MIN and MAX methods for example, those would take dataseries as inputs as well, so you could apply them to indicator like the MACD and Diff.

    Comment


      #3
      Perfect. Thank you, Bertrand, it's working like a charm.

      With a h/t to others who have done it, posting the code:

      MIN((MACD(12,26,9).Diff, bse)[0]);

      bse = BarsSinceEntry

      And, for the record: yes, untrained chimpanzees CAN write better code than me. Thanks for asking.

      Comment


        #4
        You're welcome great to hear it's working well - thanks for sharing your solution here.

        Comment


          #5
          Hello, I'm having some issues in getting the correct syntax for the Lowest Low Value/Highest High Value for a Momentum indicator. I'm used to writing code in JavaScript and going from that to C# is a pain to try and reconfigure indicators.

          In JavaScript I would use the following line of code:

          LLV(10, MOM(20)) = this would give me the lowest low value for the past 10 bars of a 20period momentum indicator. pretty simple.

          What I don't understand is how to lay out the syntax correctly using MIN and MAX methods when getting those MIN or MAX values from an indicator in C#. The references are not very helpful in this respect.

          I think the following is correct but I can't trust it until I know for sure.

          I'm trying to say: "the lowest low value of the 20 period momentum indicator for the last 60 bars.

          MIN(Momentum(20)[60]);

          or

          MIN(Momentum(20,60)[0]);

          or

          MIN((Momentum(20), 60)[0]);


          Which one is it?

          Thanks

          Comment


            #6
            Hello BrianL,

            This is expressed as:
            MIN((Momentum(20), 60)[0]);

            A good way to identify syntax for nested indicators is with our Strategy Wizard. You can create in a point and click interface and then view the code.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_RyanM View Post
              Hello BrianL,

              This is expressed as:
              MIN((Momentum(20), 60)[0]);
              thank you i figured it out
              Last edited by BrianL; 11-02-2010, 04:06 PM.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              576 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              334 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              553 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              551 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X