Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Issue by sharing a compiled strategy

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

    Issue by sharing a compiled strategy

    Good day;

    I've created a strategy which contains ONLY trading rules.
    So, by changing the inhritance of any other strategy from : Strategy to : BaseRulesStrategy, the strategy automaticaly use the trading rules.

    So, if I share it to another user in source code, they can change the inheritance of they strategies to have the rules in it.
    BUT if I share it using a compiled version, they cannot change the inheritance because the compilator returns that kind of error (even by applicating the reference in the NinjaScriptEditor

    So by using the source code it's working, using the compiled version, no


    #2
    Hello TradeForge,

    At this time custom inheritance is not supported, while that is a C# feature that can be used that is known to cause problems in various areas of the platform depending on the use case. We can only suggest to use the standard strategy inheritance. If you want to define a basic set of rules or conditions to use you can use a seperate C# class to accomplish that instead of using inheritance.

    Comment


      #3
      Thanks Jesse for your answer.
      Challenge accepted!

      Comment


        #4
        Hi Jesse;

        Tried an other way by creating an independant class that manages the strategy.
        Again, it works fine in source code mode, but in a compiled version I got this error when a compiled a strategy that use my class.
        So the template takes a strategy as parameter as you can see in the following screenshot.

        And i get that error on compilation
        SampleMACrossOvertest.cs Argument 1: cannot convert from 'NinjaTrader.NinjaScript.Strategies.Strategy [C:\Users\Damien\Documents\NinjaTrader 8\bin\Custom\Indicators\@ADL.cs(117)]' to 'NinjaTrader.NinjaScript.Strategies.Strategy [C:\Users\Damien\Documents\NinjaTrader 8\bin\Custom\TemplatePowerFusion.dll]'

        ​Is look that there is confusion between the strategy used in my compiled addon with the strategies using on each indicator (using the partial class)...
        Is there is any way to avoid it please?
        Attached Files

        Comment


          #5
          Ok, I had to change "Strategy" to "StrategyRenderBase" and adding some parametters needed into the Template generator.
          Is look like, using compiled version it doesn't find "what is a strategy" sinceeach indicator creates its own strategy implementation
          Attached Files

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          87 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          128 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          65 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          117 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          67 views
          0 likes
          Last Post PaulMohn  
          Working...
          X