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 jeronymite, 04-12-2024, 04:26 PM
          2 responses
          28 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by Mindset, 05-06-2023, 09:03 PM
          10 responses
          262 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by michi08, 10-05-2018, 09:31 AM
          5 responses
          741 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by The_Sec, Today, 02:29 PM
          0 responses
          2 views
          0 likes
          Last Post The_Sec
          by The_Sec
           
          Started by tsantospinto, 04-12-2024, 07:04 PM
          4 responses
          62 views
          0 likes
          Last Post aligator  
          Working...
          X