Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

In Ninjascript, can filename be different from class name?

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

    In Ninjascript, can filename be different from class name?

    Dear Ninjatrader Support,
    I have a filename different from class name.
    Eg: if FileName= abc.cs
    then inside the SAME file, i have a class defined as follows:
    public class DifferentFromFileName{

    ...
    }
    This actually compiled well, executed on my local box. however, when i moved to my cloud server, there was an error importing this particular file. I couldnt remove that package using Controller-Tool-RemoveNinjascript Assembly.
    i had remove and reinstall Ninjatrader 8 to completely wipe off everything and roll back and import old package.
    Can you pls advise if filename can be different from class name.?
    I need this approach such as filename as different to classname, for some security reasons.
    thanks

    #2
    I am thinking, if i export a file with different class name, then i should be able to import the same file within DLL, with a different class name. Not sure why it didnt work

    Comment


      #3
      Hello prabbala,

      Thanks for your post.

      File names can be separate from class names. Class names are what makes each NinjaScript unique and are what you should be ensuring are unique. If you are seeing duplicate errors, this would likely be due to the same class name being reused between two files.

      If you import a DLL which contains scripts with a different class name, you will not encounter conflicts.

      If you want to update the scripts, then you should use the same class name for the scripts and the same file name for the DLL so the DLL gets overwritten with updated scripts.

      Please let us know if you have any additional questions.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      44 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      124 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      65 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X