Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bug: Exporting strategy does not work with UserDefinedMethods

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

    Bug: Exporting strategy does not work with UserDefinedMethods

    When exporting the strategy the error message is Error compiling assembly. It didn't find the classes in user defined methods...

    #2
    Hello,


    Do your indicators and strategies currently compile or do you have compile errors?

    Also User Defined Methods are not exportable. To export this you will need to create a new indicator and move the methods over to the indicator to export the method.


    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment


      #3
      They compile error free.

      What is the point of having UserDefinedMethods then?
      I just want to export the compiled code. It should include the UserDefinedMethods.cs!

      Comment


        #4
        Hello,

        Reason is if you export that file and then import it on another PC that may have had a custom User Defined Methods file it would be overwritten thus breaking other indicators that may have used this file as well.

        In this case if you look to distribute your code these methods need to be included in your original NinjaScript file or they need to be included in a named indicator file if you want to keep them out of your indicator or strategy file.

        If you just looking to keep a backup of your code use the backup feature instead, File->Utiliies->Backup and this will backup your UserDefinedMethods when you select to backup NinjaScript.



        Let me know if I can be of further assistance.
        BrettNinjaTrader Product Management

        Comment


          #5
          It is correct that exporting this file would cause problems. But when compiling a strategy it should just use this file as an include!

          I mean the whole purpose is to simplify class development. If I now have to copy and rename all classes when compiling a strategy it is even more work!

          So just include this file in compiler settings, shouldn't be that hard...

          Comment


            #6
            Hello,

            I will let development know and send this in as recommendation.

            Thank you for your recommendation!
            BrettNinjaTrader Product Management

            Comment


              #7
              Hello!

              I had the same problem exporting UserDefinedMethods.cs.
              Instead saved my custom Method not in UserDefinedMethods.cs, but in file with any name (let's say MyDefinedMethods.cs) and had no problem exporting Methods inside this file.

              YB

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              601 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              347 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
              559 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              558 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X