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 benmarkal, Yesterday, 12:52 PM
          3 responses
          22 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by helpwanted, Today, 03:06 AM
          1 response
          17 views
          0 likes
          Last Post sarafuenonly123  
          Started by Brevo, Today, 01:45 AM
          0 responses
          11 views
          0 likes
          Last Post Brevo
          by Brevo
           
          Started by aussugardefender, Today, 01:07 AM
          0 responses
          6 views
          0 likes
          Last Post aussugardefender  
          Started by pvincent, 06-23-2022, 12:53 PM
          14 responses
          244 views
          0 likes
          Last Post Nyman
          by Nyman
           
          Working...
          X