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 Waxavi, Today, 02:00 AM
          0 responses
          2 views
          0 likes
          Last Post Waxavi
          by Waxavi
           
          Started by elirion, Today, 01:36 AM
          0 responses
          4 views
          0 likes
          Last Post elirion
          by elirion
           
          Started by gentlebenthebear, Today, 01:30 AM
          0 responses
          4 views
          0 likes
          Last Post gentlebenthebear  
          Started by samish18, Yesterday, 08:31 AM
          2 responses
          9 views
          0 likes
          Last Post elirion
          by elirion
           
          Started by Mestor, 03-10-2023, 01:50 AM
          16 responses
          391 views
          0 likes
          Last Post z.franck  
          Working...
          X