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.


    For a drawing object to appear in a different panel, DrawOnPricePanel must be false.


    To have an indicator plot show, the values for it need to be set on each bar.
    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 wzgy0920, Today, 09:53 PM
        0 responses
        3 views
        0 likes
        Last Post wzgy0920  
        Started by mgco4you, Today, 09:46 PM
        1 response
        2 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Rapine Heihei, Today, 08:19 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Rapine Heihei, Today, 08:25 PM
        0 responses
        6 views
        0 likes
        Last Post Rapine Heihei  
        Started by f.saeidi, Today, 08:01 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X