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

Indicator Plot Disappeared after adding buttons to toolbar

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

    Indicator Plot Disappeared after adding buttons to toolbar

    Hello, I am including my .cs file on this one.

    I have my indicator which adds buttons to the tool bar to toggle on/off plots for currentOHL and priorOHLC, along with other buttons to help with tedious tasks.

    The problem I am having is when I add the buttons to the indicator, the current and prior plots disappear. The price tags are still there, and there is data in the data box however invisible plots.

    Now this is supposed to be my next step (To toggle on/off the plots w/ transparent brush) but I haven't even added this code yet! I have tried coding this in reverse i.e building the buttons then adding the indicator after, same result.

    Please help! much appreciated.

    ps. the indicators should load right away with colored plots, this will make the button names out of sync. I am aware of this and will fix later
    Attached Files

    #2
    Hello BeachTrader11807,

    Thank you for your inquiry.

    It looks like OnRender() is empty in your script. If you want to use OnRender() to render lines on your chart, you will need to add the code to make sure standard plots will also render in OnRender().

    Please see the below code snippet and Tip from the Help Guide:

    Code:
    protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
    
    {
    
    // call the base.OnRender() to ensure standard Plots work as designed
    
    base.OnRender(chartControl, chartScale);
    
    
    
    // custom render logic
    
    }


    "Tip:

    •If you are using standard Plots along with custom rendering from an indicator or strategy, you will need to ensure to call the base.OnRender() method for those plots to display."


    OnRender() - https://ninjatrader.com/support/help...8/onrender.htm
    SharpDX Lines and Shapes - https://ninjatrader.com/support/help...LinesAndShapes

    You can also take a look at the SampleCustomRender indicator included in NinjaTrader that demonstrates using OnRender / SharpDX.

    Please let me know if you have any other questions.
    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      Thank you NinjaTrader_Gaby

      OnRender() was some old code which I am not in need of. It works perfectly now! much appreciated.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Fitspressorest, Today, 01:38 PM
      0 responses
      2 views
      0 likes
      Last Post Fitspressorest  
      Started by Jonker, Today, 01:19 PM
      0 responses
      2 views
      0 likes
      Last Post Jonker
      by Jonker
       
      Started by futtrader, Today, 01:16 PM
      0 responses
      6 views
      0 likes
      Last Post futtrader  
      Started by Segwin, 05-07-2018, 02:15 PM
      14 responses
      1,791 views
      0 likes
      Last Post aligator  
      Started by Jimmyk, 01-26-2018, 05:19 AM
      6 responses
      844 views
      0 likes
      Last Post emuns
      by emuns
       
      Working...
      X