Tradestation Forex Strategy Setup - Accounting for Spread
I'm looking at doing some backtesting on Forex on Tradestation 9.1 update 13 but am not sure how to setup the commission structure under the strategies "Properties for All..." since tradestation does not charge a commision but has their cost built into the spread.
Any incite would be greatly appreciated. I'm assuming I would be adding this spread to the slippage section of the backtest properties.
This post has been selected as an answer to the original posters question
You are correct with the bold statement I highlighted above. You would add 1-2 pips per side for slippage. Just be careful with how TS calculates the total (per lot, or total transaction, etc)
But, there is a bigger problem waiting for you, and I'll take a little time to explain...
The problem you will have backtesting with Forex is that the datastream you see is only Bid data. This can cause major problems with strategies, especially with limit orders and stop orders. Your strategy will get filled when in real life you won't, and vice versa. Accounting for spreads won't take care of this, since it is about trades that never happen.
I'll give you 1 example. Let's say your strategy says "buy next bar at 1.3081 limit." Let's also say that you've selected the "fill order only if limit price is exceeded" option, almost always a good choice. Tradestation normally has a 1-2 pip spread, so let's say it is 1.5. So, you need the chart price to hit 1.3080 for a guaranteed fill, and the bid/ask at that time will be 1.3080/1.30815.
Your strategy places your order, and a little later the TS chart goes down to 1.3080, and the strategy assumes you got filled. The market then takes off like a rocket. YES! A great winning trade. Or is it?
When the chart hit 1.3080, that was the bid price. You can't buy at bid. You can buy at ask, which hit a low of 1.30815, above your limit price. So in real life, you never got filled. You missed the trade! But any backtest will think you did get filled.
Now, there are a few things you can do with TS fills (like convert to a market order), but you won't be able to simulate them in backtest, and if you use a time delay, who knows what the slippage will actually be?
My solution: ONLY use market orders, and always have 1-2 ticks slippage applied to account for the spread. Not a perfect solution, but backtest and real time performance seem to match when I do this.
I know this is probably more than you wanted to know, but it is an important point, that most people ignore - until they lose money.
By the way, make sure to check around for spread prices. You might find TS spreads to be on the high end.
If you have any questions please send me a Private Message or use the futures.io "Ask Me Anything" thread
The following 3 users say Thank You to kevinkdog for this post:
kevinkdog - That was a fantastic reply. Thank you for providing more than I asked. I have been looking at EURUSD for the past week and definitely noticed some oddities. Was planning on emailing Tradestation for some answers... for instance that I only see order filled at the bid or why there is a 20 pip spread almost at all times. At first I thought it was the subscription feed that I opted for but that does seem to be the case.
Market orders was the way I was leaning for the strat...20pips in the hole per entry, need to account for that. It seams the entry is really the issue at least for the little time I played on sim trading. I don't see a way of scaling with a 20 pip spread. Some of the late hour movements are only in the 20 pip spread (annoying).
I trade stocks for quite a time in TS. I want to enter FX trading too. I trade in realtime but with simulated account in 1Min FX charts. How realistic my results are?
1. Is TS spread (the way TS gets its share I think) incorporated in real time bid/ask prices? In other words when I trade in TS in SIM but realtime mode, my results take into account TS additional spread?
2. Is there any other cost beyond the platforms fees etc, cost that is directly related to realtime FX charts (extra commissions)?
3. I have set limits etc in my orders. Fills are realistic? Should I add slippage too in realtime? I am under the impression that slippage is ideal for backtest only.
thank you for your prompt reply. I am interested in realtime simulated trading only, backtest and optimization has been done in another platform since my strategy is CPU demanding and TS cannot handle it in backtest. It is not 100 legit but it was the best I could do. Coding translation to EasyLanguage is perfect, I got the same results.
Yes I am watching it realtime for the past few days. I got fills for about 60% of my trades when I am using limits that utilize currentBid and currentAsk price; I am setting limits dynamically. My algorithm does from 15 to 100 trades per day.
When I was using market orders in realtime in TS, I was buying and selling sometimes very far from the bar's edges.. Hence I am not willing to use market orders in TS in realtime.
Actually, any feedback regarding FX trading in 1Min charts in TS? Does order filling satisfy you? I guess I should deal with very liquid currencies for start.