Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Master and Secondary Strategy files

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

    #16
    Hello bltdavid,

    Thank you for your reply.

    Jim is out of the office today and I would need to confirm that with him. I will confirm whether or not this would be the case with him when he returns.

    Thanks in advance for your patience.

    Comment


      #17
      Hello bltdavid,

      We are only going to provide support/advise for things that are documented and have been thoroughly tested/used by our support team.

      We don't have educational examples built using abstract classes so we are not going to provide insight for using them with NinjaScript.

      Comment


        #18
        Understood, thanks!

        Comment


          #19
          Originally posted by bltdavid View Post
          Sure.

          Study the attached files.

          The abstract base class "MyStrategyBase" acts like a middle-man.

          You're inserting this class into the inheritance hierarchy, and anything
          in MyStrategyBase has full and complete access to the class it inherits
          from -- in this case, the Strategy class.

          You add your own methods, variables, properties, to MyStrategyBase.

          The reason this is so powerful is that you are extending the 'Strategy'
          class with new 'features' -- sorta like what a partial class does -- but
          you can really fine tune the contents of MyStrategyBase for just one or
          two strategies -- or you can make it a common base that you use for all
          your strategies.

          Inheritance is the heart and soul of OOP, and the C# language supports
          inheritance extremely well.

          There are lots of resources on the web.
          Inheritance is a standard feature of the C# language.

          Good luck!



          For sample strategy attached, it will color the background based upon the
          begin/end times you specify (but stop coloring for the break period, which
          represents known high volatility times, like for an economic report).

          For ex,
          Trade BeginTime = 600
          Trade EndTime = 1100
          Break BeginTime = 900
          Break EndTime = 930

          Restricts trading to the hours 6am to 11am, with a 30min break starting
          at 9am. All times 24hr format, and all times are local.


          This breaks the strategy analyzer.
          Optimization results when opened default to the base class unfortunately.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          577 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X