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

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.
    JesseNinjaTrader Customer Service

    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.
        JesseNinjaTrader Customer Service

        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.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Waxavi, Today, 02:00 AM
            0 responses
            2 views
            0 likes
            Last Post Waxavi
            by Waxavi
             
            Started by elirion, Today, 01:36 AM
            0 responses
            3 views
            0 likes
            Last Post elirion
            by elirion
             
            Started by gentlebenthebear, Today, 01:30 AM
            0 responses
            4 views
            0 likes
            Last Post gentlebenthebear  
            Started by samish18, Yesterday, 08:31 AM
            2 responses
            9 views
            0 likes
            Last Post elirion
            by elirion
             
            Started by Mestor, 03-10-2023, 01:50 AM
            16 responses
            391 views
            0 likes
            Last Post z.franck  
            Working...
            X