Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SuperDOM MarketDepth Column

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

    SuperDOM MarketDepth Column

    Hello,

    I am trying to create a SuperDom column that would display MarketDepth as a profile. I found information on getting MarketDepth from https://ninjatrader.com/support/help...on_builder.htm but I don't know how to go about this.

    Any advice is greatly appreciated.

    #2
    Hello KINGKODA,

    Thanks for your post.

    If you add the existing Volume column to the Superdom and then change the "type" from "Standard" to "BuySell" and tick "show volume text" that would show the buy/sell volume at each price level (Volume profile). You can use the code of the existing Volume Column as perhaps a starting point.and subscribe to market depth data: https://ninjatrader.com/support/help...arketdepth.htm

    If you need assistance in creating your column, we can provide references to 3rd party programmers who could meet your needs.

    Comment


      #3
      Hello KINGKODA,

      I also wanted to add the references to the help guide for superdom ninjascript: https://ninjatrader.com/support/help...dom_column.htm

      Comment


        #4
        Thank you very much Paul!

        Comment


          #5
          I have not been able to produce any results on NinjaScript Output.

          Here is my code so far.
          Code:
          private SortedDictionary<double, long> Asks;
          private SortedDictionary<double, long> Bids;
          private MarketDepth<MarketDepthRow> marketDepth;
          
          private void OnMarketDepth(object sender, MarketDepthEventArgs e)
          {
               for (int i = 0; i < marketDepth.Asks.Count; i++)
               {Asks.Add(marketDepth.Asks[i].Price, marketDepth.Asks[i].Volume);}
          
               for (int i = 0; i < marketDepth.Bids.Count; i++)
               {Bids.Add(marketDepth.Bids[i].Price, marketDepth.Bids[i].Volume);}
          }
          
          private void OnBarsUpdate(object sender, BarsUpdateEventArgs e)
          {
               foreach(KeyValuePair<double,long> kvp in Asks)
               {Print(string.Format("Asks Price: {0} Volume: {1}", kvp.Key, kvp.Value));}
          
               foreach(KeyValuePair<double,long> kvp in Bids)
               {Print(string.Format(" Bids Price: {0} Volume: {1}", kvp.Key, kvp.Value));}
          }
          Any advice?
          Last edited by KINGKODA; 05-30-2019, 10:14 AM.

          Comment


            #6
            Hello KINGKODA,

            Thanks for your reply.

            Do you have any compile errors?

            If not, do you have any run time errors (as would be found in the "log" tab of the control center)?

            You may want to use additional prints to find out where in the script you have any errors are occurring.

            Comment


              #7
              The error is coming from the Add to SortedDictionary section.

              Comment


                #8
                Hello KINGKODA,

                Thanks for your reply.

                Is this a compile error or a run-time error?

                Can you provide the error message?

                Comment


                  #9
                  Error Message:

                  Failed to call 'Add' method: System.NullReferenceException: Object reference not set to an instance of an object.
                  at NinjaTrader.NinjaScript.SuperDomColumns.Profile.On BarsUpdate(Object sender, BarsUpdateEventArgs e)
                  at NinjaTrader.Data.BarsRequest.OnBarsUpdate(Object sender, BarsUpdateEventArgs e)
                  at NinjaTrader.Data.BarsSeries.Add(Bars bars, Double open, Double high, Double low, Double close, DateTime time, Int64 volume, Double tickSize, Boolean isBar, Double bid, Double ask)

                  Comment


                    #10
                    Hello KINGKODA,

                    Thanks for your reply.

                    I do not see where that error relates to the code you have provided.

                    If I may suggest starting with a new superdom column, as created by the Ninjascript wizard. and then test with the example in the help guide here: https://ninjatrader.com/support/help...arketdepth.htm

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    558 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    324 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    101 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    546 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    547 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X