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

NT Error With Expandable Properties

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

    NT Error With Expandable Properties

    I created an expandable property with two child properties. Subsequently I changed the names of the child properties. When I compile the revised script, I get errors in the NT generated portion of the indicator. For some reason the old property names persist and the error states that I have no definition for those (old and deleted) properties. Of course I don't; they were deleted. I am not sure what is happening here.

    Is there a sample for expandable properties? Also, is it possible to nest expandable properties?

    Any suggestion would be greatly appreciated. Thank you.

    EDIT: It turns out that the old names were present in a commented out portion of the code. After they were removed, the indicator compiled ... until the next revision to the script. The expandable property class is ICloneable and now I am also getting an error related to PropertyInfo (can't be found) in the

    Code:
    public override void CopyTo(NinjaScript ninjaScript)
    Clearly something is not working right here so any insight would be very helpful.
    Last edited by Zeos6; 08-24-2017, 07:44 AM.

    #2
    Hello Zeos6,

    (edit)
    Below is a link to an example of expandable properties.




    Are you using the NinjaScript Editor when modifying this script?

    Try restarting NinjaTrader and then compiling again.

    What version of NinjaTrader are you using? (Help -> About)
    Last edited by NinjaTrader_ChelseaB; 08-24-2017, 08:20 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi ChelseaB,

      I am using NT 8.0.8.0 64-bit.I am using the Ninjascript editor when modifying the script.I have checked the references you sent. There doesn't seem to be consistency there: in one reference you use ICloneable in the brushes example you do not. Is there a standard example with some simple properties?

      EDIT: Removing the ICloneable and the CopyTo override compiles the indicator but now the property does not show at all in the property grid.

      Can you please provide a standard for expandable properties and nested expandable properties?
      Last edited by Zeos6; 08-24-2017, 08:02 AM.

      Comment


        #4
        Hello Zeos6,

        I would use the newer and more complete example in the references..

        This example is importing and working correctly on my end.

        Are you able to add the example to a chart after importing it?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi ChelseaB,

          I have the child properties in a class. I have removed the ICloneable from the class, and I am using

          Code:
          [TypeConverter(typeof(ExpandableObjectConverter))]
          It seems to be working well and is far simpler than the example you suggested. The example is good to have as a reference, and I will studyu it, but seems an overkill for adding simple expandable properties.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Christopher_R, Today, 12:29 AM
          0 responses
          9 views
          0 likes
          Last Post Christopher_R  
          Started by sidlercom80, 10-28-2023, 08:49 AM
          166 responses
          2,235 views
          0 likes
          Last Post sidlercom80  
          Started by thread, Yesterday, 11:58 PM
          0 responses
          3 views
          0 likes
          Last Post thread
          by thread
           
          Started by jclose, Yesterday, 09:37 PM
          0 responses
          8 views
          0 likes
          Last Post jclose
          by jclose
           
          Started by WeyldFalcon, 08-07-2020, 06:13 AM
          10 responses
          1,415 views
          0 likes
          Last Post Traderontheroad  
          Working...
          X