Automation And Simulation

This is a discussion on Automation And Simulation within the Trading Software forums, part of the Commercial category; Hi, I have been developing and trying to backtest strategies for FX trading using TradeStation 8 - which I believed ...

Reply
 
LinkBack Thread Tools Search this Thread
Old Oct 1, 2004, 4:08pm   #1
Joined Oct 2003
Automation And Simulation

Hi,

I have been developing and trying to backtest strategies for FX trading using TradeStation 8 - which I believed was the best tool for this purpose. Now I finf that the Performance Reports are completely misleading when compared with 'actual trading tick by tick for instance, one system showed $179,000 profit YTD on a 45 minute chart but as soon as Intraday Bars were enabled at 1 minute intervals, it showed a $29,000 LOSS! - Not only this but because of the way TradeStation deals with Stops, it is impossible (as far as I know) to place a stops at the time of entry.

I'm so frustrated to discover after taking the time to 'get into' tradeStation that its own internal rules and assumptions mean that real trading results are hugely different to actual trading results and from what I can see on TS forums, the TS engineers don''t see this as an issue or seem willing to change anything soon. I believe in taking "calculated risks, but if the "Calculation" is inaccurate, then the assessment of risk will be too.

So the question is please, what do you use for backtesting and/or automation and does it work?


regards
Paul

