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.Line within Indicator Panel

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

    Draw.Line within Indicator Panel

    Hi -- I'm trying to draw a line within the indicator panel NOT the chart panel.

    IsOverlay = false;
    DrawOnPricePanel=false;

    When I use the Draw.Line(this, ....) or Draw.text(this,...) or any of the Draw object functions it doesn't draw anything within the indicator panel.

    Thanks,

    BigSurf

    #2
    Hello bigsurftrader,
    Thanks for your post.

    Do you see any errors on the 'logs' tab of your Control Center? If so, what do they say?

    What overload are you using for Draw.Line and Draw.Text? What are the parameters for that overload?
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Calculate = Calculate.OnBarClose;
      IsOverlay = false;
      DisplayInDataBox = false;
      DrawOnPricePanel = false;
      DrawHorizontalGridLines = true;
      DrawVerticalGridLines = true;
      PaintPriceMarkers = true;
      protected override void OnBarUpdate()
      {
      TradeSet tradeSet = tradeSets.get(Time[0]);

      if (tradeSet !=null){

      Print("Found trade set: " + tradeSet.tradeSetId);

      // Profit
      if (tradeSet.profit > 0)
      Values[Plot_ProfitAbove][0] = tradeSet.profit;
      else if (tradeSet.profit < 0)
      Values[Plot_ProfitBelow][0] = tradeSet.profit;
      else
      Values[Plot_ProfitAbove][0] = tradeSet.profit;

      // MFE
      Values[Plot_MFE][0] = tradeSet.mfe;

      // MAE
      Values[Plot_MAE][0] = tradeSet.mae;

      // Highest MFE
      Values[Plot_hMFE][0] = tradeSet.hMfe;

      // Highest MAE
      Values[Plot_hMAE][0] = tradeSet.hMae;

      Draw.Line(this, "trade " + CurrentBar, false, 10, 1000, 0, 1001, Brushes.LimeGreen, DashStyleHelper.Dot, 2);

      }
      }

      I see no errors in log.

      Comment


        #4
        Do you have example code? Draw a line within the indicator panel?

        Comment


          #5
          Nevermind it works now. I closed the Chart. Opened a new chart. And now it works. Dunno why.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by GussJ, 03-04-2020, 03:11 PM
          11 responses
          3,221 views
          0 likes
          Last Post xiinteractive  
          Started by andrewtrades, Today, 04:57 PM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by chbruno, Today, 04:10 PM
          0 responses
          6 views
          0 likes
          Last Post chbruno
          by chbruno
           
          Started by josh18955, 03-25-2023, 11:16 AM
          6 responses
          436 views
          0 likes
          Last Post Delerium  
          Started by FAQtrader, Today, 03:35 PM
          0 responses
          9 views
          0 likes
          Last Post FAQtrader  
          Working...
          X