Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Automating Compilation and Backtesting of NinjaScript Code

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

    Automating Compilation and Backtesting of NinjaScript Code

    Hello NinjaTrader Community,

    I hope this post finds you well. I'm working on a project where I'm generating NinjaScript code dynamically and I need to automate the subsequent steps of compiling and backtesting this code. I have two related questions:
    1. Automated Compilation: I've noticed that when NinjaTrader is open, any changes I make to a .cs file in Visual Studio are automatically compiled. Is there a way to trigger this compilation process programmatically, for example, using a script or command line interface?
    2. Automated Backtesting: After compiling the new NinjaScript code, I need to run a backtest. Is it possible to execute a command in Visual Studio (or elsewhere) that triggers a backtest in NinjaTrader?

    Any guidance, insights, or references would be highly appreciated.

    Thank you in advance for your help. I look forward to hearing your thoughts and suggestions.

    Best regards, Aviram Y.

    #2
    Hello Aviram,

    Thanks for your post.

    No, there are no supported or documented NinjaScript methods or functions to programmatically compile a NinjaScript.

    There are also no supported or documented NinjaScript methods or function to programmatically run a backtest on a NinjaScript in the Strategy Analyzer.

    This forum thread will be open for other community members to share their insights on possible unsupported code that could accomplish this.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick reply! much appreciated.

      Comment


        #4
        Please please please support a CLI where we can run automated backtests to ensure we don't break things during iteration.

        I would like to be able to do something like the following:

        Code:
        NinjaTrader.exe /backtest <StrategyName> /template "C:\Users\<user>\Documents\NinjaTrader 8\templates\Strategy\<StrategyName>\<TemplateName>.xml" /instrument ES JUN24 /fromdate 03/07/2024 /todate 03/08/2024 /starttime 06:36 /endtime 7:09 /output "C:\Backtests\<StrategyName><TemplateName>.txt" /displaylogs /exporttrades /headless
        Should I create a new post specifically for automated headless backtests via a CLI or can this post cover the request?

        Comment


          #5
          Hello AdaptOD,

          Thanks for your notes.

          We are tracking interest for this in an existing feature request and I have added your vote to that feature request.

          This request is being tracked under the number SFT-631.

          As with all feature requests, interest is tracked before implementation is considered, so we cannot offer an ETA or promise of fulfillment. If implemented, it will be noted on the Release Notes page of the Help Guide.

          Release Notes — https://ninjatrader.com/support/help...ease_notes.htm
          Brandon H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Haiasi, 04-25-2024, 06:53 PM
          2 responses
          16 views
          0 likes
          Last Post Massinisa  
          Started by Creamers, Today, 05:32 AM
          0 responses
          4 views
          0 likes
          Last Post Creamers  
          Started by Segwin, 05-07-2018, 02:15 PM
          12 responses
          1,785 views
          0 likes
          Last Post Leafcutter  
          Started by poplagelu, Today, 05:00 AM
          0 responses
          3 views
          0 likes
          Last Post poplagelu  
          Started by fx.practic, 10-15-2013, 12:53 AM
          5 responses
          5,407 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Working...
          X