Just another trading platform - But this time different!

Discussion in 'Automated Trading' started by mhtrader, Jan 19, 2011.

  1. OpenQuant can backtest on Level II / Market Depth / Order book data... since 1997 :)
     
    #51     Jan 22, 2011
  2. My point is, you wanted to ask people for advice on your trading platform, and this has devolved into a 9+ page argument over which is the better language. You might be enjoying the arguing, but the thread has been completely overtaken by a topic that has nothing to do with your original intent.
     
    #52     Jan 22, 2011
  3. OpenQuant can backtest on Level II / Market Depth / Order book data... since 1997 :)
     
    #53     Jan 22, 2011
  4. mhtrader

    mhtrader

    €
    You are absolutely right. But some posts cannot remain unanswered because they perpetuate some untrue facts that requires clarification.

    A question I have for mostly traders: how do you guys feel about the idea of sharing with other users the result of your calculations (not your trading strategies, but thats a possibility too) as an option?

    This kind of goes against the current paradigm where everybody wants to encrypt everything and secure everything... isn't is time for a "paradigm shift"? :D

    Thanks
    ~mhtrader~

    PS: Did you get my PM?
     
    #54     Jan 22, 2011
  5. LeeD

    LeeD

    Do you mean backtesting aggregates like % of winners and profit factor? Or historical values of unnamed proprietary indicators?

    Neither looks like a big secret to me. On the other hand, if you consider the platform sending such things to you in an automated manner (even if you say it's just for "statistics"), this is something that will most certainly deter a lot of people.

    Well, there are some things (like entry and exit points) that people consider proprietary as there is a potential of "bootstrapping" a trading strategy from these... but lots of aggregate data like above only become sensityve when actual financial data is involved. For example, if you say "on a backtest my strategy produces 150% retrun" no one will blink, but if you say "I started managing a 100mln portfolio 3 years ago and produced annualised 150% returns since then" this may raise a few eyebrows.
     
    #55     Jan 22, 2011
  6. Swarm

    Swarm

    It can but it is excrutiatingly slow. When I backtested my forex strategy on OpenQuant it took 40 seconds against 10 years of hourly data (~ 60,000 bars).

    My C code, can do 300 backtests per second with the same strategy and data. Must be another example how C# and .net is faster than native C code on a Windows platform (not).

    Have a look at the great computer language shootout :-

    http://shootout.alioth.debian.org/u32q/which-programming-languages-are-fastest.php

    C# comes in substantially slower than C, Java and even Haskell.
     
    #56     Jan 28, 2011
  7. #57     Jan 28, 2011
  8. LeeD

    LeeD

    Whether C# is slower or not, there is no way it's 40x300=12,000 times slower. It must be the platform doing lots of background processing (like creating "order" objects), which you don't need in a backtester written with a specific strategy in mind.
     
    #58     Jan 28, 2011
  9. mhtrader

    mhtrader

    Here are 2 program doing the same: looping and adding numbers. One in C++ and one in C#. I was forced to tell the C++ Compiler to downgrade the optimizations. The compiler settings of C++ program has "function inlining" disabled because it was too fast( I'm not kidding ).

    Note that this is not a hand picked example from a group of examples.

    Here is the output. The test was repeated several( 20 or 30 times ) times under same conditions and always produced similar results:

    C++ Output::cool: :cool: :cool: :cool:

    Milliseconds: 22
    Milliseconds: 20
    Milliseconds: 23
    Milliseconds: 21
    Milliseconds: 21
    Milliseconds: 22
    Milliseconds: 21
    Milliseconds: 20
    Milliseconds: 20

    C# Output::eek: :eek: :eek: :eek:
    Milliseconds: 156
    Milliseconds: 140
    Milliseconds: 140
    Milliseconds: 141
    Milliseconds: 156
    Milliseconds: 140
    Milliseconds: 141
    Milliseconds: 140
    Milliseconds: 156

    Now imagine a loop thru an array/vector?

    Here are both programs:

    C# program
    PHP:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;


    namespace 
    ConsoleApplication1
    {
        class 
    Program
        
    {
            static 
    int funcint param1 )
            {
                
    int x 0;

                
    int nTicks System.Environment.TickCount;

                for( 
    int i=0;i30000000i++)
                {
                    
    param1;
                }

                for (
    int i 030000000i++)
                {
                    
    param1;
                }

                
    int nTimePassed System.Environment.TickCount nTicks;
        
                
    Console.WriteLine"Milliseconds: " nTimePassed.ToString() );

                return 
    x;
            }

            static 
    int Main(string[] args)
            {
                
    int x func(1) + func(2) + func(3) + func(4) + func(5) + func(6) + func(7) + func(8) + func(9);
                while (
    true);
                return 
    x;
            }
        }
    }
    C++ Program:
    PHP:
    #include "stdafx.h"
    #include <windows.h>

    int funcint param1 )
    {
        
    int x 0;

        
    unsigned int uTicks timeGetTime();

        for( 
    int i=0;i30000000i++)
        {
            
    param1;
        }

        for( 
    int i=0;i30000000i++)
        {
            
    param1;
        }

        
    unsigned int uTimePassed timeGetTime() - uTicks;
        
        
    std::cout << "Milliseconds: " << uTimePassed << "\n";

        return 
    x;
    }



    int _tmain(int argc_TCHARargv[])
    {
        
    int x func(1) + func(2) + func(3) + func(4) + func(5) + func(6) + func(7) + func(8) + func(9);
        while(
    true);
        return 
    x;
    }

    Thanks,
    ~mhtrader~
     
    #59     Jan 28, 2011
  10. Eight

    Eight

    Openquant executes a lot of FIX code in backtesting. That might be the main thing that slows it...
     
    #60     Jan 29, 2011