Custom Java system, Plus self intro

Discussions about custom-built testing platforms written in C, C++, or Java.
Post Reply
SystemGeek
Contributor
Contributor
Posts: 1
Joined: Thu Jul 14, 2005 12:29 am

Custom Java system, Plus self intro

Post by SystemGeek » Thu Jul 14, 2005 9:08 pm

I'm a programmer by career and a trader by habit. I have spent my free time over the last 2 years writing a custom back testing/trading program in Java from the ground up. There is still lots of work to be done on the program, but I have it to the point where I can build studies/setups and back test them. I’m interested in joining your discussions and maybe sharing code among the other Java coders.

Here is a description of my system.

Multi threaded none blocking
Real time data from Esignal and Interactive brokers
Historical database
Fuzzy matching system
Wave parsing and generation system
Several custom studies (rsi, macd, bands, pivots…)

Each main component and trading system is started under its own thread to prevent blocking and keeping the system running smoothly. The system is mostly event driven with many services available for subscription. For example, if a study uses 1 minute ER2 data, it will implement the interface BarListener and subscribe to that service. Tick data can be received by implementing TickListener and subscribing to that service. If a study is to be notified that a new high of the day is made, then the study implements the generic EventListener interface and subscribes to the service. Setups are generally created by grouping active studies that can achieve a true(Boolean) state, when all studies are a true then the setup is triggered and a trade is made. Other special studies can be used to set and adjust the trades stop and exit prices or exit at a certain time or market state. I'll detail more about the system if anyone is interested.

Most of the system I have tested are complete junk, but a few of them have achieved what I believe is a tradable state. I’m currently trading one system after it performed as expected over a 6 month forward test. I expect it to blow out any day now that real money is on the line. Just kidding… So far so good J

Right now I consider myself sort of a hack working on homebrew systems, but I would like to get real serious about it.

What kind of performance are people looking to get out of their systems.

How many here are doing homebrew systems in Java

David

Mowgli
Contributor
Contributor
Posts: 4
Joined: Sat Feb 21, 2004 10:48 am
Location: Columbus, OH

Post by Mowgli » Thu Feb 23, 2006 12:53 am

I also have been developing a Java BackTesting Platform for the past 2 years in my free time.

When you say performance of the system, do you mean the performance of Testing Platform or the Trading System?

About the Testing Platform - It takes about 2 seconds to test a strategy on a basket of 15 futures for 20 years on my P4 3.2GHz, 1GB RAM machine.

sluggo
Roundtable Knight
Roundtable Knight
Posts: 2986
Joined: Fri Jun 11, 2004 2:50 pm

Re: Custom Java system, Plus self intro

Post by sluggo » Thu Feb 23, 2006 9:56 am

Mowgli wrote:It takes about 2 seconds to test a strategy on a basket of 15 futures for 20 years on my P4 3.2GHz, 1GB RAM machine.
I'm using a Dell Latitude D810 laptop with a 2.1GHz processor and 2GB RAM. Running Trading Blox Builder release 2.0.10 (build date 12/17/2005) it takes 0.83 seconds to test a strategy on a basket of 15 futures for 20 years.

In this kind of test it's important to choose markets whose price history contains twenty full years of data. My 15 market basket consisted of the longest price series my vendor supplies: Wheat, Corn, Oats, Soybeans, Cocoa, Pork Bellies, Cattle, KC Wheat, Hogs, SoyMeal, Copper, Bean Oil, Platinum, Orange Juice, Silver.

My test setup is shown below.
SystemGeek wrote:What kind of performance are people looking to get out of their systems
A factor of 4 improvement (0.2 sec for a 20 year test of 15 futures) would be very nice.
Attachments
TBBspeed.png
TBBspeed.png (32.72 KiB) Viewed 9747 times

Mowgli
Contributor
Contributor
Posts: 4
Joined: Sat Feb 21, 2004 10:48 am
Location: Columbus, OH

Re: Custom Java system, Plus self intro

Post by Mowgli » Thu Feb 23, 2006 1:21 pm

sluggo wrote:A factor of 4 improvement (0.2 sec for a 20 year test of 15 futures) would be very nice.
c.f. got the same 3MA Crossover System to run on VeriTrader 2.0 C++ in 0.205 seconds. This was for a basket of 34 commodities for a 10 year test, with disk logging turned off. (More than twice the size of your basket and half the test period)

viewtopic.php?t=1688

My performance numbers are with disk logging on. I would have to see what numbers I get with disk logging turned off.

syswizard
Contributor
Contributor
Posts: 1
Joined: Sun Feb 12, 2006 4:15 pm
Location: Media, PA - USA

Post by syswizard » Fri Mar 03, 2006 5:52 pm

Java will always lose relative to C++. C++ will always lose relative to C.
That just seems to be the harsh reality of compiled vs. interpreted languages.

Forum Mgmnt
Roundtable Knight
Roundtable Knight
Posts: 1842
Joined: Tue Apr 15, 2003 11:02 am
Contact:

Post by Forum Mgmnt » Sat Mar 04, 2006 1:15 pm

syswizard wrote:Java will always lose relative to C++. C++ will always lose relative to C.
Most of the time I have seen significant performance differences, they have been due to design inefficiencies rather than compiled vs. interpreted issues. This is especially true with modern JIT Java Virtual Machines.

- Forum Mgmnt

Post Reply