Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing Object Properties UI Error?

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

    Drawing Object Properties UI Error?

    Hello

    I have a class that extends Drawing tool..."Line" specifically. Works fine till I try to change a property in the UI Drawing Objects Property Inspector.

    Even anchor values that are inherited from Line. Even when my OnStateChange() doesn't do anything but call base.OnStateChange()
    So shouldn't "Line" handle its own property changes?

    The error I get on changing a property an clicking Apply is:
    "Failed to call onRender for chart object 'Name': "Value cannot be null. Parameter name chartControl"

    I read through the Drawing Object Properties UI Section in Best Practices but I seem to be meeting those...
    Can you please supply more info about this error?

    #2
    Hello SmartArtsStudio,

    Thank you for the post.

    Do you have a sample that you can provide so that we can see what modifications you have made? Are you making a class in the same way as the other types that inherit from Line? The Lines.cs file has a few different examples of objects that inherit from Line.

    Which properties are you trying to set when you get the error?

    I look forward to being of further assistance.

    Comment


      #3
      Thank Jesse

      Yes inheriting Line the same as examples.The Drawing Tool works fine until using the UI Properties Inspector to try alter even native inherited Line.startAnchor values it blows it up..
      I tested without even altering the inherited Line.OnSateChange (explicitly anyway)
      So I don't have any idea where to start looking

      Happy to zip it and email it to you?

      Thanks

      Comment


        #4
        Hello SmartArtsStudio,

        Thank you for the reply.

        You can attach the .cs file here and we can take a look, the file should be located in the folder: Documents\NinjaTrader 8\bin\Custom\DrawingTools

        When you edited the start anchor, were you using the time picker or typing in a value?
        Was it the price being entered?
        Does this happen when clicking Apply?

        I look forward to being of further assistance.

        Comment


          #5
          Hello Jesse

          Its altering any value I have tried 4 different native ones and the original custom one. With OK and Apply. I think this is the error is important part:

          ""Failed to call onRender for chart object 'SmartLine': "Value cannot be null. Parameter name chartControl"

          It looks like its calling OnRender without a chartControl argument, what stages can that happen?

          Its not a basic tool, its in 6 files. State Manager Design Pattern that combines all the line tools into one so any drawn line can convert into any other line type with a click.

          I can use the "Export Add On" function and Email it probably simplest.

          Thanks

          Comment


            #6
            Hello SmartArtsStudio,

            Thank you for the reply.

            It looks like its calling OnRender without a chartControl argument, what stages can that happen?
            I don't have any specific detail on what may cause that, we would likely need to see what code is being used and the situation where you get the error to look further into that.

            Its not a basic tool, its in 6 files. State Manager Design Pattern that combines all the line tools into one so any drawn line can convert into any other line type with a click.
            Ok, from the original description it sounded like a less complex tool. If you have multiple parts you would need to do some tests before trying to attach or send in all of this in. We won't be able to debug the scripts for you but we can try to help you find the problem.

            I would suggest to try and make a test tool similar to one of the existing Line tools that inherits from line. If the problem is due to something you coded that would help to highlight the problem exists in the code you added. If you still see the problem with a very basic test you could attach that so we can review whats happening surrounding that sample. You would otherwise need to make a more simple test script which shows the problem so we can review what code is being used that is problematic.


            I look forward to being of further assistance.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            599 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            344 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            558 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            557 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X