Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATSQuadroStrategyBase NT8 Strategy Foundation with SampleMACrossover

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

    ATSQuadroStrategyBase NT8 Strategy Foundation with SampleMACrossover

    By popular demand i have been asked to assist many NT8 traders who used to use MicroTrends NinjaTrader 7 trading frameworks - so i feel really compelled to make a contribution so here it is: Attached: ATSQuadroStrategyBase.zip The start of a larger piece of work to come.

    For NinjaTrader 8 - A generic 4 bracket unmanaged mode strategy base class with MIT open source license.
    This is aimed at developers with perhaps advanced skills in NinjaScript- developers who can type and can code, copy and paste, editing is the main skill for most programmers -required to use this.
    A non advanced coder/trader can still download and import this into NinjaTrader - but Advanced programming skills are required to understand some of the internals.
    In my testing this strategy base looks good enough for non stop trading operations trading from sunday to friday etc.

    To understand if this was going to be useful or not at this point. I set myself a 5minute goal to write a strategy powered by this Ninjascript and to see it running on a chart and that is the most fun thing i can think for work ;-)
    So to make life easy i simply saved a copy of the NT8 Strategy SampleMACrossover and edited it, instead of using the @Strategy.cs class it now targets the ATSQuadroStrategyBase as its base class which is derived from the Strategy class you are used to working with..

    Click image for larger version  Name:	ATSQuadroStrategyBase.png Views:	0 Size:	82.2 KB ID:	1126946

    This means you wont need to do write your own Indicator Wrappers, you can still reference and add indicators the same way you do as before. The sample has a very basic trade management example put in place for trailing the min/max of lows/highs etc..

    I plan to make an open source framework with all the bells and whistles later, trade entry and management modules and a trade manager GUI etc..
    This is the raw base and so many trader/developers wont understand what to do with it, but there are many out there who will be able to work through it and build their own layers on top.
    There will be updates made on GitHub and here.

    regretfully i am unable to provide support due to my overwhelming obligations,

    #1 I welcome feedback at [email protected] or via Github
    #2 It could be you are not yet the level of developer/trader who can use this version and so the later versions with a full set of preprogrammed features would be a better fit.
    #3 Any reasonable developer charging for services will be able to use this and build from it so there is always that option
    #4 Many developers in the forums for sure will be able to use this and collaborate.

    In fact collaboration is welcome at: https://github.com/MicroTrendsLtd/NinjaTrader8

    So there will be futures versions of this with more functionality to come. have fun!

    now here: https://ninjatraderecosystem.com/use...lemacrossover/
    Last edited by MicroTrends; 11-10-2020, 10:31 AM.
    MicroTrends
    NinjaTrader Ecosystem Vendor - micro-trends.co.uk

    #2
    Hello MicroTrends,

    Thank you for your post.

    I didn't see that you'd submitted this to our User App Share and would invite you to do so as it will be more readily available to users. You can follow the directions here to post it for inclusion:

    Upload tools and add-ons that you build to share through the NinjaTrader Ecosystem User App Share.


    I'll leave this thread open for comments from users.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      ok will do thank you :-)
      MicroTrends
      NinjaTrader Ecosystem Vendor - micro-trends.co.uk

      Comment


        #4
        Originally posted by MicroTrends View Post
        ok will do thank you :-)
        Thank you for the work. I am not a Micro Trends user, but others may have similar questions for clarity and confusion.

        1. Is this only for those using Micro Trends trading frameworks? if "Yes" please disregard other questions, however others maybe interested to know.

        2. I would assume this is a sort of generic template for a "Strategy" that can be customized. How this is different from the default NT8 Strategy SampleMACrossover?

        3. What is the advantage of using AlgoSystemBase instead of NT8 "Strategy" base?

        Thanks.

        Comment


          #5


          Hi Aligator

          Thanks for your interest and reply.


          Originally posted by aligator View Post
          1. Is this only for those using Micro Trends trading frameworks? if "Yes" please disregard other questions, however others maybe interested to know.
          Thanks.
          Yes all systems are for NinjaTrader and NinjaTrader strategies - The aim to make the task faster and easier and the result more robust and professional - to leverage institutional coding techniques that would otherwise not be available to vendors or affordable to most retail traders.

          Algorithmic trading frameworks for NinjaTrader - why?
          Historically MicroTrends Trading Frameworks for NinjaTrader 7 allowed a user/coder to enter the trade logic in a few lines and then harness the power of off the shelf features for trading - using unmanaged mode so NT would not halt and error on overfills leaving uncontrolled positions and orders. The system would provide a library of entry filters, exit rules, target, stops and trailing stops, money management features as well as Realtime settings and hybrid semi/fully automated trading via a user interface to allow manual and interaction control of the running strategy etc.

          These systems were compiled which meant there were some caveats but were otherwise exactly the same to code with ,except when it came to adding 3rd party indicators - wrappers had to be manually coded to add them in but other than that it was simple stuff.
          Also being the fact it was no open source you were not able to modify the underlying code base or extend without advanced coding skills methods etc

          Sadly these NT7 technologies were deprecated to make way for NinjaTrader 8 in 2017/2018 and give me time to migrate it all.
          I was very late doing so due to trading/dev obligations to a hedge fund but now due to many requests from traders who understood and used the past technologies in NT7 want something similar for NT8, i present the
          ATSQuadroStrategyBase.

          Originally posted by aligator View Post
          2. I would assume this is a sort of generic template for a "Strategy" that can be customized. How this is different from the default NT8 Strategy SampleMACrossover?
          The simplest way to think of it is
          If run the SampleMACrossover provided by NT8 on a fast market with many reversals if it had exit orders such as stops and limit orders - it will eventually error due to overfill conditions and halt, thus leaving open positions and orders for you to clear up and then you have to re-enter the market - and it will be in historical trading mode.

          If you run ATSQuadroStrategyBase powered MAcrossover it wont crash and burn it will navigate and self heal errors as it is fault tolerant


          Differences in code:

          Normal NT8 strategy:

          public class SampleMACrossOver : Strategy

          ATSQuadroStrategyBase Strategy:
          public class ATSSampleMACrossOver : ATSQuadroStrategyBase


          All default NT8 Strategy use Managed Mode - ATSQuadroStrategyBase uses the UnManaged mode Advanced mode


          NinjaTrader Convenience layer Managed mode Info
          #1 NinjaTrader provides the convenience layer Managed mode strategies which are a great starting place for a beginner upwards, but it has no wireframe or features to allow rapid development of strategies in terms of entry filters, exit rules, target, stops and trailing stops, money management and so on. This all has to built by the developer.
          #2 Managed Mode provides limited trading entry control and limited error handling - NT8 has improved on NT7 but for a professional trading mode UnManaged mode provides what we really need for trading, flexibility and control.
          #3 One major item we cant control in managed approach is to avoid overfill errors which stop the strategy - therefore leaving potentially unguarded positions and adhoc orders running in the live account, attendance is always vital to rescue this problem.

          Managed mode is ok - within limitations - some strategy rules are more prone to others such as reversal strategy rules in a fast time series.

          Managed Mode
          Please see here: https://ninjatrader.com/support/help...d_approach.htm
          UnManaged Mode

          https://ninjatrader.com/support/help...d_approach.htm




          Originally posted by aligator View Post
          3. What is the advantage of using AlgoSystemBase instead of NT8 "Strategy" base?
          Advanced UnManaged Mode Strategy Algorithmic Trading Frameworks
          Pros

          #1 Automated trading to be run from Sunday open to Friday close
          #2 To have mode confidence in not being in attendance 24/7 to take care of errors....
          #3 To have better order control flexibility on scaling in and out and so on.
          #4 The ability to create a strategy from scratch with a new rule set in minutes and not have to waste time on repetitive tasks only to focus on the core signal entry logic ,exit logic and trade filters
          #5 To test and write hundreds of rulesets and to do this in few lines of code and not worry about all the compicated stuff under the hood.



          Please note currently the features provided by the ATSQuadroStrategyBase are only the bottom/base layer -so we have to add in reusable generic features for the following: Entry rules, entry filters, exit rules, Settings for target, stops and trailing stops, money management goals etc.. trade management user interfaces.

          These will be added on top of this base going forwards and updates will be made to the Git Project and released to the app

          However a trader/coder can simply do that themselves using this. for example if they are using the managed mode of NT8 strategies and want more flexibility and robustness etc. Simply edit the code and wire it up to use the
          ATSQuadroStrategyBase as the base class and use the sample class provided as a reference of the core methods and patterns/

          I provided the sample strategy framework later on - so a developer can use this to work out how to migrate their own strategies using the Managed mode to this mode.. I will add a much more detailed layer derived from the base class provided so developers can use any level of class and not be plagued with unwanted features. etc


          To see how it works simply download it and import it and add explore the sample strategy etc.

          In fact collaboration is welcome at: https://github.com/MicroTrendsLtd/NinjaTrader8

          So there will be futures versions of this with more functionality to come. have fun!

          now here: https://ninjatraderecosystem.com/use...lemacrossover/
          Last edited by MicroTrends; 11-11-2020, 04:50 AM.
          MicroTrends
          NinjaTrader Ecosystem Vendor - micro-trends.co.uk

          Comment


            #6
            NT8 V2020.12.9.1 Beta
            Latest update can be downloaded from here:
            Addressed ability to BackTest Deadlock avoidance Reliability on order Cancellations Thinned out locking on lists Refactored the Print method for better tracing view locked the log write tracing to prevent file access issues Update Strategy Sample ATSSampleMACrossOver Added new sample ATSSamplePriceReversalTest Alpha Section IsRealtimeTradingUseQueue – unit but not soak tested IsPositionCloseModeLimit – Mode for closing […]


            MicroTrends
            NinjaTrader Ecosystem Vendor - micro-trends.co.uk

            Comment


              #7
              WOW, WOW, WOW

              Thank you so much!

              I've been struggling with the Managed Mode...learning about all the unexpected nuances as I went along...so much time involved...so many errors to catch, but still believing I can eventually get it to work without screwing up my account.

              I look forward to, when I can, converting my trade engine to your Unmanaged mode...I have scalping strategies, but don't do reversals on the same position.

              I looked in the ZIP and you are giving us the raw source code... WOW WOW WOW

              ================================================== ================================================== ===

              Another topic...I don't know if I should start a new thread....probably most except for folks like Micro Trends would not know what I'm talking about...??

              In my current architecture I have a trade-engine-server running as a strategy.....one instance for each instrument....

              when the trade-engine starts up, it creates a MSMQ (microsoft message queue) for the specific instrument and listens on that queue for incoming trade signals

              the trade signals are created by one or more indicators and sent to the trade-engine-strategy via MSMQ (on the same machine).

              I never liked to bind indicators to strategies ... this architecture works REALLY WELL and reliably....

              Except it seems that the delay from the client to the server has quite a wide range in milliseconds....the best hoovers around 1ms, but it can go higher, and seems to vary a lot, even ranging to 50+. In a fast market I don't want this much of a delay inside the Ninja Host Machine.

              So far I have not found any information on how to tune MSMQ with C# / DotNet.

              The host machine is not loaded, no high CPU or disk usage...4 core, 8 threads

              I don't know where the bottleneck is at times...

              Should this go on StackOverflow or ???







              Comment


                #8
                Hello vantojo,

                Thank you for your reply.

                What you're describing would be outside of what our support team would be able to assist with as we cannot provide support for code external to NinjaScript.

                I'll leave this open and you can see if MicroTrends or other users would like to pitch in.

                Please let us know if we may be of further assistance to you.
                Kate W.NinjaTrader Customer Service

                Comment


                  #9
                  Looks good! I hope that you will find something quite similar and useful here at my trading profile here
                  Are you a beginner or advanced? See our knowledge hub for in-depth articles, guides, webinars and videos that are here to help visual learners to learn how to trade.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by DayTradingDEMON, Today, 09:28 AM
                  3 responses
                  19 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by Stanfillirenfro, Today, 07:23 AM
                  9 responses
                  23 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by George21, Today, 10:07 AM
                  0 responses
                  8 views
                  0 likes
                  Last Post George21  
                  Started by navyguy06, Today, 09:28 AM
                  1 response
                  7 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Started by cmtjoancolmenero, Yesterday, 03:58 PM
                  8 responses
                  34 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Working...
                  X