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

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 arvidvanstaey, Today, 02:19 PM
                4 responses
                10 views
                0 likes
                Last Post arvidvanstaey  
                Started by samish18, 04-17-2024, 08:57 AM
                16 responses
                56 views
                0 likes
                Last Post samish18  
                Started by jordanq2, Today, 03:10 PM
                2 responses
                8 views
                0 likes
                Last Post jordanq2  
                Started by traderqz, Today, 12:06 AM
                10 responses
                18 views
                0 likes
                Last Post traderqz  
                Started by algospoke, 04-17-2024, 06:40 PM
                5 responses
                47 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X