Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Building Strategy in Visual Studio

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

    Building Strategy in Visual Studio

    After 2 days of failing to export my strategy using Ninjatrader's export as assembly tool because of a mystery "Assembly could not be exported. Please ensure all required components are included" error, I gave up and I'm now trying to build ninjascript assembly from a Visual Studio project instead.

    I've added my strategy code in a .NET class library project in Visual Studio and added references.

    Problem: My strategy needs to utilize a custom indicator I developed. It's already been exported as assembly in Ninjatrader, then imported. In my strategy in VS, I have to add Ninjatrader.Custom.dll or I have tons of errors due to missing all ninjascript methods, types, etc.

    But if i also add the DLL for my custom indicator, MyIndicator.dll, then I get errors saying 'Strategy' type is duplicated in Ninjatrader.Custom.dll and MyIndicator.dll

    I don't know what to do. Super frustrating situation. I wanted to try exporting my strategy from Visual Studio instead of Ninjatrader, since I cannot figure out why my strategy fails to export using NT "export as assembly" tool.
    Last edited by iantriestrading; 11-19-2024, 12:18 AM.

    #2
    Hello iantriestrading,

    Thank you for your post.

    Unfortunately, it is not supported to build from Visual Studio.

    If you already have an existing inquiry open, please continue to work with my colleague via the forum thread. In the future, we kindly ask that you avoid submitting multiple requests for the same item. This ensures that you get the most timely responses and prevents our support team from duplicating their efforts.

    We appreciate your patience and understanding in this matter.​

    Comment


      #3
      Hi Gaby,

      I'm confused. Your own support docs say, "When exporting a compiled assembly through NinjaTrader, no additional resource files can be added. There are two ways around this. The first is to export the DLL from NinjaTrader, then open the exported .zip file, add any additional files, and re-zip the archive, but this will result in your resource files being fully accessible to end users. The second and recommended approach is to use a fully featured IDE such as Visual Studio to build your DLL's."

      Also I'm trying to keep my unique questions separate rather than combine all into one converstion where things can get confused/lost. Jesse and I are focusing on something very specific.

      Comment


        #4
        Hello,

        We do have an example that demonstrates building a ,dll via Visual Studio, this works for AddOn scripts but has not been tested for indicators/strategies. This is the recommended approach specifically for AddOns, as they can have additional resource files such as XAML, sounds, etc. which is what the HG link you linked is referring to.

        See the section on 'AddOn Development Environment (Visual Studio Advanced)'.



        This typically isn't the recommended approach for strategies/indicators since they usually don't have additional resource files that can't be added directly from NinjaTrader, like XAML or sound files. The recommended approach would be to export from NinjaTrader, and make sure all references for your indicators are included in the export package.

        Comment


          #5
          Thank you for the clarification!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          58 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          133 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          73 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          45 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          50 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X