• 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

Indicator disappears from the chart

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

    #16
    Thank you very much. I will test the example .

    Comment


      #17
      Hello ! I did a test with Example and seems to be better than mine, but not I am getting these problems .

      In Drawstring I used :

      Code:
      graphics.DrawString ( "" + bidRows [ 0] .Price , font , brush , new Point ( (left + whidh ) (top + heigh * 17) ) ) ;
      Where bidRows [ 0] .Price part of a Collection .

      Nome do parametro : índice
      em System.ThrowHelper.ThrowArgumentOutOfRangeExceptio n ( argumento ExceptionArgument , recurso ExceptionResource )
      em System.ThrowHelper.ThrowArgumentOutOfRangeExceptio n ()
      em System.Collections.Generic.List`1.get_Item (índice Int32)
      em NinjaTrader.Indicator.DynamycDOM.Plot (gráficos Gráficos, limites Rectângulo, Duplo min , max Duplo)
      2016/06/06 15:54:20 System.ArgumentOutOfRangeException : O índice estava fora do Intervalo . ELE DEVE Ser Não- negativo e menor that o * Tamanho da Coleção .

      Comment


        #18
        Hello Jonatan,

        There is information missing from this that is preventing me from assisting.

        bidRows[0].Price

        What kind of class is this that has a Price property?

        Can you show me the class declaration for whatever class type bidRows is. Also the declaration for the bidRows object itself?

        Have you added prints to show that every variable you are passing to the graphics.DrawString() is a valid object?

        Can we see the output from these prints?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #19
          Okay. I'm just sending the declaration of variables. The code compiles without errors.
          If not compile with you may be missing keys , only

          Code:
          #region Using declarations
          using System;
          using System.Diagnostics;
          using System.Drawing;
          using System.Drawing.Drawing2D;
          using System.ComponentModel;
          using System.Xml.Serialization;
          using NinjaTrader.Cbi;
          using NinjaTrader.Data;
          using NinjaTrader.Gui.Chart;
          #endregion
          
          // Add this to the declarations. It Allows for the use of ArrayLists.
          using System.Collections.Generic;
          
          // This namespace holds all indicators and is required. Do not change it.
          namespace NinjaTrader.Indicator
          {
              /// <Summary>
              /// Sample Demonstrating how you can store your own data book.
              /// </ Summary>
              [Description ( "Dynamic DOM")]
              public class DynamycDOM: Indicator
              {
                  #region Variables
          
          private List <LadderRow> askRows = new List <LadderRow> ();
          private List <LadderRow> bidRows = new List <LadderRow> ();
          
          private bool firstAskEvent = true;
          private bool firstBidEvent = true;
          
                  #endregion
          
          /// This collapsed section contains code to generate your own Level II book the SampleMarketDepth shown in the reference.
          #region Level II Book
          
          /// <Summary>
          /// This class holds a row of the bid or ask ladder.
          /// </ Summary>
          private class LadderRow
          {
          public string MarketMaker; // Relevant for only stocks
          public double Price;
          public long Volume;
          
          public LadderRow (double myPrice, long myVolume, string myMarketMaker)
          {
          MarketMaker = myMarketMaker;
          Price = myPrice;
          Volume = myVolume;
          }
          }
          }}

          Comment


            #20
            Hello Jonatan,

            I would not be able to compile your script without the complete script.

            However, the error looks like an index error with the list possibly.

            Are you doing any checks for null before calling an index of each list?

            Have you added prints to show the value of every variable you are passing to the graphics.DrawString()?

            Can we see the output from these prints?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #21
              It has a specific e- mail to send the complete project ?
              Sorry disorders

              Comment


                #22
                Hi Jonatan,

                The NinjaTrader Support email (for all support questions) is platformsupport [at] ninjatrader [dot] com.

                However, if you do send in your script, be sure that you include the prints and the output that I have requested from this thread. In the support department at NinjaTrader we do not create, debug, or modify code for our clients. This is so that we can maintain a high level of service for all of our clients as well as our partners
                You can also contact one of our professional NinjaScript Consultants who would be eager to create or modify this script at your request or assist you with your script. Please let me know if you would like our business development follow up with you with a list of professional NinjaScript Consultants who would be happy to create this script or any others at your request.

                That said, if you can post the code of the print you have created along with the output of the print, this will let us know that all variables being called have a valid value. This is known as debugging.

                Most likely you are calling an index of the list without any check that index has been set first.

                Are you doing any checks for the count of the list being greater than the index being called before calling an index on each list?

                Have you added prints to show the value of every variable you are passing to the graphics.DrawString()?

                Can we see the output from these prints?
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by TraderCAD, Today, 04:27 PM
                1 response
                3 views
                0 likes
                Last Post TraderCAD  
                Started by DavidHP, Today, 04:11 PM
                0 responses
                1 view
                0 likes
                Last Post DavidHP
                by DavidHP
                 
                Started by alexstox, 03-24-2019, 01:07 PM
                6 responses
                54 views
                0 likes
                Last Post NinjaTrader_PatrickG  
                Started by fredfred, Today, 11:29 AM
                3 responses
                11 views
                0 likes
                Last Post NinjaTrader_JoshG  
                Started by swcooke, Today, 10:38 AM
                3 responses
                11 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X