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 charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          61 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          148 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          162 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          98 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          286 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Working...
          X