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


Automating Backtests in NinjaTrader or Python

  • Filter
  • Time
  • Show
Clear All
new posts

    Automating Backtests in NinjaTrader or Python

    Hello NinjaTrader Community,

    I hope this post finds you well. I'm currently working on a project where I need to run a large number of backtests. For efficiency, I'm looking to automate this process and I'm exploring two possible routes:
    1. Automating backtests in NinjaTrader: Is there any way to automatically run a backtest in NinjaTrader using a script or command line interface?
    2. Backtesting in Python with NinjaTrader's market data: Alternatively, I'm considering running the backtests in Python using market data exported from NinjaTrader. Has anyone done something similar and could share some insights? Specifically, I'm interested in the process of exporting the data from NinjaTrader in a format that can be easily read by Python, and any challenges that might come up when using this data for backtesting in Python.

    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.

    Hello Aviram,

    Thank you for your post.

    There is no documented/supported way to automate backtests in NinjaTrader. You could look into writing a script or backtesting in Python at your own discretion, though NinjaTrader would not be able to guarantee the results. That said, if you are looking to run tests on multiple instruments at a time there is a way to perform basket tests in the Strategy Analyzer:I understand if that information is not relevant for your testing needs, I just thought I would mention it in case it helps out. As for exporting data, we have a page about how to export historical data here:The way files are formatted for different data types is explained here:If you have any other questions, we would be glad to provide additional resources if they exist. Otherwise, this thread will remain open for other members of the forum community to chime in with their insights and tips.

    Please let us know if we may be of further assistance.
    Emily C.NinjaTrader Customer Service


      Thank you for the quick reply! i will look into everything.


        Please check a new connector I built for Nt8 Pythonbridge, for trading and data collection.


          Hello offpista,

          Unfortunately, I've had to remove the link from your post.
          To ensure a fair forum environment that isn't filled with advertisement, our policy is to remove links to third party sites that are not educational.
          It can helpful to discuss a vendor product, however if you have links to non-educational material such as product sites please consider sending these as a private message to the recipient.​
          If this is an open source script you have created, you may also consider submitting the script to the User App Share.
          Chelsea B.NinjaTrader Customer Service


          Latest Posts


          Topics Statistics Last Post
          Started by amfpaulo, Today, 07:03 AM
          2 responses
          Last Post amfpaulo  
          Started by lcgamarra_pinnacle, 06-15-2024, 09:33 AM
          6 responses
          Last Post NinjaTrader_Erick  
          Started by Matt Skinner, Today, 04:24 AM
          1 response
          Last Post NinjaTrader_ChelseaB  
          Started by GonzaloTradingSystems, Today, 03:32 AM
          1 response
          Last Post NinjaTrader_ChelseaB  
          Started by WHICKED, 06-27-2023, 12:07 PM
          87 responses
          1 like
          Last Post NinjaTrader_ChelseaB