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

Dataseries not plotting problem (solved)

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

    Dataseries not plotting problem (solved)

    This isn't a question, just logging for posterity something I learned. Maybe it will help someone in a future google search. I developed an indicator which has some additional dataseries which I would put values in on a certain bars.

    This plotted fine and I continued work on my indicator. After a time I noticed that it was no longer drawing the dataseries dots as it had before although it was still drawing custom labels I drew via DrawText. I couldn't figure out what I had changed (if anything) to cause them to not draw. It was mysterious and driving me crazy.

    Finally I realized that I had overridden the Plot method and I did not call the base.Plot. Adding the call to the base class's Plot method immediately fixed it.

    public override void Plot(Graphics graphics,
    Rectangle bounds, double min, double max)
    {
    // I had forgot the following line!!
    base.Plot(graphics, bounds, min, max);
    ...
    // your code

    #2
    Originally posted by overflowing View Post
    This isn't a question, just logging for posterity something I learned. Maybe it will help someone in a future google search. I developed an indicator which has some additional dataseries which I would put values in on a certain bars.

    This plotted fine and I continued work on my indicator. After a time I noticed that it was no longer drawing the dataseries dots as it had before although it was still drawing custom labels I drew via DrawText. I couldn't figure out what I had changed (if anything) to cause them to not draw. It was mysterious and driving me crazy.

    Finally I realized that I had overridden the Plot method and I did not call the base.Plot. Adding the call to the base class's Plot method immediately fixed it.
    Interesting... can you post a sample image of what it was before and after?

    Of course, remove any logic related to your secrets..

    Comment


      #3
      Sure this is before, without the call to base.Plot():

      Click image for larger version

Name:	indicator-without-base-plot.jpg
Views:	1
Size:	3.2 KB
ID:	869095

      And this is the indicator after adding the call to base.Plot() (the dot is the dataseries with the plot style set to Dot):

      Click image for larger version

Name:	indicator-with-base-plot.jpg
Views:	1
Size:	3.3 KB
ID:	869096

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      3 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      238 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      384 views
      1 like
      Last Post Gavini
      by Gavini
       
      Started by oviejo, Today, 12:28 AM
      0 responses
      4 views
      0 likes
      Last Post oviejo
      by oviejo
       
      Started by pechtri, 06-22-2023, 02:31 AM
      10 responses
      125 views
      0 likes
      Last Post Leeroy_Jenkins  
      Working...
      X