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 NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          55 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          132 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
          49 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X