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 adeelshahzad, Today, 03:54 AM
          5 responses
          32 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by stafe, 04-15-2024, 08:34 PM
          7 responses
          32 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by merzo, 06-25-2023, 02:19 AM
          10 responses
          823 views
          1 like
          Last Post NinjaTrader_ChristopherJ  
          Started by frankthearm, Today, 09:08 AM
          5 responses
          20 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by jeronymite, 04-12-2024, 04:26 PM
          3 responses
          43 views
          0 likes
          Last Post jeronymite  
          Working...
          X