Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw.TextFixed will not compile in BarTypes in NT8

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

    Draw.TextFixed will not compile in BarTypes in NT8

    Dear team,

    Although the simple test line:

    Draw.TextFixed(this, "tag1", "Test text", TextPosition.TopRight);

    compiles fine in an Indicator type, it will not compile in a BarTypes type, even when using the same Using declarations.

    The same line in a BarTypes gives the error:
    CS1502 (the method has some invalid arguments)
    CS1503 (indicating that the 'this' key word cannot be converted from NinjaTrader.NinjaScript.BarTypes.xBars to NinjaTrader.NinjaScript.NinjaScriptBase)

    I cannot find anything in the NT8 manual on this.

    Is there a work-around for this ?
    And how can I find out which other methods may / may not work when compiled in different file types ?

    Many Thanks

    #2
    Welcome to the forums Louis365!

    BarsTypes do not inherit from the NinjaScriptBase class like Indicators and Strategies do. As such, Drawing Tools cannot be used here.

    BarsTypes are used only to build Bars objects and are not intended to place a visual indication on a chart. This would be best done using an indicator or creating your own custom ChartStyle which would be used with the custom BarsType.

    ChartStyles use SharpDX rendering and would not use DrawingTools. If you are not familiar with SharpDX rendering, I suggest reviewing the Help Guide information below and following along the SampleCustomRender indicator that comes standard with NinjaTrader. NinjaTrader ChartStyles are also open source and can be referenced for examples. If the SharpDX rendering is too complex, you could build an indicator that uses Drawing Tools to accomplish your goal.

    Using SharpDX for Custom Rendering - https://ninjatrader.com/support/help..._rendering.htm

    ChartStyle documentation - https://ninjatrader.com/support/help...hart_style.htm

    Please let me know if you have any questions.

    Comment


      #3
      Thanks Jim,
      great answer.
      Louis

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      576 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      334 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      553 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X