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 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 lorem, Today, 09:18 AM
          1 response
          4 views
          0 likes
          Last Post lorem
          by lorem
           
          Started by bmartz, Today, 09:30 AM
          0 responses
          2 views
          0 likes
          Last Post bmartz
          by bmartz
           
          Started by GussJ, 03-04-2020, 03:11 PM
          14 responses
          3,244 views
          0 likes
          Last Post GussJ
          by GussJ
           
          Started by ArkansasClint, Today, 09:28 AM
          0 responses
          0 views
          0 likes
          Last Post ArkansasClint  
          Started by hazylizard, Today, 08:38 AM
          4 responses
          12 views
          0 likes
          Last Post hazylizard  
          Working...
          X