Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Subclassing a strategy

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

    Subclassing a strategy

    I don't see any reason why not too, but better safe than sorry...
    Is there any reason whatsoever not to derive from the Strategy class?
    For example, will the following rise any issues:

    File MyStrategyBase.cs:
    Code:
    namespace NinjaTrader.Strategy
    {
        class MyStrategyBase: Strategy
        {
            protected override void OnBarUpdate()
            {
                 Print("Hello from MyStrategyBase");
            }
        }
    }
    File MyKickAssStrategy.cs:
    Code:
    namespace NinjaTrader.Strategy
    {
        class MyKickAssStrategy: MyStrategyBase
        {
            protected override void OnBarUpdate()
            {
                 Print("Hello from MyKickAssStrategy");
                 base.OnBarUpdate();
            }
        }
    }
    Thanks,

    Boaz

    #2
    Hello,

    Thanks for the forum post.

    We have had other clients do this with success. However since this is unsupported officially not sure if you would run into any issues moving forward.

    Let me know if I can be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Tim-c, Today, 03:54 AM
    0 responses
    3 views
    0 likes
    Last Post Tim-c
    by Tim-c
     
    Started by FrancisMorro, Today, 03:24 AM
    0 responses
    2 views
    0 likes
    Last Post FrancisMorro  
    Started by Segwin, 05-07-2018, 02:15 PM
    10 responses
    1,770 views
    0 likes
    Last Post Leafcutter  
    Started by Rapine Heihei, 04-23-2024, 07:51 PM
    2 responses
    31 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by Shansen, 08-30-2019, 10:18 PM
    24 responses
    945 views
    0 likes
    Last Post spwizard  
    Working...
    X