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!
See more
See less

Partner 728x90

Collapse

Trend from one point to another

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

    Trend from one point to another

    Is there an easy way (beside programming a loop) to check if a value has trended only down from a given point? I don't need nbarnsdown/up because the numbers of bars can vary.

    Example: I want to know if a stochastic has only traveled down when it hits 20 and started at 80. I just need to know which bar 80 started at.

    Maybe the better question is how can I find out which bar a value was reached or exceeded.

    Regards/Danke

    Cliff

    #2
    You can try using the CrossAbove or CrossBelow condition along with MRO.



    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh

      Thanks for the reply. That will give me the bar when the value was reached or exeeded. Got it.

      And this use this value for nbarsup/down to verify there were no opposite trending bars in the period?

      Comment


        #4
        That will give you the bar that it got to your threshold value and then you will have to run some logic to come back and test if there were any counter trending bars. Only way I can think of to do this check is with a loop though. You will get the bar # of the threshold. Just use a counter that goes from 0 up to that bar # and check all those bars for a counter trend. If a counter trend happens then stop the loop and stop the trade I suppose.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Got it. Thanks.

          Comment


            #6
            Dog food, MRO will NOT work on multi-time frame strategies. Mine is.

            Comment


              #7
              Then you might need to resort to loops.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Thanks, doing it now.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by geddyisodin, Today, 05:20 AM
                2 responses
                16 views
                0 likes
                Last Post geddyisodin  
                Started by hazylizard, Today, 08:38 AM
                0 responses
                6 views
                0 likes
                Last Post hazylizard  
                Started by Max238, Today, 01:28 AM
                5 responses
                42 views
                0 likes
                Last Post Max238
                by Max238
                 
                Started by giulyko00, Yesterday, 12:03 PM
                3 responses
                13 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by habeebft, Today, 07:27 AM
                1 response
                16 views
                0 likes
                Last Post NinjaTrader_ChristopherS  
                Working...
                X