PS If you are looking at Mechanical systems - watch out for "simulated Results" especially if the offered Performance report is a TradeStatione one, (which many are! - Thank goodness I discovered this issue before trading real money with it.
TraderKing is offline   Reply With Quote
Thanks! The following members like this post: calzini
Old Oct 1, 2004, 4:11pm   #2
 
2 Posts
Joined Dec 2003
hi,
try www.fxengines.com. They have just started recently and you can have a 14 day free trial with them.

Eoin
m_eoin is offline   Reply With Quote
Old Oct 1, 2004, 6:26pm   #3
 
rog1111's Avatar
Joined Jan 2004
TraderKing

This is a nice can of worms ! As an outsider, how can you know the assumptions that are made by these backtesting programs, applicable in particular to bar data ? I appreciate the fact that you have already spent time to learn the TS language, and I can understand your frustration. Howver, my strong advice, presuming that you have a leaning towards programming, is to create your own backtesting program from scratch, which doesn't have to be as difficult or time consuming as you may imagine. Then you can set up your own assumptions and you know exactly what you are getting, which in turn leads to increased confidence in the results. Logically if you don't have confidence in the results how can you trade the system ? I use VB for this purpose (IMO quite easy to learn), and it has served me admirably. YOu will of course need data, and on this subject, for the record, I have found trade data for some futures (particularly those less heavily traded) entirely unreliable for backtesting, and IMO ideally you need bid prices, not that you see these offered for sale though. I can back this statement up by comparing theoretical bid prices versus theoretical trade prices versus actual live trade results obtained. The correlation using bids is far better, although you still need to make an assumption about the BA spread.

Good luck !
rog1111


Quote:
Originally Posted by TraderKing
Hi,

I have been developing and trying to backtest strategies for FX trading using TradeStation 8 - which I believed was the best tool for this purpose. Now I finf that the Performance Reports are completely misleading when compared with 'actual trading tick by tick for instance, one system showed $179,000 profit YTD on a 45 minute chart but as soon as Intraday Bars were enabled at 1 minute intervals, it showed a $29,000 LOSS! - Not only this but because of the way TradeStation deals with Stops, it is impossible (as far as I know) to place a stops at the time of entry.

I'm so frustrated to discover after taking the time to 'get into' tradeStation that its own internal rules and assumptions mean that real trading results are hugely different to actual trading results and from what I can see on TS forums, the TS engineers don''t see this as an issue or seem willing to change anything soon. I believe in taking "calculated risks, but if the "Calculation" is inaccurate, then the assessment of risk will be too.

So the question is please, what do you use for backtesting and/or automation and does it work?


regards
Paul

PS If you are looking at Mechanical systems - watch out for "simulated Results" especially if the offered Performance report is a TradeStatione one, (which many are! - Thank goodness I discovered this issue before trading real money with it.
__________________
He who knows much about others may be learned, but he who understands himself is more intelligent. He who controls others may be powerful, but he who has mastered himself is mightier still. Lao Tse
rog1111 is offline   Reply With Quote
Old Oct 2, 2004, 11:17am   #4
Joined Oct 2003
TraderKing started this thread Dear rog1111,

Thanks for the response,

Unfortunately I don't have a programming background but I was prepared to learn easylanguage, programming my own backtesting system isn't a realistic option for me. Some of the assumptions and rules are there in the TS manuals (although their implications only hit home when the results don't seem to make sense, and you start digging deeper, also examination of TS World forum threads and discussions and responses of TS moderators point one in the direction of these conclusions.

I agree that the area is a can of worms though - to mitigate the effects I asked one 'large brokerage' if they could provide an independent (account level) stop facility. The answer was no, although clearly if they can manage 'margin' on an account, it would seem feasable to put an absolute dollar stop on trades on an account. - this would at least provide some risk management for trading a system inititally until one could calculate the real performance.

The other approach was to approach the problem by getting API programmers to provide the ability to set stops at the API level, again independent of the underlying strategy trading system. almost any system is capable of generating Outlier losers from time to time (I don't mind the +ve outliers :-) ) but one -ve oulier trade where stops did not work for some reason) would potentially destroy the account..

Personally I don't believe anyone in their right mind (unless they have a huge account, would let lose an automatic system without some money management stops they can trust (which work even if the system or the connection goes down)

best regards
Paul
TraderKing is offline   Reply With Quote
Old Oct 2, 2004, 11:20am   #5
Joined Oct 2003
TraderKing started this thread
Quote:
Originally Posted by m_eoin
hi,
try www.fxengines.com. They have just started recently and you can have a 14 day free trial with them.
Eoin
Dear Eoin
Thanks for the tip.
Paul
TraderKing is offline   Reply With Quote
Old Oct 2, 2004, 11:34am   #6
 
rog1111's Avatar
Joined Jan 2004
Have you tried Interactive Brokers ? If you are worried about stops, you could either use stop limit orders, with a wide limit to ensure execution (native to Globex), or if you wanted to be less "visible" then use their simple stop orders, which although simulated, are resident on the IB servers, and barring a server disaster, should get executed. Any of these standard options (and a whole lot more) could be programmed into the automation

rog1111
__________________
He who knows much about others may be learned, but he who understands himself is more intelligent. He who controls others may be powerful, but he who has mastered himself is mightier still. Lao Tse
rog1111 is offline   Reply With Quote
Old Oct 2, 2004, 12:01pm   #7
Joined Oct 2003
TraderKing started this thread Hi rog1111,

I looked at IB but they don't do Forex , there is also a number of possible patforms / APIs / broker combinations I have found out about but so far I haven't found a combination which provides a system independent 'fail-safe' stop either at the Account level (broker Side or the API (inteface) level and also I am still searching for method of 'testing' strategies which produce 'realistic' results.

I have a systems house / broker who writes their own mech systems who (out of interest in one of my systems) are currently trading it live on a demo account (but its on their server) - so maybe just walking it forwards in real-time like this is the answer?

There are some promising developments, someone has drawn my attention to www.tradeoptimizer.com which if nothing else is a lot less expensive than TS8 :-) but I don't know it its any better in terms of backtesting results.

All I can say is that its a reall roller-coaster, I have had real highs when I believed I had a winning system and then real lows when I found the results didn't follow in real-time or that it couldn't be traded with reliable stops.

best regards
TraderKing is offline   Reply With Quote
Old Oct 2, 2004, 12:29pm   #8
Joined Mar 2004
tradestation doesnt (at the moment) permit automated execution on FX markets, though this may change after the october conference (maybe some big things in the pipeline?).

It should, with reference to your first post, be possible to bundle your entry with your stop and even a target all in the same EL statement, for example:

if condition1 and condition2 then begin;
buy next bar at market;
sell next bar at entryprice -stopvalue stop;
sell next bar at entryprice +targetvalue limit;
end;

if you have your exits/stops packaged into an EL statement that begins with something like "if marketposition =1 then..." then of course you cant use this statement to initiate a stop on the same bar as entry because EL commands are only run at the end of each bar so TS EL wont recognise marketposition =1 until the close of your entry bar.

I am not fluent in EL however, though during my own efforts to code up some ideas into TS I did encounter the same problem with stops on entry. The best place to ask such questions is in the EL forum, there are answers to most such questions available.

Curve fitting and overoptimisation are the biggest enemies of any promising automated trading system. Testing on out of sample data is a must as are walk forward testing on live data to get an idea of real performance vs past tests. This way you can establish whether your backtesting was too closely fit to past circumstances that will not repeat.

Also understanding how TradeStation EL or indeed any programming language works and handles the available data is essential to your success. TS can be used to create highly successful systems however as many users on the TradeStationWorld forum have attested to.
MartinD is offline   Reply With Quote
Old Oct 2, 2004, 12:44pm   #9
Joined Oct 2003
TraderKing started this thread Thanks MartinD,

I think part of my immediate problem is the fact that it generates lots of trades which depend on being killed almost immediately with a break even stop and on long bars this just doesn't work well because of the way TradeManager holds the stops on the server and like you say would execute them on the next bar,
I think probably this isn't such a problem for people trading larger ranges over a number of bars, especially if they are trading shorter time frames. A lot of the trades generated by my system only last 2 or 3 bars (even the winners) - (this is because its is designed to generate a lot of small trades with low drawdowns.)
Best
Paul
TraderKing is offline   Reply With Quote
Old Oct 2, 2004, 12:50pm   #10
Joined Mar 2004
ah yes, if you require a stop being changed or pulled up tighter, or any kind of intrabar order modification then you will have trouble with tradestation simply because of the way easylanguage instructions are cycled on each new bar.

There are workarounds for intrabar instructions but I've never had to look at this for my methods - it involves running your strategy on data2 (normal time frame) and having executions placed on data1 which would be a much shorter timeframe - this way you can get around the bar intervals.

A colleague of mine also has a strategy that runs on one chart - passes signals to a central DLL written in C++ which sends instructions to an EL strategy running on a short time frame tick chart for execution.

More information is available in the TSW forums, this sort of stuff is not in my area at all.
MartinD is offline   Reply With Quote
Old Oct 2, 2004, 1:16pm   #11
Joined Mar 2004
a good place to start in coding your own custom application - seperate from TradeStation is www.trademagic.net

otherwise TradeStation is probably the best place to start if you dont want the hugely complex problems of trying to code up all the indicators you will need to analyse in a standalone application. Easylanguage is as the name suggests, quite easy.
MartinD is offline   Reply With Quote
Old Oct 2, 2004, 5:23pm   #12
 
rog1111's Avatar
Joined Jan 2004
Have a look at IB's new IdealPro Forex, plenty of posts on this forum about it. Or you could trade futures rather ? If you're in doubt about whether actual (futures) and theoretical / backtested (spot) trades can correlate well, have a look at this thread :

http://www.trade2win.com/boards/show...al+theoretical

If the actuals had been spot trades, not futures, then I expect the match would have been even closer.

Good luck !
rog1111

Quote:
Originally Posted by TraderKing
Hi rog1111,

I looked at IB but they don't do Forex , there is also a number of possible patforms / APIs / broker combinations I have found out about but so far I haven't found a combination which provides a system independent 'fail-safe' stop either at the Account level (broker Side or the API (inteface) level and also I am still searching for method of 'testing' strategies which produce 'realistic' results.

I have a systems house / broker who writes their own mech systems who (out of interest in one of my systems) are currently trading it live on a demo account (but its on their server) - so maybe just walking it forwards in real-time like this is the answer?

There are some promising developments, someone has drawn my attention to www.tradeoptimizer.com which if nothing else is a lot less expensive than TS8 :-) but I don't know it its any better in terms of backtesting results.

All I can say is that its a reall roller-coaster, I have had real highs when I believed I had a winning system and then real lows when I found the results didn't follow in real-time or that it couldn't be traded with reliable stops.

best regards
__________________
He who knows much about others may be learned, but he who understands himself is more intelligent. He who controls others may be powerful, but he who has mastered himself is mightier still. Lao Tse
rog1111 is offline   Reply With Quote
Old Oct 2, 2004, 5:32pm   #13
 
rog1111's Avatar
Joined Jan 2004
BroadSword

1) Yes, Visualbasic.net is the latest offering. If you have done some Basic, then VB is not a million miles away, and much more fun.
2) Definitely yes
3) Windows XP (ideally)
4) There have been quite a few posts about data on the forum, so I won't repeat them here, but there are a couple of reasonable free sources (for the time being) eg dukascopy . Purchased data may or may not be more accurate or complete.

