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

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:

                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  Ah man, thanks so much!

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by maybeimnotrader, Today, 05:46 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post maybeimnotrader  
                  Started by quantismo, Today, 05:13 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post quantismo  
                  Started by AttiM, 02-14-2024, 05:20 PM
                  8 responses
                  166 views
                  0 likes
                  Last Post jeronymite  
                  Started by cre8able, Today, 04:22 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post cre8able  
                  Started by RichStudent, Today, 04:21 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post RichStudent  
                  Working...
                  X