Just another trading platform - But this time different!

Quote from mhtrader:

I remember years ago removing for example couple of x86 32bits floating point instructions from loops that goes around 1 symbol( some intraday 10 years back data, or something like that ).. And having a speed improvement of +20%. I'm backing what I'm saying with facts and personal experience.

I'm gonna post couple of dis-assemble examples soon in IL( and then jittered version in x86 32bits ) and also same version in C++ optimized code... something like: c=a+b; or something at that level of complexity: If that doesn't convince people.. and they want "to believe" in a non-faith related, pulverized-by-facts idea, then thats their choice :)

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.
 
€
Quote from jedwards:

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.

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?
 
Quote from mhtrader:

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?
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.

Quote from mhtrader:

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
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.
 
Quote from OpenQuant:

OpenQuant can backtest on Level II / Market Depth / Order book data... since 1997 :)

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.
 
Quote from 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).
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.
 
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 func( int param1 )
        {
	        int x = 0;

            int nTicks = System.Environment.TickCount;

	        for( int i=0;i< 30000000; i++)
	        {
                x = x + param1;
	        }

            for (int i = 0; i < 30000000; i++)
            {
                x = x - 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 func( int param1 )
{
	int x = 0;

	unsigned int uTicks = timeGetTime();

	for( int i=0;i< 30000000; i++)
	{
		x = x + param1;
	}

	for( int i=0;i< 30000000; i++)
	{
		x = x - param1;
	}

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

	return x;
}



int _tmain(int argc, _TCHAR* argv[])
{
	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~
 
Quote from 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.

Openquant executes a lot of FIX code in backtesting. That might be the main thing that slows it...
 
Back
Top