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

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.
    JesseNinjaTrader Customer Service

    Comment


      #3
      NinjaTrader_Jesse, Thanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ETFVoyageur, 05-07-2024, 07:05 PM
      16 responses
      129 views
      0 likes
      Last Post bltdavid  
      Started by ETFVoyageur, Today, 10:13 PM
      1 response
      6 views
      0 likes
      Last Post ETFVoyageur  
      Started by somethingcomplex, Today, 10:36 PM
      0 responses
      6 views
      0 likes
      Last Post somethingcomplex  
      Started by sofortune, Yesterday, 10:28 AM
      5 responses
      22 views
      0 likes
      Last Post sofortune  
      Started by guyonabuffalo, Today, 10:01 PM
      0 responses
      2 views
      0 likes
      Last Post guyonabuffalo  
      Working...
      X