Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw from AddOn

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

    Draw from AddOn

    I'm trying to use Draw.TextFixed on an AddOn to try to share it on my scripts.

    This doesn't comiple as it mentions the overloaded method has invalid arguments.


    Code:
    System.Windows.Media.Brushes brushes;
    ChartControl chartControl = new ChartControl();
    Draw.TextFixed(this,"APNL","Trades",TextPosition.BottomLeft,chartControl.Properties.ChartText, chartControl.Properties.LabelFont, Brushes.LightBlue, Brushes.Transparent, 0);

    If I remove the Draw Section it will compile.

    THanks!
    Last edited by r3n3v; 09-12-2021, 06:28 PM.

    #2
    Hello r3n3v,

    Only indicators and strategies can call Draw methods and these must be applied to a chart. Unfortunately, addons are not associated with a chart, it's ChartControl, or any data series.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      So if I change it to a partial class from an Indicator it should work?

      Comment


        #4
        Hello r3n3v,

        Yes, a partial class extending the Indicator class would have indicator methods available.
        Last edited by NinjaTrader_ChelseaB; 09-13-2021, 11:49 AM.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Excellent! Thanks!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          627 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          359 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          562 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          568 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X