Thank you for prompt answer, will try your solution with the calc_stats().
Regarding IS and OOS optimization etc. What I do - I do optimization IS, get the best 100 and only then check them on the whole IS+OOS sample. Then take the best. Of course this way I can actually dump the greatest systems for both IS+OOS - they may never make it to the best 100 IS, or actually can pick the best IIS only to find that they are absolutely worthless in the OOS.
It would be great to incorporate the OOS results into selecting the best 100, but how does one do it without actually optimizing over the whole sample (IS+OOS)
thus risking that the result is simply curve fitting and not some intrinsic correlation/behavior found?
>> In addition, the statistical correlation between IS and OOS performance ... Hmm, I think I understand what you are saying. Very interesting! How can one use it for the optimizations and search for stocks? Is it true that calculating such correlation over lower number of parameter sets for certain stock can predict if it is worth to do more lengthy optimization? If so it would be a great tool - think of some strategy, run this short "correlation" test for whole universe of stocks (well, say SP500) and get the ballpark idea of what could be the expected results for proper, longer optimizations.
Do I get it right? How do you use this correlation?
Thank you, Leon
From: Jeffrey Owen Katz <jeffkatz@...> To: scientific-traders@yahoogroups.com Sent: Sat, October 24, 2009 9:01:20 AM Subject: Re: [scientific-traders] IS and OOS processing and optimization speed-up?
Hi,
Replace the default fitness function in calc_stats() with one that only
looks at the in-sample data.
Then, use setdates command to set up a in-sample start date, and
out-of-sample start date that encompass your in-sample data, and make the
out-of-sample end date only a few days beyond the out-of-sample end date.
Now you can optimize more quickly, and you do not need to modify
calc_stats() to cut out the OOS calculations.
When you are ready to test, just run the setdates command again with the
in-sample start and out-sample start dates the same, but the out-sample
end date set to point to the real end of the out-sample data rather than
to a data point a few bars beyond the in-sample end date data bar.
Hope this helps. Here are some additional thoughts:
I like to calculate both IS and OS because optimization often throws out
several good solutions, and it is worthwhile examine how each of these
unique "good" solutions appears out-sample. This is especially true when
evolving systems using "system fragment templates" and genetic algorithms.
In addition, the statistical correlation between IS and OOS performance
reveals whether optimization even makes sense! If there is something
consistent about the trading behaviour of a market that optimization can
capture, then there should be a reasonably good correlation between, say,
the IS and OS Sharpe ratios (with the correlation computed over every
combination of parameters); In other words, parameter sets that work well
in one sample should work well in the other, and those that work poorly in
one sample should work poorly in the other-- if this is not the case, why
should one expect that a good parameter set in any existing sample would
be a good set for actual trading on a future sample? If anyone does not
follow what I am getting at here, please let me know; perhaps I can
explain it more clearly.
Jeff
On Fri, 23 Oct 2009, LeonL wrote:
> Hi,
>
> It seems that during the optimization
> the trades simulation and calculations
> are performed both on in-sample
> and out-of-sample data.
> Since I use IS and OOS of the same length,
> than I figured that I can speed the optimization
> up x2(!!!) if I introduced a switch not to process OOS
> while optimizing! (my fitness function doesn't contain OOS results)
>
> When I tried that, I discovered that if I run it "calc only IS",
> then the statistics and the equity curve is completely thrown off.
>
> Any ideas why and how it can be fixed?
> I bet Jeff is the best to answer this question, but
> maybe somebody has already done this?
>
> Thanks,
> Leon
>
>
Hi,
You are absolutely correct: you need to test systems "live" in the market;
simulations are not the same thing at all.
I would add that this is especially true with limit orders, with systems
that trade less liquid securities, and with systems that buy or sell into
burst of movement (e.g., breakout systems). With systems trading the QQQQ
index (not options), the ES futures, or other super-liquid securities
during active market hours (and that are not of a breakout type)
simulations might yield results close to those obtained in real trading.
With systems that trade breakouts, individual stocks, less liquid futures,
or options, you are setting yourself up for virtually certain disaster if
you rely on simulations.
However, if you know the "biases", you can set up simulations that
overcompensate for them. These simulations will not be your final tests,
but systems that fail in such simulations can be excluded from further
investigation thus dramatically reducing the number of systems that will
need to be explored in the live markets.
See my additional notes inserted below:
On Fri, 2 Oct 2009, Richard Foulk wrote:
> Hi Jeff,
>
> I messed with this a few years ago, both my own code and connector
> packages sold by others. The biggest problem is testing. You have to
> place real orders in the market to test things, which can get expensive.
> I've built a number of market emulators and related tools, but they just
> aren't the same as the real thing at all. The market has it's own brand
> of randomness.
>
> Was mostly focused on short term ES trades of just a few minutes each --
> perhaps 200 trades per day. If your time-frame is significantly longer
> or the instrument you're trading is low volume it may not be as much of
> an issue. It's the trades during volume bursts that cause the most
> trouble.
Low-volume instruments are actually much worse in terms of getting
good simulations due to far greater uncertainty with respect to limit
order placement and fills. In fact, much of your edge trading low-volume
securites (e.g., many options and less liquid stocks) comes from the
artful use of limit orders! I would say simulations work best when
spreads are very small, the security is very liquid, and trades are not
triggered on sudden market movement; they are wosrt when spreads are large
or erratic, when volume is very low, and when trades are triggered on
sudden movement or breakouts.
>
> I got things to where I could walk away and not worry too much. But
> always stayed within earshot of the audio alerts in case something went
> wrong. (Hearing those particular sounds still makes my heart race.)
> Ran out of funds just as I was approaching break-even for the average
> day. Decided it was just too crazy to do without lots more funds.
>
Its tough. Even though I am a system maniac, I trade "hands on".
Jeff
> Good luck.
>
>
> Richard
>
>
> -----Original Message-----
> From: Jeffrey Owen Katz <jeffkatz@...>
> Reply-To: scientific-traders@yahoogroups.com
> To: scientific-traders@yahoogroups.com
> Subject: Re: [scientific-traders] Real time trading with Interactive
> Brokers
> Date: Fri, 2 Oct 2009 04:50:13 -0400 (EDT)
>
> Hi,
>
> We are planning to get C-Trader to work live with IB for completely
> automated trading. However, due to critical issues of fault tolerance,
> IB's frequent API changes, and difficulty getting help with writing a
> connector daemon, the project has been placed on hold. Basically, the
> plan is to develop a Linux/Unix connector daemon that would sit between IB
> and C-Trader or, for that matter, any other program able to read and write
> files and pipes. The price, volume, and position series would be
> maintained by the daemon in a fault-tolerant manner in shared files that
> the client software could read while trading orders could be written by
> the client software to a simple pipe. The daemon would handle momentary
> disconnects, backfill any gaps with historical data, deal with a variety
> glitches, and handle all other matters so that the client software could
> focus exclusively on reading the data and writing trading orders.
>
> This turned out to be a very complex project. Since starting it, I have
> learned that even TradeStation has not properly implemented automated
> trading or fault tolerance in that, from what others have told me, "you
> cannot walk away for a cup of coffee and expect your positions to be what
> TradeStation thinks they are, or your system to be in sync with the
> market, when you return". In other words, TradeStation cut corners--kind
> of scary.
>
> C-Trader currently can use data from IB, but you need the third-party
> jTWSdata or jTWSdump packages to pull the data from IB and maintain the
> shared data files. There is currently no ability to directly write orders
> from C-Trader to IB.
>
> Hope this clarifies the situation.
>
> Jeff
>
> P.S.
>
> If anyone out there wants to start an open-source effort to develop a
> generic, easy-to-use, fault-tolerant connector of the type I described
> above, please contact me.
>
>
>
>
>
> On Fri, 2 Oct 2009, weitau wrote:
>
>> Hi Jeff, I thought I read something about C-Trader being able to work with IB
to get real time data and execute trades. Is this still in the works? thanks,
Robert
>>
>>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
>
Hi,
Replace the default fitness function in calc_stats() with one that only
looks at the in-sample data.
Then, use setdates command to set up a in-sample start date, and
out-of-sample start date that encompass your in-sample data, and make the
out-of-sample end date only a few days beyond the out-of-sample end date.
Now you can optimize more quickly, and you do not need to modify
calc_stats() to cut out the OOS calculations.
When you are ready to test, just run the setdates command again with the
in-sample start and out-sample start dates the same, but the out-sample
end date set to point to the real end of the out-sample data rather than
to a data point a few bars beyond the in-sample end date data bar.
Hope this helps. Here are some additional thoughts:
I like to calculate both IS and OS because optimization often throws out
several good solutions, and it is worthwhile examine how each of these
unique "good" solutions appears out-sample. This is especially true when
evolving systems using "system fragment templates" and genetic algorithms.
In addition, the statistical correlation between IS and OOS performance
reveals whether optimization even makes sense! If there is something
consistent about the trading behaviour of a market that optimization can
capture, then there should be a reasonably good correlation between, say,
the IS and OS Sharpe ratios (with the correlation computed over every
combination of parameters); In other words, parameter sets that work well
in one sample should work well in the other, and those that work poorly in
one sample should work poorly in the other-- if this is not the case, why
should one expect that a good parameter set in any existing sample would
be a good set for actual trading on a future sample? If anyone does not
follow what I am getting at here, please let me know; perhaps I can
explain it more clearly.
Jeff
On Fri, 23 Oct 2009, LeonL wrote:
> Hi,
>
> It seems that during the optimization
> the trades simulation and calculations
> are performed both on in-sample
> and out-of-sample data.
> Since I use IS and OOS of the same length,
> than I figured that I can speed the optimization
> up x2(!!!) if I introduced a switch not to process OOS
> while optimizing! (my fitness function doesn't contain OOS results)
>
> When I tried that, I discovered that if I run it "calc only IS",
> then the statistics and the equity curve is completely thrown off.
>
> Any ideas why and how it can be fixed?
> I bet Jeff is the best to answer this question, but
> maybe somebody has already done this?
>
> Thanks,
> Leon
>
>
Hi,
It seems that during the optimization
the trades simulation and calculations
are performed both on in-sample
and out-of-sample data.
Since I use IS and OOS of the same length,
than I figured that I can speed the optimization
up x2(!!!) if I introduced a switch not to process OOS
while optimizing! (my fitness function doesn't contain OOS results)
When I tried that, I discovered that if I run it "calc only IS",
then the statistics and the equity curve is completely thrown off.
Any ideas why and how it can be fixed?
I bet Jeff is the best to answer this question, but
maybe somebody has already done this?
Thanks,
Leon
Hi,
The throttling is no problem, as one can collect the data in several
passes with a few minutes between them. In fact, this method is
implemented in jTWSdump.
The real problem is that IB only maintains data going back about 1 year
from the present. I have raw tick/transaction data from CME/Globex for
every contract traded on that system that runs from Jan 2003 through Oct
2007. However, that data contains only the ES, not the older pit-traded
SP-500.
Jeff
On Wed, 14 Oct 2009, yellowishsubmarine wrote:
> Does anyone have advice on getting historical intraday data at a
> reasonable price to use with C-trader? I'm looking for 2 to 4 years of
> S&P 500 data with 5 or 15 min resolution. From what I understand, one
> way would be to get an account with IB, purchase jTWSdump and use both
> to create and save a database. Has anyone tried this? How far back does
> the intraday data goes? I have read on other forums that it is difficult
> to get historical data from IB since it appears to throttle back
> requests. Some also question the accuracy of the IB feed. Can anyone
> comment? Thanks. Marc
>
>
Hi,
The last valid bars are indeed used to fill missing bars. However, filled
(as opposed to real) bars are marked by having volumes of exactly 0.0;
valid bars use a "soft" zero (a very small positive number like 1.0E-5) to
represent zero volume.
The reason why we have all bars present (even if filled with past data) is
so that multiple series will always be correctly aligned with one another.
The trading model can easily determine whether the bars are filled or
real/valid. If you need an MA that ignores missing data entirely, it can
be easily implemented by looking at the volume data (for hard zero values)
as well as price.
Jeff
On Tue, 13 Oct 2009, weitau wrote:
> I've noticed the same data shifting problem with 1 minute bars as well.
> However since all the data was shifted by the same amount, we ignored
> it.
>
> Another issue we noticed is that while importing, if there were no
> trades for that period, the importer will simply use the last available
> quote.... so there will be a series of stale quotes in the time series.
> This would throw off any indicators like moving averages.
>
> --- In scientific-traders@yahoogroups.com, "LeonL" <leonlevinov@...> wrote:
>>
>> Hi,
>>
>> Have anybody come across the same problem?
>>
>> I am working with intraday stock data.
>>
>> Recently I have discovered a problem in the data that is
>> converted into CTrader database file (using ibkapnd).
>> I started to suspect something and have printed the data out from the
>> trops in the same format as the source data.
>> Somewhere in the middle of the file (it is 4 years of 3min data)
>> I see the problem - the data at the beginning of the day - 9:30 till 10:27 -
is just repetition of the same data.
>> This line's data doesn't really match anything (though close to the last bar
of previous day) and the volume field is 0.
>>
>> 20080423,09:30:00,17.03,17.03,17.03,17.03,0
>> 20080423,09:33:00,17.03,17.03,17.03,17.03,0
>> 20080423,09:36:00,17.03,17.03,17.03,17.03,0
>> ...
>> ...
>> 20080423,10:24:00,17.03,17.03,17.03,17.03,0
>> 20080423,10:27:00,17.03,17.03,17.03,17.03,0
>>
>> At 10:30 it resumes, but the data used is from exactly 1 hour ago:
>>
>> 20080423,10:30:00,18.10,18.14,17.90,17.93,80348 = data of 9:30
>> 20080423,10:33:00,17.93,17.93,17.60,17.84,204993 = data of 9:33
>> 20080423,10:36:00,17.83,17.84,17.70,17.71,129883 = data of 9:36
>> ...
>> this goes till the 15:57. Data in each data line is shifted by +1hr.
>> The original data from 15:00 till 15:57 doesn't appear at all!
>>
>> The next day repeats the pattern.
>> And so it goes for a month and half!!
>>
>> Then it normalizes.
>>
>> Any help will be appreciated,
>> Thank you,
>> Leon
>>
>
>
>
From: weitau <robert@...> Subject: [scientific-traders] Re: intraday data To: scientific-traders@yahoogroups.com Date: Wednesday, October 14, 2009, 2:16 AM
--- In scientific-traders@ yahoogroups. com, "yellowishsubmarine " <yellowishsubmarine @...> wrote: > > Does anyone have advice on getting historical intraday data at a reasonable price to use with C-trader? I'm looking for 2 to 4 years of S&P 500 data with 5 or 15 min resolution. From what I understand, one way would be to get an account with IB, purchase jTWSdump and use both to create and save a database. Has anyone tried this? How far back does the intraday data goes? I have read on other forums that it is difficult to get historical data from IB since it appears to throttle back requests. Some also question the
accuracy of the IB feed. Can anyone comment? Thanks. Marc >
http://pitrading.com/historical_data.htm
--- In scientific-traders@yahoogroups.com, "yellowishsubmarine"
<yellowishsubmarine@...> wrote:
>
> Does anyone have advice on getting historical intraday data at a reasonable
price to use with C-trader? I'm looking for 2 to 4 years of S&P 500 data with 5
or 15 min resolution. From what I understand, one way would be to get an account
with IB, purchase jTWSdump and use both to create and save a database. Has
anyone tried this? How far back does the intraday data goes? I have read on
other forums that it is difficult to get historical data from IB since it
appears to throttle back requests. Some also question the accuracy of the IB
feed. Can anyone comment? Thanks. Marc
>
Does anyone have advice on getting historical intraday data at a reasonable
price to use with C-trader? I'm looking for 2 to 4 years of S&P 500 data with 5
or 15 min resolution. From what I understand, one way would be to get an account
with IB, purchase jTWSdump and use both to create and save a database. Has
anyone tried this? How far back does the intraday data goes? I have read on
other forums that it is difficult to get historical data from IB since it
appears to throttle back requests. Some also question the accuracy of the IB
feed. Can anyone comment? Thanks. Marc
The problem arose since I used the CSV file with the dates and time that are correct and no need for daylight saving time corrections.
Thanks a lot for the tip, Leon
From: Nick Fairbank <nick@...> To: scientific-traders@yahoogroups.com Sent: Tue, October 13, 2009 2:42:16 PM Subject: Re: [scientific-traders] having intraday data conversion problem
Hi Leon,
First thought - is it something to do with the 'corrections' which Jeff
has included for IB data in respect of time-zones and summer-time
(American: "Daylight Saving Hours") shifts?
I found data was moved all over the place compared to the source files
when I tried matching trades up recently. Try checking the various
routines supplied in "idddbmp" and in particular ibkapnd, which you
identify.
Nick
LeonL wrote:
>
>
> Hi,
>
> Have anybody come across the same problem?
>
> I am working with intraday stock data.
>
> Recently I have discovered a problem in the data that is
> converted into CTrader database file (using ibkapnd).
> I started to suspect something and have printed the data out from the
> trops in the same format as the source data.
> Somewhere in the middle of the file (it is 4 years of 3min data)
> I see the problem - the data at the beginning of the day - 9:30 till
> 10:27 - is just repetition of the same data.
> This line's data doesn't really match anything (though close to the
> last bar of previous day) and the volume field is 0.
>
> 20080423,09: 30:00,17. 03,17.03, 17.03,17. 03,0
> 20080423,09: 33:00,17. 03,17.03, 17.03,17. 03,0
> 20080423,09: 36:00,17. 03,17.03, 17.03,17. 03,0
> ...
> ...
> 20080423,10: 24:00,17. 03,17.03, 17.03,17. 03,0
> 20080423,10: 27:00,17. 03,17.03, 17.03,17. 03,0
>
> At 10:30 it resumes, but the data used is from exactly 1 hour ago:
>
> 20080423,10: 30:00,18. 10,18.14, 17.90,17. 93,80348 = data of 9:30
> 20080423,10: 33:00,17. 93,17.93, 17.60,17. 84,204993 = data of 9:33
> 20080423,10: 36:00,17. 83,17.84, 17.70,17. 71,129883 = data of 9:36
> ...
> this goes till the 15:57. Data in each data line is shifted by +1hr.
> The original data from 15:00 till 15:57 doesn't appear at all!
>
> The next day repeats the pattern.
> And so it goes for a month and half!!
>
> Then it normalizes.
>
> Any help will be appreciated,
> Thank you,
> Leon
>
>
I've noticed the same data shifting problem with 1 minute bars as well. However
since all the data was shifted by the same amount, we ignored it.
Another issue we noticed is that while importing, if there were no trades for
that period, the importer will simply use the last available quote.... so there
will be a series of stale quotes in the time series. This would throw off any
indicators like moving averages.
--- In scientific-traders@yahoogroups.com, "LeonL" <leonlevinov@...> wrote:
>
> Hi,
>
> Have anybody come across the same problem?
>
> I am working with intraday stock data.
>
> Recently I have discovered a problem in the data that is
> converted into CTrader database file (using ibkapnd).
> I started to suspect something and have printed the data out from the
> trops in the same format as the source data.
> Somewhere in the middle of the file (it is 4 years of 3min data)
> I see the problem - the data at the beginning of the day - 9:30 till 10:27 -
is just repetition of the same data.
> This line's data doesn't really match anything (though close to the last bar
of previous day) and the volume field is 0.
>
> 20080423,09:30:00,17.03,17.03,17.03,17.03,0
> 20080423,09:33:00,17.03,17.03,17.03,17.03,0
> 20080423,09:36:00,17.03,17.03,17.03,17.03,0
> ...
> ...
> 20080423,10:24:00,17.03,17.03,17.03,17.03,0
> 20080423,10:27:00,17.03,17.03,17.03,17.03,0
>
> At 10:30 it resumes, but the data used is from exactly 1 hour ago:
>
> 20080423,10:30:00,18.10,18.14,17.90,17.93,80348 = data of 9:30
> 20080423,10:33:00,17.93,17.93,17.60,17.84,204993 = data of 9:33
> 20080423,10:36:00,17.83,17.84,17.70,17.71,129883 = data of 9:36
> ...
> this goes till the 15:57. Data in each data line is shifted by +1hr.
> The original data from 15:00 till 15:57 doesn't appear at all!
>
> The next day repeats the pattern.
> And so it goes for a month and half!!
>
> Then it normalizes.
>
> Any help will be appreciated,
> Thank you,
> Leon
>
Hi Leon,
First thought - is it something to do with the 'corrections' which Jeff
has included for IB data in respect of time-zones and summer-time
(American: "Daylight Saving Hours") shifts?
I found data was moved all over the place compared to the source files
when I tried matching trades up recently. Try checking the various
routines supplied in "idddbmp" and in particular ibkapnd, which you
identify.
Nick
LeonL wrote:
>
>
> Hi,
>
> Have anybody come across the same problem?
>
> I am working with intraday stock data.
>
> Recently I have discovered a problem in the data that is
> converted into CTrader database file (using ibkapnd).
> I started to suspect something and have printed the data out from the
> trops in the same format as the source data.
> Somewhere in the middle of the file (it is 4 years of 3min data)
> I see the problem - the data at the beginning of the day - 9:30 till
> 10:27 - is just repetition of the same data.
> This line's data doesn't really match anything (though close to the
> last bar of previous day) and the volume field is 0.
>
> 20080423,09:30:00,17.03,17.03,17.03,17.03,0
> 20080423,09:33:00,17.03,17.03,17.03,17.03,0
> 20080423,09:36:00,17.03,17.03,17.03,17.03,0
> ...
> ...
> 20080423,10:24:00,17.03,17.03,17.03,17.03,0
> 20080423,10:27:00,17.03,17.03,17.03,17.03,0
>
> At 10:30 it resumes, but the data used is from exactly 1 hour ago:
>
> 20080423,10:30:00,18.10,18.14,17.90,17.93,80348 = data of 9:30
> 20080423,10:33:00,17.93,17.93,17.60,17.84,204993 = data of 9:33
> 20080423,10:36:00,17.83,17.84,17.70,17.71,129883 = data of 9:36
> ...
> this goes till the 15:57. Data in each data line is shifted by +1hr.
> The original data from 15:00 till 15:57 doesn't appear at all!
>
> The next day repeats the pattern.
> And so it goes for a month and half!!
>
> Then it normalizes.
>
> Any help will be appreciated,
> Thank you,
> Leon
>
>
Hi,
Have anybody come across the same problem?
I am working with intraday stock data.
Recently I have discovered a problem in the data that is
converted into CTrader database file (using ibkapnd).
I started to suspect something and have printed the data out from the
trops in the same format as the source data.
Somewhere in the middle of the file (it is 4 years of 3min data)
I see the problem - the data at the beginning of the day - 9:30 till 10:27 - is
just repetition of the same data.
This line's data doesn't really match anything (though close to the last bar of
previous day) and the volume field is 0.
20080423,09:30:00,17.03,17.03,17.03,17.03,0
20080423,09:33:00,17.03,17.03,17.03,17.03,0
20080423,09:36:00,17.03,17.03,17.03,17.03,0
...
...
20080423,10:24:00,17.03,17.03,17.03,17.03,0
20080423,10:27:00,17.03,17.03,17.03,17.03,0
At 10:30 it resumes, but the data used is from exactly 1 hour ago:
20080423,10:30:00,18.10,18.14,17.90,17.93,80348 = data of 9:30
20080423,10:33:00,17.93,17.93,17.60,17.84,204993 = data of 9:33
20080423,10:36:00,17.83,17.84,17.70,17.71,129883 = data of 9:36
...
this goes till the 15:57. Data in each data line is shifted by +1hr.
The original data from 15:00 till 15:57 doesn't appear at all!
The next day repeats the pattern.
And so it goes for a month and half!!
Then it normalizes.
Any help will be appreciated,
Thank you,
Leon
Hi Jeff,
I messed with this a few years ago, both my own code and connector
packages sold by others. The biggest problem is testing. You have to
place real orders in the market to test things, which can get expensive.
I've built a number of market emulators and related tools, but they just
aren't the same as the real thing at all. The market has it's own brand
of randomness.
Was mostly focused on short term ES trades of just a few minutes each --
perhaps 200 trades per day. If your time-frame is significantly longer
or the instrument you're trading is low volume it may not be as much of
an issue. It's the trades during volume bursts that cause the most
trouble.
I got things to where I could walk away and not worry too much. But
always stayed within earshot of the audio alerts in case something went
wrong. (Hearing those particular sounds still makes my heart race.)
Ran out of funds just as I was approaching break-even for the average
day. Decided it was just too crazy to do without lots more funds.
Good luck.
Richard
-----Original Message-----
From: Jeffrey Owen Katz <jeffkatz@...>
Reply-To: scientific-traders@yahoogroups.com
To: scientific-traders@yahoogroups.com
Subject: Re: [scientific-traders] Real time trading with Interactive
Brokers
Date: Fri, 2 Oct 2009 04:50:13 -0400 (EDT)
Hi,
We are planning to get C-Trader to work live with IB for completely
automated trading. However, due to critical issues of fault tolerance,
IB's frequent API changes, and difficulty getting help with writing a
connector daemon, the project has been placed on hold. Basically, the
plan is to develop a Linux/Unix connector daemon that would sit between IB
and C-Trader or, for that matter, any other program able to read and write
files and pipes. The price, volume, and position series would be
maintained by the daemon in a fault-tolerant manner in shared files that
the client software could read while trading orders could be written by
the client software to a simple pipe. The daemon would handle momentary
disconnects, backfill any gaps with historical data, deal with a variety
glitches, and handle all other matters so that the client software could
focus exclusively on reading the data and writing trading orders.
This turned out to be a very complex project. Since starting it, I have
learned that even TradeStation has not properly implemented automated
trading or fault tolerance in that, from what others have told me, "you
cannot walk away for a cup of coffee and expect your positions to be what
TradeStation thinks they are, or your system to be in sync with the
market, when you return". In other words, TradeStation cut corners--kind
of scary.
C-Trader currently can use data from IB, but you need the third-party
jTWSdata or jTWSdump packages to pull the data from IB and maintain the
shared data files. There is currently no ability to directly write orders
from C-Trader to IB.
Hope this clarifies the situation.
Jeff
P.S.
If anyone out there wants to start an open-source effort to develop a
generic, easy-to-use, fault-tolerant connector of the type I described
above, please contact me.
On Fri, 2 Oct 2009, weitau wrote:
> Hi Jeff, I thought I read something about C-Trader being able to work with IB
to get real time data and execute trades. Is this still in the works? thanks,
Robert
>
>
------------------------------------
Yahoo! Groups Links
Hi,
We are planning to get C-Trader to work live with IB for completely
automated trading. However, due to critical issues of fault tolerance,
IB's frequent API changes, and difficulty getting help with writing a
connector daemon, the project has been placed on hold. Basically, the
plan is to develop a Linux/Unix connector daemon that would sit between IB
and C-Trader or, for that matter, any other program able to read and write
files and pipes. The price, volume, and position series would be
maintained by the daemon in a fault-tolerant manner in shared files that
the client software could read while trading orders could be written by
the client software to a simple pipe. The daemon would handle momentary
disconnects, backfill any gaps with historical data, deal with a variety
glitches, and handle all other matters so that the client software could
focus exclusively on reading the data and writing trading orders.
This turned out to be a very complex project. Since starting it, I have
learned that even TradeStation has not properly implemented automated
trading or fault tolerance in that, from what others have told me, "you
cannot walk away for a cup of coffee and expect your positions to be what
TradeStation thinks they are, or your system to be in sync with the
market, when you return". In other words, TradeStation cut corners--kind
of scary.
C-Trader currently can use data from IB, but you need the third-party
jTWSdata or jTWSdump packages to pull the data from IB and maintain the
shared data files. There is currently no ability to directly write orders
from C-Trader to IB.
Hope this clarifies the situation.
Jeff
P.S.
If anyone out there wants to start an open-source effort to develop a
generic, easy-to-use, fault-tolerant connector of the type I described
above, please contact me.
On Fri, 2 Oct 2009, weitau wrote:
> Hi Jeff, I thought I read something about C-Trader being able to work with IB
to get real time data and execute trades. Is this still in the works? thanks,
Robert
>
>
Hi Jeff, I thought I read something about C-Trader being able to work with IB to
get real time data and execute trades. Is this still in the works? thanks,
Robert
From: Jeffrey Owen Katz <jeffkatz@...> To: scientific-traders@yahoogroups.com Sent: Thursday, October 1, 2009 9:49:35 PM Subject: Re: [scientific-traders] XAverage length multiplied 3 times - a bug?
Hi,
The reason the length is 3*m is because we are dealing with an exponential
moving average-- in reality, you would theoretically want to sum back to
the start of the series (way more than 3*m), but by the time you get back
3*m bars, the weights are small enough to ignore in most cases. If you
look at XAverageS (the vectorized version that runs on a complete series)
you will see that processing is started right from the start of the
series. I used the 3*m lookback to save time when 3*m is less than the
length of the series and one is computing exponential MAs at specific
points.
Hope this explains things.
Jeff
On Thu, 1 Oct 2009, LeonL wrote:
> It seems that in the function (libmisc.c) the smoothing length
> is taken 3 times longer.
> in the forth line ...i=...cb-3* n... effectively making the length x3.
>
> float XAverage (float v[], long n, long cb) {
> /* Exponential n-period moving average at bar cb */
> long i; double fac, sum1, sum2;
> for(sum1=sum2= 0.0, fac=2.0/(1.0+ n), i=max(0,cb-3* n); i<=cb; i++) {
> sum1+=(fac*( (double)v[ i]-sum1)) ;
> sum2+=(fac*( 1.0-sum2) );
> }
> return((float) (sum1/sum2) );
> }
>
>
> BTW,
> Has anybody tried to port C-Trader strategies to TS
> as DLL code?
>
>
Hi,
The reason the length is 3*m is because we are dealing with an exponential
moving average-- in reality, you would theoretically want to sum back to
the start of the series (way more than 3*m), but by the time you get back
3*m bars, the weights are small enough to ignore in most cases. If you
look at XAverageS (the vectorized version that runs on a complete series)
you will see that processing is started right from the start of the
series. I used the 3*m lookback to save time when 3*m is less than the
length of the series and one is computing exponential MAs at specific
points.
Hope this explains things.
Jeff
On Thu, 1 Oct 2009, LeonL wrote:
> It seems that in the function (libmisc.c) the smoothing length
> is taken 3 times longer.
> in the forth line ...i=...cb-3*n... effectively making the length x3.
>
> float XAverage (float v[], long n, long cb) {
> /* Exponential n-period moving average at bar cb */
> long i; double fac, sum1, sum2;
> for(sum1=sum2=0.0, fac=2.0/(1.0+n), i=max(0,cb-3*n); i<=cb; i++) {
> sum1+=(fac*((double)v[i]-sum1));
> sum2+=(fac*(1.0-sum2));
> }
> return((float)(sum1/sum2));
> }
>
>
> BTW,
> Has anybody tried to port C-Trader strategies to TS
> as DLL code?
>
>
It seems that in the function (libmisc.c) the smoothing length
is taken 3 times longer.
in the forth line ...i=...cb-3*n... effectively making the length x3.
float XAverage (float v[], long n, long cb) {
/* Exponential n-period moving average at bar cb */
long i; double fac, sum1, sum2;
for(sum1=sum2=0.0, fac=2.0/(1.0+n), i=max(0,cb-3*n); i<=cb; i++) {
sum1+=(fac*((double)v[i]-sum1));
sum2+=(fac*(1.0-sum2));
}
return((float)(sum1/sum2));
}
BTW,
Has anybody tried to port C-Trader strategies to TS
as DLL code?
The strategy that I tested was not out-of-the-box. And as to comparing apples to apples, I think that it might be that my test is the closest you can get - if you ask somebody to run a strategy for you there is always the issue of different hardware and software configuration. As I said my test shows at least 20 times performance improvement. Make that times 4 if it is quad core. BTW, with TS you can also utilize the power of multicore - I ran it inside VmWare - four instances on a quad machine simultaneously. The CPU stood on 100% flat for days as I ran the optimizations. And I am sure you know that the last TS versions you have the genetic optimization too.
I think it would be a
good analogy - TS is a great swiss army knife. But as such it is not good at any specific part - neither research, nor trading. For a serious work, IMHO, you need a set of tools. TS is certainly not enough for good research. I cannot say that CTrader is a perfect tool (as I said it seriously lacks in graphic representation of the results and analysis - I hope Jeff will find time to improve it) but it has a very good potential if you are ready to do your own programming and use it together with other tools. Like what Barnabas mentioned - using MT4 for charting with feed from CT. TS could be also used with ACE or some other library to read from files.
Leon
From:
cohndw <minimax9999@...> To: scientific-traders@yahoogroups.com Sent: Friday, August 21, 2009 4:50:43 PM Subject: [scientific-traders] Re: Time benchmark of C-Trader pro
Leon,
Thanks for your rapid and extensive feedback. I did not know that you could run multiple instances, one for each processor - that can be worth quite a bit. I am very familiar with TradeStation, so I do appreciate its end to end functionality which makes it very easy to use.
Can you recall the sample strategy you benchmarked in TS vs C-Trader Pro? Was it one of the simple out of the box strategies which was provided with TradeStation?
Dave
--- In scientific-traders@ yahoogroups. com, Leon Levinov <leonlevinov@ ...> wrote:
>
> Dave,
>
> I have been where you are some time ago - wondering if this is the right tool for my needs,
> but couldn't get enough info. So I will try to help you.
>
> Performance- wise:
> I have compared a sample strategy run in TS and in C-Trader Pro.
> What I got is about 20 times performance improvement - after doing
> some tweaking. "About" since the C-Trader runs on a slightly different processor
> and I run it on Linux within VmWare which seems to be a bit slow.
> So the comparison is not precise. I didn't get to x100 improvement, but
> may be could go beyond x20 if I will run Linux native.
> Would be interesting to hear if somebody did go >x20 and how.
>
> Feature-wise, here are some cons and pros:
> 1. Tradestation is, in a sense, a complete tool out of the box: coding -> data stream + testing/optimizing -> charting -> trading
>
> 2. C-Trader does not provide the data feed, no charting (so cannot see visually the trades, the indicators and so on),
> nor can you trade from it. You will need a separate platform in order to trade and most probably will have to rewrite the code for it.
> So these are several big "cons".
> On the other hand C-Trader:
> gives you a lot of power for system development
> - is many times faster, and you can run several instances to utilize all your cores
> (which in case of quad processor gives you another x4 times speed boost).
> - you can automate the process as much as you like via some scripting capability that
> you can also extend. E.g. if you want to run your
> optimization in TS for several/many stocks you have to manually configure
> the optimizations one by one (or copy paste, but still - cannot run for say 500).
> CTrader gives you some scripting tools that solve this for you easily.
> - After optimization in TS - if you want to see how several top parameter sets perform
> in out-of-sample - welcome again to routine manual work - which can take lots of time.
> Again in CT you can do it in script.
> - Anything that you don't have "built in" in TS - forget it. Anything you want in CT - you can
> extend it - of course by writing C/C++.
>
> In my opinion one needs some programming background to get it all up running and to
> utilize it to the full.
> though it is only my opinion. I was a programmer about a 10 years ago and it took me
> about 2-3 weeks to get to feel somewhat comfortable with the CTrader, but at least 1 week
> was spent on fighting Ubuntu problems, and my level of comfort may be higher/lower than
> other's.
>
> Here, hope that helps.
>
> Leon
>
>
>
>
> ____________ _________ _________ __
> From: cohndw <minimax9999@ ...>
> To: scientific-traders@ yahoogroups. com
> Sent: Thursday, August 20, 2009 7:32:48 PM
> Subject: [scientific- traders] Time benchmark of C-Trader pro
>
>
> I will purchase C-Trader Pro if it significantly outperforms TradeStation in speed(5-10x increase) for fairly large datasets. I have asked questions before in this forum and have been told that C-Trader Pro is between 20 and 100+ times faster than TradeStation, depending on the type of analysis. As I don't see C-Trader Pro being offered on a trial basis to verify the speed difference, I am wondering if any basic benchmarks have been performed to verify C-Trader Pro's speed advantage? A search of this forum and a Google search turned up nothing definitive.
>
> I have performed a time benchmark on NinjaTrader and TradeStation of a simple moving average crossover buy and sell system (using 10 and 25 period moving averages) on 1-minute ES mini data from 1/4/1999 to 8/17/2009. This provides a fairly large data set (several million bars) and a large number of trades (several hundred thousand). I know this is by no means as large or as complicated as C-Trader Pro says they can go, but it provides a simple reference. NinjaTrader uses a script language to generate C++ code and then compiles it, so I expected it to be very fast when compared to TradeStation, which does not produce a stand-alone executable in the end. I was a bit surprised though with the results and the comparison. I will release the results for this comparison when someone can provide a C-Trader Pro benchmark.
>
> Thanks,
>
> Dave
>
Jeff,
Thanks for taking the time to reply quickly and thoroughly.
My programming backgrounds helps me understand your points about the differences
between compiled, optimized executable code and an interpretive scripting
language, as well as circular buffers vs linear array structures. The circular
buffers have to constantly be rebuilt each bar as the strategy progresses
through the data while all that is required with a linear structure is a pointer
shift with each bar. As I am an extensive user of genetic optimization I do
also appreciate the huge performance differences that genetic optimization
offers over exhaustive optimizations.
What I am trying to get a feel for is the native difference in performance
between C-Trader Pro and TradeStation for a simple strategy with a fairly large
amount of data. I know that as I add complexity with arrays, multiple time
frames, etc to the strategy the performance difference should grow. Is there
anyway you can create the simple moving average benchmark in C-Trader Pro that I
described (1 minute ES mini future data going back to 1/1/99). If obtaining the
data presents an issue I can quickly benchmark TradeStation with any stock's 1-
minute data, or if required I can work with hourly or daily data with standard
futures or stocks. I can also benchmark other simple strategies, such as gap
strategies, band strategies, etc. I just want a simple apples to apples
comparison.
Thanks,
Dave
--- In scientific-traders@yahoogroups.com, Jeffrey Owen Katz <jeffkatz@...>
wrote:
>
> Hi,
>
> C-Trader does indeed appear to be far faster than TradeStation based on
> tests I conducted in the late 1990s. Much of this speed can be explained
> simply by the fact that trading models in C-Trader are compiled (with an
> optimizing compiler, no less) into machine code before they are executed;
> by way of contrast, Easy Language code in TradeStation is interpreted,
> line by line, again and again, as it runs. Another factor has to do with
> the use of linear array structures in C-Trader versus circular buffers
> (which provide a system with a single bar at a time) in TradeStation--
> circular buffers are great for running a system real-time with a live
> feed, but are neither necessary nor appropriate for system development
> using historical data.
>
> There was a simple benchmark in The Encyclopedia of Trading Strategies
> (McGraw Hill, 2000) of an earlier version of C-Trader. That book also
> provided some comparisons of brute force versus genetic optimization in
> terms of how fast a globally optimal solution could be found. C-Trader
> was far faster than TradeStation when using brute-force optimization (what
> TradeStation uses), and astronomically faster at finding a globally
> optimal solution when using the built-in genetic algorithm, especially
> when many parameters had to be stepped through many values.
>
> I do not have TradeStation, so I cannot do a comparison. Perhaps there is
> someone else on the group who can run a simple optimization on a large
> data set and see how the different platforms perform.
>
> Jeff
>
> On Thu, 20 Aug 2009, cohndw wrote:
>
> > I will purchase C-Trader Pro if it significantly outperforms
> > TradeStation in speed(5-10x increase) for fairly large datasets. I have
> > asked questions before in this forum and have been told that C-Trader
> > Pro is between 20 and 100+ times faster than TradeStation, depending on
> > the type of analysis. As I don't see C-Trader Pro being offered on a
> > trial basis to verify the speed difference, I am wondering if any basic
> > benchmarks have been performed to verify C-Trader Pro's speed advantage?
> > A search of this forum and a Google search turned up nothing definitive.
> >
> > I have performed a time benchmark on NinjaTrader and TradeStation of a
> > simple moving average crossover buy and sell system (using 10 and 25
> > period moving averages) on 1-minute ES mini data from 1/4/1999 to
> > 8/17/2009. This provides a fairly large data set (several million bars)
> > and a large number of trades (several hundred thousand). I know this is
> > by no means as large or as complicated as C-Trader Pro says they can go,
> > but it provides a simple reference. NinjaTrader uses a script language
> > to generate C++ code and then compiles it, so I expected it to be very
> > fast when compared to TradeStation, which does not produce a stand-alone
> > executable in the end. I was a bit surprised though with the results
> > and the comparison. I will release the results for this comparison when
> > someone can provide a C-Trader Pro benchmark.
> >
> > Thanks,
> >
> > Dave
> >
> >
>
Barnabas,
Thanks for your quick reply. I appreciate your explanation of the development
sequence between C-Trader Pro and MT4, and this is what I would expect to do,
expect using TradeStation in place of MT4.
I have benchmarked TradeStation and NinjaTrader both with the simple moving
average crossover system as described in my first post on this subject. What I
am hoping is that someone will benchmark C-Trader Pro for this same system and
data so we can compare the packages. I am assuming that setting up a simple
moving average crossover test in C-Trader Pro would be relatively quick.
By the way, it is not important to me that the benchmark be done on ES mini
futures data - any stock would work with 1 minute data between 1/1/1999 and
8/17/09. If obtaining 1-minute data is a problem, then we could benchmark using
daily data. Finally, I am open to benchmarking other very simple systems if
that would help, such as gap systems, band systems, etc.
Dave
--- In scientific-traders@yahoogroups.com, Barnabas Debreczeni <keo@...> wrote:
>
> Dave,
>
> I would be glad to do so but I don't have an account with them (so I don't
> have access to TradeStation)
>
> I am using MetaTrader 4 so if anyone's interested, I can run a few tests and
> post them.
>
> When I purchased CT Pro I ran quite a few tests and it turned out that MT4
> was really slow and the optimizer was unusable - but for verifying things
> and charting it's really good. I also use it every day with a live forex
> account for trading currencies.
>
> So this is my workflow: develop, test, optimize the strategy in CT Pro, then
> port it to MQL4 (Metatrader's scripting language), verify trades visually,
> maybe go back to CT Pro for a few tweaks, and then run it on MT4 to test it
> on live market data.
>
> Barnabas
> On Thu, Aug 20, 2009 at 6:32 PM, cohndw <minimax9999@...> wrote:
>
> > I will purchase C-Trader Pro if it significantly outperforms TradeStation
> > in speed(5-10x increase) for fairly large datasets. I have asked questions
> > before in this forum and have been told that C-Trader Pro is between 20 and
> > 100+ times faster than TradeStation, depending on the type of analysis. As
> > I don't see C-Trader Pro being offered on a trial basis to verify the speed
> > difference, I am wondering if any basic benchmarks have been performed to
> > verify C-Trader Pro's speed advantage? A search of this forum and a Google
> > search turned up nothing definitive.
> >
> > I have performed a time benchmark on NinjaTrader and TradeStation of a
> > simple moving average crossover buy and sell system (using 10 and 25 period
> > moving averages) on 1-minute ES mini data from 1/4/1999 to 8/17/2009. This
> > provides a fairly large data set (several million bars) and a large number
> > of trades (several hundred thousand). I know this is by no means as large or
> > as complicated as C-Trader Pro says they can go, but it provides a simple
> > reference. NinjaTrader uses a script language to generate C++ code and
> > then compiles it, so I expected it to be very fast when compared to
> > TradeStation, which does not produce a stand-alone executable in the end. I
> > was a bit surprised though with the results and the comparison. I will
> > release the results for this comparison when someone can provide a C-Trader
> > Pro benchmark.
> >
> > Thanks,
> >
> > Dave
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>
Leon,
Thanks for your rapid and extensive feedback. I did not know that you could run
multiple instances, one for each processor - that can be worth quite a bit. I
am very familiar with TradeStation, so I do appreciate its end to end
functionality which makes it very easy to use.
Can you recall the sample strategy you benchmarked in TS vs C-Trader Pro? Was
it one of the simple out of the box strategies which was provided with
TradeStation?
Dave
--- In scientific-traders@yahoogroups.com, Leon Levinov <leonlevinov@...> wrote:
>
> Dave,
>
> I have been where you are some time ago - wondering if this is the right tool
for my needs,
> but couldn't get enough info. So I will try to help you.
>
> Performance-wise:
> I have compared a sample strategy run in TS and in C-Trader Pro.
> What I got is about 20 times performance improvement - after doing
> some tweaking. "About" since the C-Trader runs on a slightly different
processor
> and I run it on Linux within VmWare which seems to be a bit slow.
> So the comparison is not precise. I didn't get to x100 improvement, but
> may be could go beyond x20 if I will run Linux native.
> Would be interesting to hear if somebody did go >x20 and how.
>
> Feature-wise, here are some cons and pros:
> 1. Tradestation is, in a sense, a complete tool out of the box: coding -> data
stream + testing/optimizing -> charting -> trading
>
> 2. C-Trader does not provide the data feed, no charting (so cannot see
visually the trades, the indicators and so on),
> nor can you trade from it. You will need a separate platform in order to trade
and most probably will have to rewrite the code for it.
> So these are several big "cons".
> On the other hand C-Trader:
> gives you a lot of power for system development
> - is many times faster, and you can run several instances to utilize all your
cores
> (which in case of quad processor gives you another x4 times speed boost).
> - you can automate the process as much as you like via some scripting
capability that
> you can also extend. E.g. if you want to run your
> optimization in TS for several/many stocks you have to manually configure
> the optimizations one by one (or copy paste, but still - cannot run for say
500).
> CTrader gives you some scripting tools that solve this for you easily.
> - After optimization in TS - if you want to see how several top parameter sets
perform
> in out-of-sample - welcome again to routine manual work - which can take lots
of time.
> Again in CT you can do it in script.
> - Anything that you don't have "built in" in TS - forget it. Anything you want
in CT - you can
> extend it - of course by writing C/C++.
>
> In my opinion one needs some programming background to get it all up running
and to
> utilize it to the full.
> though it is only my opinion. I was a programmer about a 10 years ago and it
took me
> about 2-3 weeks to get to feel somewhat comfortable with the CTrader, but at
least 1 week
> was spent on fighting Ubuntu problems, and my level of comfort may be
higher/lower than
> other's.
>
> Here, hope that helps.
>
> Leon
>
>
>
>
> ________________________________
> From: cohndw <minimax9999@...>
> To: scientific-traders@yahoogroups.com
> Sent: Thursday, August 20, 2009 7:32:48 PM
> Subject: [scientific-traders] Time benchmark of C-Trader pro
>
>
> I will purchase C-Trader Pro if it significantly outperforms TradeStation in
speed(5-10x increase) for fairly large datasets. I have asked questions before
in this forum and have been told that C-Trader Pro is between 20 and 100+ times
faster than TradeStation, depending on the type of analysis. As I don't see
C-Trader Pro being offered on a trial basis to verify the speed difference, I am
wondering if any basic benchmarks have been performed to verify C-Trader Pro's
speed advantage? A search of this forum and a Google search turned up nothing
definitive.
>
> I have performed a time benchmark on NinjaTrader and TradeStation of a simple
moving average crossover buy and sell system (using 10 and 25 period moving
averages) on 1-minute ES mini data from 1/4/1999 to 8/17/2009. This provides a
fairly large data set (several million bars) and a large number of trades
(several hundred thousand). I know this is by no means as large or as
complicated as C-Trader Pro says they can go, but it provides a simple
reference. NinjaTrader uses a script language to generate C++ code and then
compiles it, so I expected it to be very fast when compared to TradeStation,
which does not produce a stand-alone executable in the end. I was a bit
surprised though with the results and the comparison. I will release the
results for this comparison when someone can provide a C-Trader Pro benchmark.
>
> Thanks,
>
> Dave
>
Hi,
C-Trader does indeed appear to be far faster than TradeStation based on
tests I conducted in the late 1990s. Much of this speed can be explained
simply by the fact that trading models in C-Trader are compiled (with an
optimizing compiler, no less) into machine code before they are executed;
by way of contrast, Easy Language code in TradeStation is interpreted,
line by line, again and again, as it runs. Another factor has to do with
the use of linear array structures in C-Trader versus circular buffers
(which provide a system with a single bar at a time) in TradeStation--
circular buffers are great for running a system real-time with a live
feed, but are neither necessary nor appropriate for system development
using historical data.
There was a simple benchmark in The Encyclopedia of Trading Strategies
(McGraw Hill, 2000) of an earlier version of C-Trader. That book also
provided some comparisons of brute force versus genetic optimization in
terms of how fast a globally optimal solution could be found. C-Trader
was far faster than TradeStation when using brute-force optimization (what
TradeStation uses), and astronomically faster at finding a globally
optimal solution when using the built-in genetic algorithm, especially
when many parameters had to be stepped through many values.
I do not have TradeStation, so I cannot do a comparison. Perhaps there is
someone else on the group who can run a simple optimization on a large
data set and see how the different platforms perform.
Jeff
On Thu, 20 Aug 2009, cohndw wrote:
> I will purchase C-Trader Pro if it significantly outperforms
> TradeStation in speed(5-10x increase) for fairly large datasets. I have
> asked questions before in this forum and have been told that C-Trader
> Pro is between 20 and 100+ times faster than TradeStation, depending on
> the type of analysis. As I don't see C-Trader Pro being offered on a
> trial basis to verify the speed difference, I am wondering if any basic
> benchmarks have been performed to verify C-Trader Pro's speed advantage?
> A search of this forum and a Google search turned up nothing definitive.
>
> I have performed a time benchmark on NinjaTrader and TradeStation of a
> simple moving average crossover buy and sell system (using 10 and 25
> period moving averages) on 1-minute ES mini data from 1/4/1999 to
> 8/17/2009. This provides a fairly large data set (several million bars)
> and a large number of trades (several hundred thousand). I know this is
> by no means as large or as complicated as C-Trader Pro says they can go,
> but it provides a simple reference. NinjaTrader uses a script language
> to generate C++ code and then compiles it, so I expected it to be very
> fast when compared to TradeStation, which does not produce a stand-alone
> executable in the end. I was a bit surprised though with the results
> and the comparison. I will release the results for this comparison when
> someone can provide a C-Trader Pro benchmark.
>
> Thanks,
>
> Dave
>
>
I would be glad to do so but I don't have an account with them (so I don't have access to TradeStation)
I am using MetaTrader 4 so if anyone's interested, I can run a few tests and post them.
When I purchased CT Pro I ran quite a few tests and it turned out that MT4 was really slow and the optimizer was unusable - but for verifying things and charting it's really good. I also use it every day with a live forex account for trading currencies. So this is my workflow: develop, test, optimize the strategy in CT Pro, then port it to MQL4 (Metatrader's scripting language), verify trades visually, maybe go back to CT Pro for a few tweaks, and then run it on MT4 to test it on live market data.
Barnabas
On Thu, Aug 20, 2009 at 6:32 PM, cohndw <minimax9999@...> wrote:
I will purchase C-Trader Pro if it significantly outperforms TradeStation in speed(5-10x increase) for fairly large datasets. I have asked questions before in this forum and have been told that C-Trader Pro is between 20 and 100+ times faster than TradeStation, depending on the type of analysis. As I don't see C-Trader Pro being offered on a trial basis to verify the speed difference, I am wondering if any basic benchmarks have been performed to verify C-Trader Pro's speed advantage? A search of this forum and a Google search turned up nothing definitive.
I have performed a time benchmark on NinjaTrader and TradeStation of a simple moving average crossover buy and sell system (using 10 and 25 period moving averages) on 1-minute ES mini data from 1/4/1999 to 8/17/2009. This provides a fairly large data set (several million bars) and a large number of trades (several hundred thousand). I know this is by no means as large or as complicated as C-Trader Pro says they can go, but it provides a simple reference. NinjaTrader uses a script language to generate C++ code and then compiles it, so I expected it to be very fast when compared to TradeStation, which does not produce a stand-alone executable in the end. I was a bit surprised though with the results and the comparison. I will release the results for this comparison when someone can provide a C-Trader Pro benchmark.
Yes, there is a possibility of sending commands to Metatrader by writing a DLL. Haven't tried it yet because of lack of time (and I don't like coding under windows) but it will be done in some time, maybe in the next weeks.
I'll be happy to share it if anyone will be interested, but first, I need to go through a few things so I can arrive there and code it. :)
Barnabas
On Wed, Aug 12, 2009 at 10:49 PM, Jeffrey Owen Katz <jeffkatz@...> wrote:
Hi,
If MetaTrader can be controlled from within another program (like Gnuplot
can be controlled via pipes, or ds9 using any of several methods), one
could actually incorporate it directly into C-Trader as a plotting engine.
This would be very nice and seamless.
Jeff
On Tue, 11 Aug 2009, Barnabas Debreczeni wrote:
> I am using Metatrader 4 to plot and verify things, such as indicators
> etc. The tester / optimizer of MT4 is really screwed and unusable, but
> for quickly drawing stuff and verifying it's really cool.
>
> Barnabas
>
> On Mon, Aug 10, 2009 at 9:37 PM, leonlevinov<leonlevinov@...> wrote:
>> Hi,
>>
>> I am looking for some soft to plot
>> the trades generated by C-Trader
>> on an intraday bar-chart for the visual
>> verification/analysis.
>>
>> Can you recommend some open-source/free tool?
>> Best if it was possible to plot the indicator
>> values too.
>>
>> Thank you,
>> Leon
>>
>>
>>
>> ------------------------------------
>>
>> Yahoo! Groups Links
>>
>>
>>
>>
>
I have been where you are some time ago - wondering if this is the right tool for my needs, but couldn't get enough info. So I will try to help you.
Performance-wise: I have compared a sample strategy run in TS and in C-Trader Pro. What I got is about 20 times performance improvement - after doing some tweaking. "About" since the C-Trader runs on a slightly different processor and I run it on Linux within VmWare which seems to be a bit slow. So the comparison is not precise. I didn't get to x100 improvement, but may be could go beyond x20 if I will run Linux native. Would be interesting to hear if somebody did go >x20 and how.
Feature-wise, here are some cons and pros: 1.
Tradestation is, in a sense, a complete tool out of the box: coding -> data stream + testing/optimizing -> charting -> trading
2. C-Trader does not provide the data feed, no charting (so cannot see visually the trades, the indicators and so on), nor can you trade from it. You will need a separate platform in order to trade and most probably will have to rewrite the code for it. So these are several big "cons". On the other hand C-Trader: gives you a lot of power for system development - is many times faster, and you can run several instances to utilize all your cores (which in case of quad processor gives you another x4 times speed boost). - you can automate the process as much as you like via some scripting capability that you can also extend. E.g. if you want to run your optimization in TS for several/many stocks you have to manually configure the optimizations one by one (or copy paste, but still -
cannot run for say 500). CTrader gives you some scripting tools that solve this for you easily. - After optimization in TS - if you want to see how several top parameter sets perform in out-of-sample - welcome again to routine manual work - which can take lots of time. Again in CT you can do it in script. - Anything that you don't have "built in" in TS - forget it. Anything you want in CT - you can extend it - of course by writing C/C++.
In my opinion one needs some programming background to get it all up running and to utilize it to the full. though it is only my opinion. I was a programmer about a 10 years ago and it took me about 2-3 weeks to get to feel somewhat comfortable with the CTrader, but at least 1 week was spent on fighting Ubuntu problems, and my level of comfort may be higher/lower than other's.
Here, hope that helps.
Leon
From: cohndw <minimax9999@...> To: scientific-traders@yahoogroups.com Sent: Thursday, August 20, 2009 7:32:48 PM Subject: [scientific-traders] Time benchmark of C-Trader pro
I will purchase C-Trader Pro if it significantly outperforms TradeStation in speed(5-10x increase) for fairly large datasets. I have asked questions before in this forum and have been told that C-Trader Pro is between 20 and 100+ times faster than TradeStation, depending on the type of analysis. As I don't see C-Trader Pro being offered on a trial basis to verify the speed difference, I am wondering if any basic benchmarks have been performed to verify C-Trader Pro's speed advantage? A search of this forum and a Google search turned up nothing definitive.
I have performed a time benchmark on NinjaTrader and TradeStation of a simple moving average crossover buy and sell system (using 10 and 25 period moving averages) on 1-minute ES mini data from 1/4/1999 to 8/17/2009. This provides a fairly large data set (several million bars) and a large number of trades (several hundred thousand). I know this is by no means as large or as complicated as C-Trader Pro says they can go, but it provides a simple reference. NinjaTrader uses a script language to generate C++ code and then compiles it, so I expected it to be very fast when compared to TradeStation, which does not produce a stand-alone executable in the end. I was a bit surprised though with the results and the comparison. I will release the results for this comparison when someone can provide a C-Trader Pro benchmark.
I will purchase C-Trader Pro if it significantly outperforms TradeStation in
speed(5-10x increase) for fairly large datasets. I have asked questions before
in this forum and have been told that C-Trader Pro is between 20 and 100+ times
faster than TradeStation, depending on the type of analysis. As I don't see
C-Trader Pro being offered on a trial basis to verify the speed difference, I am
wondering if any basic benchmarks have been performed to verify C-Trader Pro's
speed advantage? A search of this forum and a Google search turned up nothing
definitive.
I have performed a time benchmark on NinjaTrader and TradeStation of a simple
moving average crossover buy and sell system (using 10 and 25 period moving
averages) on 1-minute ES mini data from 1/4/1999 to 8/17/2009. This provides a
fairly large data set (several million bars) and a large number of trades
(several hundred thousand). I know this is by no means as large or as
complicated as C-Trader Pro says they can go, but it provides a simple
reference. NinjaTrader uses a script language to generate C++ code and then
compiles it, so I expected it to be very fast when compared to TradeStation,
which does not produce a stand-alone executable in the end. I was a bit
surprised though with the results and the comparison. I will release the
results for this comparison when someone can provide a C-Trader Pro benchmark.
Thanks,
Dave
would you include the OS Sharpe in the target function for actual (not "debugging") system development/optimization and why?
Thank you, Leon
From: Jeffrey Owen Katz <jeffkatz@...> To: scientific-traders@yahoogroups.com Sent: Thursday, August 13, 2009 12:01:19 AM Subject: Re: [scientific-traders] Re: what target function do you use?
Hi,
The fitness function was just one of many used when debugging the
software, and it works fairly well. I generally use one of the Sharpe
ratios (either the daily or the weekly (the one with the W)). The Sharpe
ratio is basically a t-test on equity changes, and is very much like the
t-test on completed trades used in The Encyclopedia of Trading Strategies
(McGraw Hill, 2000). The t-test on trades also works well.
Jeff
On Wed, 12 Aug 2009, Leon Levinov wrote:
> Jeff,
>
> could you explain the reason why you chose the default C-Trader target function as it is?
> It puzzled me too and I also have reset it to simply be SharpeW in-sample...
>
> Do you use any other target functions?
> I thought of using the IS probability as may be an even better way
> to increase reliability of results than using the trades number in TF -
> how would you factor it in?
>
> Regards,
> Leon
>
>
>> This is the fitness function in CTrader Pro which you have cut and paste. It takes the minimum of the weekly Sharpe ratios on the in-sample period (multiplied by 1.3) and the out-of-sample period. If the result is greater than 8 it ignores it (sets to zero), as this 'has to be' an error.
>> For my part, I don't like any optimisation which includes a reference to the out-of-sample data. So, I've reset mine to be simply the weekly Sharpe ratio.
>
>
>
> ____________ _________ _________ __
> From: Trey Johnson <dickjohnson3@ gmail.com>
> To: scientific-traders@ yahoogroups. com
> Sent: Wednesday, August 12, 2009 5:35:20 PM
> Subject: Re: [scientific- traders] Re: what target function do you use?
>
>
> Roman,
>
> It would have to be added, I think. I haven't programmed the function but I'm familiar with it.
>
> Trey
>
>
> On Tue, Aug 11, 2009 at 12:13 PM, Roman Tatkin <Roman.Tatkin@ mail.ru> wrote:
>
> >
>> No, Omega ratio is new to me.
>> How can it be calculated in the terms of CTraderPro
>> ?
>>
>> Regards,
>> Roman.
>>
>> ----- Original Message -----
>>> From: Trey
>>> Johnson
>>> To: scientific-traders@ yahoogroups. com
>>> Sent: Tuesday, August 11, 2009 5:53
>>> PM
>>> Subject: Re: [scientific- traders] Re:
>>> what target function do you use?
>>>
>>>
>>> Have you looked at the Omega ratio? It addresses the primary weakness of
>>> the sharpe ratio, which assumes a normal distribution.
>>>
>>> Trey
>>>
>>>
>>> On Tue, Aug 11, 2009 at 9:09 AM, Roman Tatkin <Roman.Tatkin@ mail.ru> >> wrote:
>>>
>>>
>>>> Understood, thank to both of you
>>>> guys.
>>>>
>>>> Regards,
>>>> Roman.
>>>>
>>>> -----
>>>>> Original Message -----
>>>>> From: nick.fairbank
>>>>> To: scientific-traders@ yahoogroups. com
>>>>> Sent: >>>> Tuesday, August 11, 2009 5:01 PM
>>>>> Subject: >>>> [scientific- traders] Re: what target function do you use?
>>>>>
>>>>>
>>>>> Roman,
>>>>> This is the fitness function in CTrader Pro which you have
>>>>> cut and paste. It takes the minimum of the weekly Sharpe ratios on the
>>>>> in-sample period (multiplied by 1.3) and the out-of-sample period. If the
>>>>> result is greater than 8 it ignores it (sets to zero), as this 'has to be'
>>>>> an error.
>>>>> For my part, I don't like any optimisation which includes a
>>>>> reference to the out-of-sample data. So, I've reset mine to be simply the
>>>>> weekly Sharpe ratio.
>>>>> Secondly, I have removed the 'max 8.0' test as I
>>>>> want to know if I am getting over 8.0. If I am, it is either my route to
>>>>> riches and retirement or an error. Assuming the latter, I want to identify
>>>>> and de-bug.
>>>>> The Sharpe ratio is an industry-recognised measure which
>>>>> measures closeness to a straight line (i.e. minimal drawdown) and rewards
>>>>> gain. It is a perfectly appropriate fitness function.
>>>>> My only suggested
>>>>> improvement is to incorporate a reward for a relatively high number of
>>>>> trades so that one can assume statistical stability.
>>>>> I have just
>>>>> received Barnabas's latest posting whilst typing this: he agrees, his is
>>>>> SharpeW also.
>>>>> Regards,
>>>>> Nick F
>>>>> --- In scientific-traders@ yahoogroups. com, "Roman
>>>>> Tatkin" <Roman.Tatkin@ ...> wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>
>>>>>> Writing you directly, no time to restore the pass to the
>>>>> group.
>>>>>> Could you please explain which fitness function are you
>>>>> talking about ? As fas as I can see, default fitness function is:
>>>>>>
>>>>>
>>>>>> // determine fitness measure to be used in optimizations
>>>>>>
>>>>> // ****** modify this to suit one's taste ******
>>>>>> pf.psi.fitness=
>>>>> min(1.3 * pf.psi.sharpw, pf.pso.sharpw) ;
>>>>>> if(pf.psi.fitness
>>>>> > 8.0) pf.psi.fitness= 0.0;
>>>>>> pf.pso.fitness= pf.pso.sharpw;
>>>>>
>>>>>>
>>>>>> I can't understand, how can it measure the closeness to
>>>>> the simple line ?
>>>>>> Or your version of CTraderPro contains another
>>>>> default fitness function ?
>>>>>>
>>>>>> Thanks in advance!
>>>>>>
>>>>>
>>>>>> Regards,
>>>>>> Roman.
>>>>>>
>>>>>> ----- Original Message
>>>>> -----
>>>>>> From: Barnabas Debreczeni
>>>>>> To: scientific-traders@ yahoogroups. com
>>>>>>
>>>>> Sent: Tuesday, August 11, 2009 4:34 PM
>>>>>> Subject: Re:
>>>>> [scientific- traders] what target function do you use?
>>>>>>
>>>>>
>>>>>>
>>>>>> I really liked the fitness function in C Trader Pro,
>>>>> which looked for
>>>>>> the equity curve to be as close to a simple line
>>>>> as possible, maybe
>>>>>> you can mix in more elements, t-tests or sharpe
>>>>> W, etc.
>>>>>>
>>>>>> Barnabas
>>>>>>
>>>>>> On Mon, Aug 10, 2009 at
>>>>> 9:32 PM, leonlevinov< leonlevinov@ ...> wrote:
>>>>>>>
>>>>> Hi,
>>>>>>>
>>>>>>> what target function(s) do you
>>>>>>>
>>>>> use in your optimizations?
>>>>>>>
>>>>>>> I currently use the
>>>>> "default" C-Trader's SharpeW
>>>>>>> but have a feeling that there
>>>>> should be some better
>>>>>>> or at least alternative
>>>>> targets.
>>>>>>>
>>>>>>> Thank you,
>>>>>>> Leon
>>>>>>
>>>>> >
>>>>>>>
>>>>>>>
>>>>>>>
>>>>> ------------ --------- --------- ------
>>>>>>>
>>>>>>
>>>>> > Yahoo! Groups Links
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>> >
>>>>>>
>>>>>
>>>>>
>>>
>
>
>
>
>