Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing Objects cannot be used from compiled assemblies

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

    Drawing Objects cannot be used from compiled assemblies

    A defect appears to exist as of build 5 (and at least as far back as build 4) such that drawing objects cannot be used in NinjaScript code that is exported to compiled assemblies. When the resulting assemblies are reimported, the drawing objects to do not appear.

    As a demonstration, a single line of code can be added to OnBarUpdate():

    protected override void OnBarUpdate()
    {
    // demonstrate drawing a trend line
    if (CurrentBar >= 10) Draw.Line(this, "Test", 10, Close[10], 0, Close[0], Brushes.Blue);
    }

    This will keep a trend line from the close ten bars ago to the current bar close and works fine when run from the source code on a test NT8 installation.

    However, if you export this indicator as a compiled assembly (or a protected assembly) and then install that assembly onto the same or any other NT8 installation, the trend line does not appear.

    This is true for compiled assemblies as well as for protected assemblies.

    Plots do not seem to be affected, nor are calculations - the indicator never gives an exception or any log message and all of the calculated values are correct - the only difference is that drawing objects, including trend lines, rays, horizontal and vertical lines, and regions, simply do not appear on the chart in the compiled (or protected) version as they do in the source version. A copy of the demonstration indicator is attached.

    Thank you for your attention to this! Without a platform fix it means other display methods and not drawing objects must be used for any compiled work.
    Attached Files
    Last edited by QuantKey_Bruce; 09-22-2015, 05:31 AM. Reason: additional clarifications and explanation
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    #2
    Hello Bruce,

    Thank you for writing in. I am currently investigating this issue further and will update you as soon as possible.

    Thank you for your continued patience in the meantime.
    Michael M.NinjaTrader Quality Assurance

    Comment


      #3
      Hello Bruce,

      I have verified this behavior on my end as well and submitted a bug report.

      I will update this thread with further information from our development team when it becomes available.

      Thank you again for your patience in the meantime.
      Michael M.NinjaTrader Quality Assurance

      Comment


        #4
        Thank you.
        Bruce DeVault
        QuantKey Trading Vendor Services
        NinjaTrader Ecosystem Vendor - QuantKey

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        669 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        378 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        580 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X