• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cannot Plot High or Low

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

    Cannot Plot High or Low

    Hi,

    I generated a High Price indicator to plot the High Price. And a similar one to plot the Low.

    I used the wizard.

    I only changed the .Set to use High[0] instead of Close[0]

    but it is not the high being plotted, I think it is the Close.

    Same with my low price indicator which uses Low[0] instead of Close[0]

    they both have calculate on close of bar to false.

    how do I fix this?

    #2
    Could you paste in your OnBarUpdate code?
    RayNinjaTrader Customer Service

    Comment


      #3
      protected override void Initialize()
      {
      Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "High"));
      CalculateOnBarClose = false;
      Overlay = true;
      PriceTypeSupported = false;
      }

      /// <summary>
      /// Called on each bar update event (incoming tick)
      /// </summary>
      protected override void OnBarUpdate()
      {
      // Use this method for calculating your indicator values. Assign a value to each
      // plot below by replacing 'Close[0]' with your own formula.
      High.Set(High[0]);
      }

      Comment


        #4
        Looks fine to me.

        I would add some Print() statements to see what is happening.

        Print("Close " + Close[0] + " High " + High[0]);
        RayNinjaTrader Customer Service

        Comment


          #5
          it is definitely using the Close.

          where do the print statements output to?

          however, it is definitely using the Close.. I have no idea why... as you can see, I don't reference Close... I use High[0]

          I attached the file.
          Attached Files

          Comment


            #6
            To the NinjaTrader Output window. Tools > Output Window
            RayNinjaTrader Customer Service

            Comment


              #7
              yeah high and close exactly the same in output window even on 10 min chart.

              Comment


                #8
                There may be a problem in that you are using the property/plot named "High" which already points to the High data series.

                Please change this to something else like MyHigh and see if that makes a difference.
                RayNinjaTrader Customer Service

                Comment


                  #9
                  yes that works...

                  perhaps in C# it is possible for an object to have a default property and that default is Close for the Plot object. don't know anything about ninja script or .net, but I guess that's what's going on. thanks for the help.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Birdseye, Today, 04:52 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post Birdseye  
                  Started by U0000999, Today, 03:43 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post U0000999  
                  Started by NinjaCustomer, Today, 03:22 AM
                  1 response
                  7 views
                  0 likes
                  Last Post NinjaTrader_Marco  
                  Started by MarianApalaghiei, Today, 01:26 AM
                  0 responses
                  9 views
                  0 likes
                  Last Post MarianApalaghiei  
                  Started by seagraph, Yesterday, 03:27 PM
                  0 responses
                  14 views
                  0 likes
                  Last Post seagraph  
                  Working...
                  X