Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Include common library

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

    Include common library

    I'm trying to separate my code to clean things up from the main file to an external file. Is this possible? See example below:


    common.cs file or dll

    HTML Code:
    private double distanceFromStop(double stopPrice, double marketPrice)
    {
          double distance = 0;                 
          return distance;
     }
    main_strategy.cs

    HTML Code:
    included common.cs
    
    distanceFromStop(11,12);





    #2
    Hello bc24fl,

    Thanks for your post.

    You could create a partial class (Indicator, strategy) for your common methods.

    NinjaTrader_Chelsea demonstrates this using an Add-on and creates the same partial class in all three namespaces: Indicator, Strategy, Add-on. Please see post # 2 here: https://ninjatrader.com/support/foru...ument-backtest

    Comment


      #3
      Hello bc24fl,

      Please also see this video demonstration of creating a separate dll file that works with multiple indicator and strategy scripts.
      Chelsea B.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      137 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      120 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      71 views
      0 likes
      Last Post PaulMohn  
      Working...
      X