NexusFi: Find Your Edge


Home Menu

 





Tradestation Forex Strategy Setup - Accounting for Spread


Discussion in TradeStation

Updated
    1. trending_up 4,996 views
    2. thumb_up 8 thanks given
    3. group 2 followers
    1. forum 9 posts
    2. attach_file 0 attachments




 
Search this Thread

Tradestation Forex Strategy Setup - Accounting for Spread

  #1 (permalink)
 LetmeInNow 
CA/USA
 
Experience: Intermediate
Platform: Tradestation
Trading: Stocks
Posts: 10 since Nov 2012
Thanks Given: 4
Thanks Received: 1

Hi there,

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.

Have a great one! =)

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
MC PL editor upgrade
MultiCharts
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
How to apply profiles
Traders Hideout
Trade idea based off three indicators.
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
31 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,663 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,357


LetmeInNow View Post
Hi there,

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.

Have a great one! =)

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.

Good Luck!

By the way, make sure to check around for spread prices. You might find TS spreads to be on the high end.

Follow me on Twitter Reply With Quote
  #3 (permalink)
 LetmeInNow 
CA/USA
 
Experience: Intermediate
Platform: Tradestation
Trading: Stocks
Posts: 10 since Nov 2012
Thanks Given: 4
Thanks Received: 1



kevinkdog View Post
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.

Good Luck!

By the way, make sure to check around for spread prices. You might find TS spreads to be on the high end.

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).

Thanks again for the info


entropy - dont fight it, its inevitable

Started this thread Reply With Quote
  #4 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,663 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,357


LetmeInNow View 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).

Thanks again for the info


entropy - dont fight it, its inevitable

20 pips? Are you sure its not 2 pips? Right now (midnight eastern) I see 1.30328/1.30347, which is 1.9 pips. That is reasonable (for Tradestation).

Follow me on Twitter Reply With Quote
Thanked by:
  #5 (permalink)
 LetmeInNow 
CA/USA
 
Experience: Intermediate
Platform: Tradestation
Trading: Stocks
Posts: 10 since Nov 2012
Thanks Given: 4
Thanks Received: 1

hmmm...I through I read a pip is considered the smallest single unit increment of the currency pair you are trading.

I currently see the 1.30352/1.30372 for EURUSD.

Still a newb in this market...

Started this thread Reply With Quote
  #6 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,663 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,357


LetmeInNow View Post
hmmm...I through I read a pip is considered the smallest single unit increment of the currency pair you are trading.

I currently see the 1.30352/1.30372 for EURUSD.

Still a newb in this market...

A pip is the 4th decimal on most pairs, 2nd decimal on JPY pairs. 5th decimal is a fraction of a pip.

1 pip usually equals around $10 on a normal $100,000 forex lot.

Follow me on Twitter Reply With Quote
Thanked by:
  #7 (permalink)
JimFeyn
Athens, Greece
 
Posts: 3 since May 2013
Thanks Given: 2
Thanks Received: 0

Hi all,

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!

Reply With Quote
  #8 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,663 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,357


JimFeyn View Post
Hi all,

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!


I would not rely on TS sim results for Forex. If you are using limits and stops in backtesting, I wouldn;t trust that either.

The only way I feel comfortable testing Forex in TS is to use all market orders, and add 1-2 pips slippage per side.

Watch your sim real time when you buy. Are you buying the bid or the ask? That will help you see if the sim is being overoptimistic.

Follow me on Twitter Reply With Quote
Thanked by:
  #9 (permalink)
JimFeyn
Athens, Greece
 
Posts: 3 since May 2013
Thanks Given: 2
Thanks Received: 0

Dear sir,

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.

Thank you for your time.

Reply With Quote
  #10 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,663 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,357



JimFeyn View Post
Dear sir,

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.

Thank you for your time.

Sorry, I can't be of more help. I only use market orders to enter and exit.

Follow me on Twitter Reply With Quote




Last Updated on September 10, 2014


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts