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

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 algospoke, Today, 06:40 PM
                  0 responses
                  9 views
                  0 likes
                  Last Post algospoke  
                  Started by maybeimnotrader, Today, 05:46 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post maybeimnotrader  
                  Started by quantismo, Today, 05:13 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post quantismo  
                  Started by AttiM, 02-14-2024, 05:20 PM
                  8 responses
                  168 views
                  0 likes
                  Last Post jeronymite  
                  Started by cre8able, Today, 04:22 PM
                  0 responses
                  10 views
                  0 likes
                  Last Post cre8able  
                  Working...
                  X