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

draw dots on panel

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

    draw dots on panel

    Hi,
    I created a plot in the indicator wizard, but it doesn't draw anything unless i add, under the logic:

    Draw.Dot(this, "tag1"+ CurrentBar, false, 0, Low[0], Brushes.Orange);

    and this only draws dots under the low of the bars.
    What do i put instead of Low[0] to get it to draw the dots in their own panel on a flat horizontal level?

    Here's the code:

    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Description = @"Enter the description for your new custom Indicator here.";
    Name = "squeezeDots";
    Calculate = Calculate.OnBarClose;
    IsOverlay = false;
    DisplayInDataBox = true;
    DrawOnPricePanel = false;
    DrawHorizontalGridLines = true;
    DrawVerticalGridLines = true;
    PaintPriceMarkers = true;
    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(new Stroke(Brushes.Orange, 2), PlotStyle.Dot, "Dotz");
    }
    else if (State == State.Configure)
    {

    {

    }

    }
    }

    protected override void OnBarUpdate()
    {
    if (CurrentBars[0] < 1)
    return;


    if ((Bollinger(Close, 2, 14).Upper[0] < KeltnerChannel(Close, 1.5, 10).Upper[0])
    && (Bollinger(Close, 2, 14).Lower[0] > KeltnerChannel(Close, 1.5, 10).Lower[0]))
    {

    Draw.Dot(this, "tag1"+ CurrentBar, false, 0, Low[0], Brushes.Orange);
    }
    }


    How am I making this more complicated than it has to be?


    #2
    Hello trader3000a,

    To have an indicator plot appear in its own panel, use IsOverlay false, or set the Panel to New panel in the indicator parameters.
    https://ninjatrader.com/support/help.../isoverlay.htm

    For a drawing object to appear in a different panel, DrawOnPricePanel must be false.
    https://ninjatrader.com/support/help...pricepanel.htm

    To have an indicator plot show, the values for it need to be set on each bar.
    https://ninjatrader.com/support/help.../nt8/value.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea, If you look at the code section I sent, the IsOverlay and DrawOnPricePanel are already set to false. Nothing gets drawn when I set this indicator to it's own panel

      Comment


        #4
        Hello trader3000a,

        Are you certain the drawing objects are not being drawn? I see that auto scaling is off and they could be drawn outside of the viewable area of the panel..

        To confirm, these are not appearing in the Draw Objects window if you right-click the chart and select Drawing Tools -> Drawing Objects?

        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DouglasHogan, Today, 02:12 AM
        0 responses
        2 views
        0 likes
        Last Post DouglasHogan  
        Started by SydniBuck, Today, 12:54 AM
        0 responses
        7 views
        0 likes
        Last Post SydniBuck  
        Started by ketostrongbuyno, Yesterday, 11:50 PM
        0 responses
        10 views
        0 likes
        Last Post ketostrongbuyno  
        Started by ReinaKutch, Yesterday, 11:08 PM
        0 responses
        9 views
        0 likes
        Last Post ReinaKutch  
        Started by JackyThur, Yesterday, 10:51 PM
        0 responses
        10 views
        0 likes
        Last Post JackyThur  
        Working...
        X