GL

rog1111


Quote:
Originally Posted by BroadSword
1) Is VB "visual basic"?

2) Could a reasonable amateur programmer code such things? I guess it would be just a case of a few if...then...else type instructions.

3) What platform would you run it on?

4) What do you think the best source of online forex data would be?

Thanks!
__________________
He who knows much about others may be learned, but he who understands himself is more intelligent. He who controls others may be powerful, but he who has mastered himself is mightier still. Lao Tse
rog1111 is offline   Reply With Quote
Old Oct 2, 2004, 6:11pm   #14
 
jmreeve's Avatar
Joined Mar 2002
I ran into all these problems a few years ago and so wrote a backtest platform that uses bid,ask and trade information. The results from this are very realistic however it is not as easy to use as Tradestation.

Getting hold of data is the biggest problem. The only places I have found to date that have affordable timesales history are www.tickplusdata.com or www.tickdata.com for NASDAQ stocks.
__________________
Tomorrow anything may happen for no reason.
jmreeve is offline   Reply With Quote
Old Oct 28, 2004, 6:30am   #15
 
JumpOff's Avatar
Joined Aug 2004
Quote:
Originally Posted by TraderKing
Personally I don't believe anyone in their right mind (unless they have a huge account, would let lose an automatic system without some money management stops they can trust (which work even if the system or the connection goes down)
I've been wondering about this myself. I've been trading on forex simulators from CMS (couldn't enter stop at the same time as order) and now oanda (where your order and stop are sent together.) What a world of difference in how I feel about entering a trade..

I'm planning to trade futures when I put real money on the line, and the method and timing of stop placement is going to be high on my criteria for choosing a broker/platform.
JO
JumpOff is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does any automation/tipping/analysis work? cbyp Forex 7 Nov 24, 2005 1:27pm
Using Tradestation for Automation Chrisso Trading Software 9 Nov 17, 2005 1:46pm
spread trade automation jimmy1 Commodities & Money Markets 0 Mar 7, 2005 9:00pm
Gain Capital - Esignal automation Hughmac Forex 4 Sep 20, 2004 4:20pm

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)