NexusFi: Find Your Edge


Home Menu

 





Storing Backtest Reports in a Database


Discussion in Platforms and Indicators

Updated
    1. trending_up 1,702 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 quantarb 
Wayne, NJ USA
 
Experience: Intermediate
Platform: Multicharts, Deltix DCS
Broker: Interactive Brokers/IQ Feed
Trading: ETF Options
Posts: 41 since Oct 2012
Thanks Given: 7
Thanks Received: 38

Hello, does anyone know of a good way to store backtest reports in some type of database. I am thinking about using Microsoft Access to store my backtest reports.


Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Hungary Called for Magyar at 97pct, Ending 16-Year Orban …
Prediction Markets & Event Contracts
Powell in 48 Hours: Word Markets Give 78% on Inflation, …
Prediction Markets & Event Contracts
Prediction Markets Expiry Day: Trump Eyes War Exit, $230 …
Prediction Markets & Event Contracts
Weekend Update: First Qatari LNG Transit Attempted -- IR …
Traders Hideout
Bookmap Global Plus Lifetime + Lifetime Addons For Sale
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Lady Vols Primer: Trading Volatility Journal
7 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #3 (permalink)
 tickleboy 
Seattle, Washington
 
Experience: Advanced
Platform: NinjaTrader, TradeStation
Broker: Kinetick
Trading: ES
Posts: 18 since Oct 2011
Thanks Given: 16
Thanks Received: 10



quantarb View Post
Hello, does anyone know of a good way to store backtest reports in some type of database. I am thinking about using Microsoft Access to store my backtest reports.

I've done it with SQL Server, but am sure you can use Access as well. You will need to be able to use ADO.Net code. Here's some sample code to at least get you started:

 
Code
        protected override String GetDatabaseInsertString()
        {
            switch (databaseTableName)
            {
                case "MinuteDatas":
                    return (@"INSERT INTO " + databaseTableName +
                        "(Instrument_ID, DateTime, [Open], High, Low, [Close], Volume) VALUES ('" +
                        instrumentId + "','" +
                        Time[0] + "','" +
                        Open[0] + "','" +
                        High[0] + "','" +
                        Low[0] + "','" +
                        Close[0] + "','" +
                        Volume[0] + "');");
                case "TickDatas":
                    return (@"INSERT INTO " + databaseTableName +
                        "(Instrument_ID, DateTime, Price, Volume) VALUES('" +
                        instrumentId + "','" +
                        Time[0] + "','" +
                        Close[0] + "','" +
                        Volume[0] + "');");
               case "DayDatas":
                  return(@"INSERT INTO " + databaseTableName +
                        "(Instrument_ID, Date, [Open], High, Low, [Close], Volume) VALUES ('" +
                        instrumentId + "','" +
                        Time[0] + "','" +
                        Open[0] + "','" +
                        High[0] + "','" +
                        Low[0] + "','" +
                        Close[0] + "','" +
                        Volume[0] + "');");
                default:
                    return ("");
            }
        }   

     protected void InsertIntoDatabase(string s)
     {
         SqlCommand cmd = new SqlCommand(s, conn);
         cmd.ExecuteNonQuery();
      }

     conn = new SqlConnection("Data Source=" + databaseServer + ";Initial Catalog=" + initialCatalog + 
               ";Integrated Security=No; User ID=" + userId + ";Password=" + userPassword);
            try
            {
               conn.Open();
               SetDatabaseName();
               GetInstrumentPrimaryKey();
             }
            catch ....
I personally would rewrite the code differently if I did it again though and use a SQLCommand object parameters... but that's just me!

Hope that helps.....


Follow me on X Reply With Quote




Last Updated on December 11, 2013


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts