Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Testing and Version Control Strategies to Verify each Characteristic of Strategies

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

    Testing and Version Control Strategies to Verify each Characteristic of Strategies

    Dear,
    I am working on a strategy that involves improvements and changes, and to maintain order in the strategy releases, it is versioned, for example v1, v2, v3, etc.
    The question is: Is it possible to define a series of tests for the functionality of version v1, so that when version v2 arrives, we can apply the tests from version v1 plus the new tests from version v2? And so on for the other versions.
    For example, if a feature is the crossing of two EMAs in v1, how can I test or perform a test to verify that the strategy is indeed entering the moving average crossover correctly? And how can I verify in real-time that a position is being opened at the mentioned crossover?
    Now, if we add a feature in v2, how can I evaluate whether the test for the v1 feature and the v2 feature is running correctly in both backtesting and live trading?
    This is a very simple example, of course, but the strategies I work with are much more complex, and I only used it to help you understand.
    Furthermore, I used to manually verify the correct execution of orders by looking at the chart and specifically checking if the conditions were met. However, with multiple projects and their growth, this becomes very time-consuming and impractical.
    Is there any option to solve the scenario I am presenting to you?
    Thank you very much.




    #2
    Hello ervin,

    To verify behavior is correct you can add prints and review the output.

    Below is a link to a forum post on using prints and TraceOrders to understand behavior.


    Below is a link to an example script that prints the bar data and values in a condition for a crossover.
    Citizens of the NinjaTrader Community, A common question we hear from clients is 'why are results from backtest different from real-time or from market replay?'. Live orders are filled on an exchange with a trading partner on an agreed upon price based on market dynamics. Backtest orders are not using these market dynamics.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you for you answer, I was talking more about test driven development. In the sense that I program some functionality and I want to know what tools do I have to test it into NT? And if I do versions I can test that functionallity again later with that same tests.

      Comment


        #4
        You can do test-driven development outside of NT and write a thin wrapper in NT to drive this functionality. NT itself is not oriented to this type of development in that there's no mechanism to simulate the many things a user might do or click on etc. All of that would have to be built and while it could be done it would be non-trivial.
        Bruce DeVault
        QuantKey Trading Vendor Services
        NinjaTrader Ecosystem Vendor - QuantKey

        Comment


          #5
          Thank you QantKey_Bruce, do you know some resource to guide me to do that?

          Comment


            #6
            Not specifically, but it would not differ from test-driven development in C# for any other enviroment. There are lots of resources available online. Perhaps another user may have some more specific guidance to contribute.
            Bruce DeVault
            QuantKey Trading Vendor Services
            NinjaTrader Ecosystem Vendor - QuantKey

            Comment


              #7
              I have benn reading and I read that NT does not work with Unit Test or some things like that. But just investigating a little. I don't know how would be....
              But the idea is that if I write some code for a functionallity, how to do automatic test to that functionalloty.
              thnk you QuantKey_Bruce​ , I 'm going to invertigate more.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Today, 05:17 AM
              0 responses
              39 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              124 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              64 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              41 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              46 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X