Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Hide drawing but not value in data box

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

    Hide drawing but not value in data box

    Hi,
    I wrote indicator that shows bar value in $ (very useful to determinate risk), I click on mouse wheel and it shows value. Works good on ES tick chart until I switch to daily ES. I see this line. Is any way to hide it but not value on mouse wheel data box? I tried transparent color, uncheck visible box but it hides value in box.

    namespace NinjaTrader.NinjaScript.Indicators
    {
    public class ATR3 : Indicator
    {
    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Description = @"Enter the description for your new custom Indicator here.";
    Name = "ATR3";
    Calculate = Calculate.OnBarClose;
    IsOverlay = false;
    DisplayInDataBox = true;
    DrawOnPricePanel = true;
    DrawHorizontalGridLines = true;
    DrawVerticalGridLines = true;
    PaintPriceMarkers = false;
    ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
    //Disable this property if your indicator requires custom values that cumulate with each new market data event.
    //See Help Guide for additional information.
    IsSuspendedWhileInactive = true;
    AddPlot(Brushes.DodgerBlue, "$");
    }
    else if (State == State.Configure)
    {
    }
    }

    protected override void OnBarUpdate()
    {
    if (CurrentBar < 1) return;
    Value[0] = (High[0]-Low[0])*Instrument.MasterInstrument.PointValue;
    //Add your custom indicator logic here.
    }
    }
    }

    Attached Files
    Last edited by Leeroy_Jenkins; 12-19-2019, 12:21 PM. Reason: wrong screenshot

    #2
    Hello Leeroy_Jenkins,

    I believe the most simple way to hide the plot while still keeping its color and in the data box would be to override the OnRender method and not call base:

    Code:
    protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
    {
    //base.OnRender(chartControl, chartScale); // commented out so we don't call base
    }
    This will hide the plots having this syntax in your script.


    I look forward to being of further assistance.

    Comment


      #3
      NinjaTrader_Jesse, Thanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      70 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      152 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      100 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      288 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X