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 Barry Milan, Yesterday, 10:35 PM
                  5 responses
                  16 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by DanielSanMartin, Yesterday, 02:37 PM
                  2 responses
                  13 views
                  0 likes
                  Last Post DanielSanMartin  
                  Started by DJ888, 04-16-2024, 06:09 PM
                  4 responses
                  13 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by terofs, Today, 04:18 PM
                  0 responses
                  12 views
                  0 likes
                  Last Post terofs
                  by terofs
                   
                  Started by nandhumca, Today, 03:41 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post nandhumca  
                  Working...
                  X