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

Not done this in a while, need help...

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

    Not done this in a while, need help...

    I've not logged onto this forum in possibly 3 years. I need help with writing a stupid simple indicator.

    First off, I need to figure the number of bars since the last 40 bar high. Not the price, the number of bars ago since it happened.
    Second, the same thing for the number of bars since the last 40 bar low. Same as above, not the price, but the number of bars ago since it happened.

    That's pretty much it. Please post the equation for each for an easy cut n paste.
    Last edited by Darth_Trader; 05-20-2018, 07:12 AM.

    #2
    Check out these help pages,



    Code:
    int LoBarsAgo = LowestBar(Low, 40);
    int HiBarsAgo = HighestBar(High, 40);

    Comment


      #3
      Awesome! Thank You!

      I beat my head against a wall for 2 more hours last night.

      I've been coding professionally for 20+ years, and am simply not a fan of their myopic help file. If you don't already understand how to do everything, then it doesn't help at all.

      I learned Javascript and Python to a professional level in less time than it takes me to try to figure out what's needed literally for an expression and what's a label inside that expression in the help file.

      (I don't care if anyone's opinion is different..keep it to yourself)

      Comment


        #4
        Studying the reference samples and then studying the help file works better ...

        Comment


          #5
          Exactly...

          Which by definition makes the help file a failure.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by ghoul, Today, 06:02 PM
          3 responses
          13 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by jeronymite, 04-12-2024, 04:26 PM
          3 responses
          44 views
          0 likes
          Last Post jeronymite  
          Started by Barry Milan, Yesterday, 10:35 PM
          7 responses
          20 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by AttiM, 02-14-2024, 05:20 PM
          10 responses
          180 views
          0 likes
          Last Post jeronymite  
          Started by DanielSanMartin, Yesterday, 02:37 PM
          2 responses
          13 views
          0 likes
          Last Post DanielSanMartin  
          Working...
          X