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

Annoying NT text editor message

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

    Annoying NT text editor message

    Hi!

    I have some external and my code, which uses OnPropertyChanged notifications for updating particular properties (to avoid expensive Refresh of properties)

    But every time I'm getting the next thing - Recursive calls message... Yes, properties reset each other, they are self exclusive - if one set to true, then another is been set to false

    For ex.,
    Code:
    private bool _prop1 = false;
    public bool Prop1
    {
    get {return _prop1;}
    set {_prop1 = value; if(_prop1) {_prop2=false;OnPropertyChanged("Prop2");}}
    }
    
    private bool _prop2 = false;
    public bool Prop2
    {
    get {return _prop2;}
    set {_prop2 = value; if(_prop2) {_prop1=false;OnPropertyChanged("Prop1");}}
    }
    Click image for larger version

Name:	NT editor annoying message.png
Views:	304
Size:	14.0 KB
ID:	1182948

    I operate correctly with this, no any recursive things, all is ok
    How can I switch off this notifications?
    No another variant for me not to use this approach with OnPropertyChanged

    #2
    Hello fut_practic,

    Thanks for your post.

    Many of our staff is currently out of the office for the Christmas holiday at this time and I will need to touch base with them on this topic before advising.

    We will be following up next week after we have returned from the holiday weekend.

    Thank you for your patience.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hello fut_pactic,

      Thanks for your patience.

      You would not be able to turn off the notifications that you are receiving in regard to recursive properties.

      It seems like you are trying to customize some properties based on other properties in your script.

      Please see the attached example script, SampleIndicatorTypeConverter, which demonstrates this sort of work.

      Let us know if we may assist further.
      Attached Files
      Brandon H.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by NinjaTrader_BrandonH View Post
        Hello fut_pactic,

        Thanks for your patience.

        You would not be able to turn off the notifications that you are receiving in regard to recursive properties.

        It seems like you are trying to customize some properties based on other properties in your script.

        Please see the attached example script, SampleIndicatorTypeConverter, which demonstrates this sort of work.

        Let us know if we may assist further.
        No, I want to reset some value if set some another value.
        I don't need to update all properties using this - [RefreshProperties(RefreshProperties.All)].
        I want to update only particular property/properties.
        Yes, these properties depend on each other, but it's not a problem.

        How can I switch off any warning messages from NT?

        Comment


          #5
          Hello fut_practic,

          Thanks for your note.

          At this time it is not possible to disable pop-up warning messages in NinjaTrader. We are tracking this feature request in an internal ticket and I have added your vote.

          The internal tracking number for your feature request is SFT-3030. Please reference this internal tracking number when contacting Platform Support if you ever have questions regarding this feature request.

          When a feature request is implemented, you'll find a description of the new feature in the release notes:Let us know if we may assist further.
          Brandon H.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_BrandonH View Post
            Hello fut_practic,

            Thanks for your note.

            At this time it is not possible to disable pop-up warning messages in NinjaTrader. We are tracking this feature request in an internal ticket and I have added your vote.

            The internal tracking number for your feature request is SFT-3030. Please reference this internal tracking number when contacting Platform Support if you ever have questions regarding this feature request.

            When a feature request is implemented, you'll find a description of the new feature in the release notes:Let us know if we may assist further.
            Thx, but maybe I can edit some xml configs to get this undocumented feature?

            Comment


              #7
              Hello fut_practic,

              Thanks for your note.

              There is currently no workaround to disable pop-up warning messages in NinjaTrader. Note that we would not be able to assist with unsupported or undocumented code.

              That said, this thread will be open for other community members to comment their insight on this.

              Let us know if we may further assist.
              Brandon H.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_BrandonH View Post
                Hello fut_practic,

                Thanks for your note.

                There is currently no workaround to disable pop-up warning messages in NinjaTrader. Note that we would not be able to assist with unsupported or undocumented code.

                That said, this thread will be open for other community members to comment their insight on this.

                Let us know if we may further assist.
                Please try these 2 versions (indicator + strategy)

                It's bug, because of commented statements

                Custom_NT8.zip

                Comment


                  #9
                  Hello fut_practic,

                  Thanks for your note.

                  I see the error message behavior you are referring to when testing your scripts.

                  In your script, you have changes to Prop1 trigger changes to Prop2 which triggers changes to Prop1 which triggers changes to Prop2 which triggers changes to Prop1, so on. This is why you are seeing the error message about having recursive properties in your script. You would need to modify your logic in the script so that this no longer occurs.

                  Note that this would fall under the category of C# education. Unfortunately, in the support department at NinjaTrader, it is against our policy to create, debug, or modify, code or logic for our clients. Further, we do not provide C# programming education services in our support. This is so that we can maintain a high level of service for all of our clients as well as our partners.

                  Let us know if we may assist further.
                  Brandon H.NinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by NinjaTrader_BrandonH View Post
                    Hello fut_practic,

                    Thanks for your note.

                    I see the error message behavior you are referring to when testing your scripts.

                    In your script, you have changes to Prop1 trigger changes to Prop2 which triggers changes to Prop1 which triggers changes to Prop2 which triggers changes to Prop1, so on. This is why you are seeing the error message about having recursive properties in your script. You would need to modify your logic in the script so that this no longer occurs.

                    Note that this would fall under the category of C# education. Unfortunately, in the support department at NinjaTrader, it is against our policy to create, debug, or modify, code or logic for our clients. Further, we do not provide C# programming education services in our support. This is so that we can maintain a high level of service for all of our clients as well as our partners.

                    Let us know if we may assist further.
                    Code is totally correct and it doesn't generate looping - you can see that from my examples - they can be compiled and works correctly
                    Because I reset another property ONLY if set the first one. And in this case another property doesn't fire OnPropertyChanged

                    What is funny, that NT shows recursion warning ON COMMENTED CODE

                    Please test again

                    It's not educational service, it's life of the real NT developer...

                    I tried to set corresponding attribute as decribed here, but without luck
                    Last edited by fut_practic; 12-28-2021, 10:36 AM.

                    Comment


                      #11
                      Hello fut_practic,

                      Propagating changes would be an advanced C# concept and not fully supported by the Scripting Support team.

                      There can be limitations using advanced C# concepts, in NinjaScript, so your mileage may vary. As of now, we do not have any examples that can be used to navigate that path.

                      That said, note these properties will be triggered as the script loads. If any of the properties are triggered, this would cause the back and forth you have designed.

                      Because this is undocumented and not fully supported by NinjaTrader, you can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our NinjaTrader Ecosystem team follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.

                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Originally posted by NinjaTrader_ChelseaB View Post
                        Hello fut_practic,

                        Propagating changes would be an advanced C# concept and not fully supported by the Scripting Support team.

                        There can be limitations using advanced C# concepts, in NinjaScript, so your mileage may vary. As of now, we do not have any examples that can be used to navigate that path.

                        That said, note these properties will be triggered as the script loads. If any of the properties are triggered, this would cause the back and forth you have designed.

                        Because this is undocumented and not fully supported by NinjaTrader, you can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our NinjaTrader Ecosystem team follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.
                        I'm that experienced developer
                        And I want to pay your attention on the absurd situation

                        Such code as below (no matter it's from indicator, strategy, superdom column, drawing tool) always generate nonsense warning message
                        Click image for larger version  Name:	1.png Views:	0 Size:	71.7 KB ID:	1183464

                        And if I agree to edit it points me to commented code
                        Click image for larger version  Name:	2.png Views:	0 Size:	64.3 KB ID:	1183465

                        And if I remove commented code then there is no problem
                        Click image for larger version  Name:	3.png Views:	0 Size:	62.1 KB ID:	1183466
                        With commented lines it's not ok, it's recursive, it's dangerous
                        But without it's ok....

                        Please check this
                        Last edited by fut_practic; 12-28-2021, 11:15 AM.

                        Comment


                          #13
                          Hello fut_practic,

                          Thanks for your note.

                          I have tested this using the scripts you shared in post #8.

                          When that code is commented out, I could enable the scripts on a chart without the warning message displaying.

                          See this video which demonstrates enabling the strategy without issue: https://brandonh-ninjatrader.tinytak...M18xODY5NDgwMw

                          Let us know if we may assist further.​​​​​​​
                          Brandon H.NinjaTrader Customer Service

                          Comment


                            #14
                            Originally posted by NinjaTrader_BrandonH View Post
                            Hello fut_practic,

                            Thanks for your note.

                            I have tested this using the scripts you shared in post #8.

                            When that code is commented out, I could enable the scripts on a chart without the warning message displaying.

                            See this video which demonstrates enabling the strategy without issue: https://brandonh-ninjatrader.tinytak...M18xODY5NDgwMw

                            Let us know if we may assist further.​​​​​​​
                            Yes, it's compiling ok of course. And working ok.
                            Warning is generating during Saving of the code or Compiling of the updated code.
                            Delete some ';', for ex, add it again and try to save with Ctrl+S

                            It's not a problem for users, it's a big problem for developers
                            Last edited by fut_practic; 12-28-2021, 12:57 PM.

                            Comment


                              #15
                              Hello fut_practic,

                              Thanks for your note.

                              Note that Ctrl+S doesn't compile a script. To compile a script, you would need to click the Compile button or right-click in the script and click Compile.

                              I went to import the zip you previously shared but I was unable to import it and got the message that the NinjaScript was made from an older, incompatible version of NinjaTrader. Also, I can see that this was not exported from the NinjaTrader platform. That said, I was only able to manually import the scripts.

                              Please upgrade your platform using the instructions below and test again for the behavior you are reporting. Does the behavior occur if you comment out lines 100-129?

                              If you are able to reproduce the behavior, export the scripts by navigating to Tools > Export > NinjaScript AddOn and share the exported zip with us so we may test it on our end. Also, share the exact steps taken to reproduce the issue.

                              To update NinjaTrader, please follow the steps below:
                              • First, copy your license key from NinjaTrader under Help> License Key then exit NinjaTrader
                              • Click on the link: https://ninjatrader.com/PlatformDirect
                              • Enter your license key and press Submit
                              • Select 'Download'
                              • Critical: Before running the installer, ensure NinjaTrader is closed.
                              I look forward to assisting further.
                              Brandon H.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by junkone, Today, 11:37 AM
                              2 responses
                              14 views
                              0 likes
                              Last Post junkone
                              by junkone
                               
                              Started by frankthearm, Yesterday, 09:08 AM
                              12 responses
                              44 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by quantismo, 04-17-2024, 05:13 PM
                              5 responses
                              35 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by proptrade13, Today, 11:06 AM
                              1 response
                              7 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by love2code2trade, 04-17-2024, 01:45 PM
                              4 responses
                              35 views
                              0 likes
                              Last Post love2code2trade  
                              Working...
                              X