Automation And Simulation

TraderKing

Junior member
Messages
11
Likes
0
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. :eek:

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

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


TraderKing said:
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. :eek:

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.
 
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
 
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
 
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
 
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.
 
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
 
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.
 
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.
 
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/showthread.php?t=11144&highlight=actual+theoretical

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

Good luck !
rog1111

TraderKing said:
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
 
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


BroadSword said:
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!
 
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.
 
TraderKing said:
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
 
MartinD said:
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.

And in a later post:
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.
Are you saying that "current price" is not a standard variable (that could be used to program an action) in TS8? :eek:
JO :eek:
 
Are you saying that "current price" is not a standard variable (that could be used to program an action) in TS8? :eek:
JO :eek:


adaptrade has some excellent tools for system design some of them geared to tradestation Easy langugage
 
Forex Trading has become easier and more accessible than ever, allowing investors both young and old to take advantage of today’s exciting market. Citizens from any country in all parts of the world can participate in Forex trading with the help of online electronic brokers. For those who are scared of losses with forex robots, there are free bots like this one annaforex(dot)com. With the right Forex Robot, you can finally get the most out of Forex trading. Instead of focusing on events, Forex Robots make calculations that are based on preassigned technical analysis data. This is why some Forex Robots are excellent, mediocre, or in need of improvement.

Most forex robots are designed by incompetents and the things blow up given enough time, very few of them make enough for the trader to justify the cost and aggravation.
 
adaptrade has some excellent tools for system design some of them geared to tradestation Easy langugage

The most robust systems I have ever tested from a system that generates Easy Language automatically came from Price Action Lab. No indicators and no curve-fitting. I have also found that in forex any tests and systems below 15 minute bars have excessive noise and in the best case will break even. I use 30 minute bars at least.
 
Top