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

Highest High

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

    Highest High

    Hello, I'm basically building off of Ninjas Swing High/Low indicator here and was wondering how to reference that highest high bar or lowest low bars info. I would actually like to get the range of the highest high bar and do some calculations from that. I would also like to reference the bar after that swing low to get it's range as well.

    In the attach pic the arrows show the bars to which I'd like to reference. And like the swing high/Low, after a new one is formed, start referencing that new one.

    I'm pretty new to Ninja programming coming over from TS. Sorry if this is a really basic inquiry.
    Attached Files

    #2
    Hi jjthetrader, the swing indicator gives you two methods to work with -

    1. access how many bars ago the swing point occured with SwingHighBar / SwingLowBar

    or

    2. access the current swing value with SwingHigh / SwingLow

    An example call and the needed syntax can be found here - http://www.ninjatrader-support.com/H...eV6/Swing.html
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Should this condition work to only print if the current hugh is greater than the high of the last 4 bars?

      if (High[0] > (MAX(High,4)[0]))


      DrawDiamond( "Buy",false, 0, High[0] + TickSize, Color.ForestGreen);

      Regarding my drawing of the diamond, is there any way to set the size. I may have the wrong input in the initialize section?:
      Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Dot, "Buy"));

      thanks
      Last edited by jjthetrader; 05-14-2009, 12:15 PM.

      Comment


        #4
        Originally posted by jjthetrader View Post
        Should this condition work to only print if the current hugh is greater than the high of the last 4 bars?

        if (High[0] > (MAX(High,4)[0]))

        thanks
        It will never work since MAX includes current. It will work if you change it to:

        if (High[0] > (MAX(High,4)[1]))

        Comment


          #5
          Originally posted by roonius View Post
          It will never work since MAX includes current. It will work if you change it to:

          if (High[0] > (MAX(High,4)[1]))
          much appreciated, that worked!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by pmachiraju, 11-01-2023, 04:46 AM
          8 responses
          149 views
          0 likes
          Last Post rehmans
          by rehmans
           
          Started by mattbsea, Today, 05:44 PM
          0 responses
          5 views
          0 likes
          Last Post mattbsea  
          Started by RideMe, 04-07-2024, 04:54 PM
          6 responses
          33 views
          0 likes
          Last Post RideMe
          by RideMe
           
          Started by tkaboris, Today, 05:13 PM
          0 responses
          5 views
          0 likes
          Last Post tkaboris  
          Started by GussJ, 03-04-2020, 03:11 PM
          16 responses
          3,283 views
          0 likes
          Last Post Leafcutter  
          Working...
          X