• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unit testing

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

  • AnotherTrader
    started a topic Unit testing

    Unit testing

    Is there a practical way to unit test NinjaScript code (e.g. custom stratgies, indicators, add-ons)?

    Is any one using any harnesses that might work for this?

  • AnotherTrader
    replied
    To continue this thread, I have posted some code on github ...

    https://github.com/Abattia/NinjaTrader8_UnitTests Experiment to devise a means to unit test NinjaScript

    My objective is to write higher quality NinjaScript code by devising a way to use Test Driven Development ( https://en.wikipedia.org/wiki/Test-driven_development ).

    As I outline in the github README.md, I don't think this is possible at present. Tools like MSTest cannot be applied in NinjaScript projects (for perfectly understandable reasons related to keeping the NT proprietary code proprietary!).

    So, the github project is an invitation to anyone out there who might have ideas of how we might devise an alternative that achieves the same objective, i.e. higher quality NinjaScript code.

    Here is the sort of log output the current code produces:



    All contributions and suggestions greatefully received ...

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    Hello AnotherTrader,

    Thank you for the post.

    This item is likely going be best answered by the community members who have experience with this specific concept as this is not something our support would have direct information on.

    From my knowledge of unit testing, it would likely be possible to access NinjaScript objects from the test. However, in contrast to how unit testing works, it may not be directly possible to recreate accurately what the platform does with the objects you would be testing (indicator, strategy). There are many steps required in correctly instantiating a NinajScript object that happens internally so that portion of this concept would not easily be recreated in a test.

    If any other community members have further information on this topic, I am sure they will post their knowledge here as well.

    I look forward to being of further assistance.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by Arkadiy_B, Today, 06:43 AM
0 responses
2 views
0 likes
Last Post Arkadiy_B  
Started by leontancfa, Today, 06:09 AM
1 response
9 views
0 likes
Last Post NinjaTrader_PatrickG  
Started by soulfx, 12-01-2017, 08:44 AM
3 responses
1,019 views
0 likes
Last Post NinjaTrader_EricB  
Started by Parmenides48, 04-09-2019, 03:32 AM
10 responses
52 views
0 likes
Last Post NinjaTrader_PatrickG  
Started by NinjaCustomer, Today, 01:48 AM
1 response
13 views
0 likes
Last Post NinjaTrader_EricB  
Working...
X