• 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

Highlight settlement in Price column on DOM

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

    Highlight settlement in Price column on DOM

    I'm using the Rithmic datafeed, so settlement prices are available. I was able to get it on MarketAnalyzer, is possible to highlight the settlement price in the price column on the SuperDOM?

    #2
    Hello funk101,

    Thanks for your post.

    It is possible but would require custom coding through an indicator that could be added to the Superdom, however as an indicator it could only place a line at the settlement price level. In the custom indicator, you would add daily bars and then plot the close value of the bar (which would be the settlement price as the daily bars are adjusted to show the close as the settlement price).

    If I understand correctly you are wanting to shade the superdom cell similar to how the daily High/Low markers do. I will write a feature request to add this capability to the superdom. I will update this thread when I have further information on the feature request.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hello funk101,

      The feature request to add the daily settlement price as a cell marker to the superdom has been assigned as SFT-2887, "Show settlement price on SuperDOM"

      Thanks for your interest in improving NinjaTrader8.
      Paul H.NinjaTrader Customer Service

      Comment


        #4
        Thanks. I wonder how big that list is ;-)

        Comment


          #5
          Getting a memory error on this "settlement" code...

          Error:
          Failed to call OnRender() for chart object 'Horizontal Line': 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

          Code:
          protected override void OnMarketData(MarketDataEventArgs m)
          {
          	if (m.MarketDataType == MarketDataType.Settlement)
          		settlement = m.Price;
          	Value[0] = settlement;
          	Draw.HorizontalLine(this, "settlement", settlement, Brushes.Goldenrod);
          }

          Comment


            #6
            Hello funk101,

            Thanks for your post.

            Move your plot and draw statements into OnbarUpdate().

            Alternatively, to getting the settlement price in that manner, you can just add a day bar series and access the close price as the close price should = settlement price of the daily bars. You can verify if this is the case by comparing the close price of the bar with the exchanges settlement price for the instrument of interest.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Ok, so, this?
              Code:
              ...else if (State == State.Configure)
              			{
              				AddDataSeries(BarsPeriodType.Day, 1);
              			}
              ...and then this? (this gives me the wrong closing price. Please advise)

              Code:
              protected override void OnBarUpdate()
              		{
              			
              			double settlement = BarsArray[1].GetClose(0);
              			Value[0] = settlement;
              			Print ("settlement: "+settlement);
              			Draw.HorizontalLine(this, "settlement", settlement, Brushes.Goldenrod);
              		}

              Comment


                #8
                Hello funk101,

                Thanks for your reply.

                If you are using Calculate.OnBarClose, use: double settlement = Closes[1][0]; // get prior day close/settlement.

                If you are using Calculate.OnEachTick or Calculate.OnPriceChange, use: double settlement = Closes[1][1]; // get prior day close/settlement.

                GetClose() is intended for chart bars in OnRender.

                References:
                https://ninjatrader.com/support/help...us/?closes.htm
                https://ninjatrader.com/support/help...nstruments.htm
                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  Ah man, thanks so much!

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Erwin Beckers, Today, 01:23 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post Erwin Beckers  
                  Started by Mark Taylor, Yesterday, 11:36 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post Mark Taylor  
                  Started by Bluebeep, Yesterday, 08:38 PM
                  0 responses
                  10 views
                  0 likes
                  Last Post Bluebeep  
                  Started by stokhastic, Yesterday, 07:08 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post stokhastic  
                  Started by jlkramer16, Yesterday, 04:29 PM
                  1 response
                  5 views
                  0 likes
                  Last Post jlkramer16  
                  Working...
                  X