Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Other Topics > Business, Finance, and Investing
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-02-2007, 01:44 AM
eastbay eastbay is offline
Senior Member
 
Join Date: Nov 2003
Posts: 4,123
Default Re: Market Model Thingy

Lots of traps here. No guarantees you're not onto something, but not likely either. "If it was that easy everybody would do it", and all that.

Slippage and commission is important, and can turn smooth get rich quick strategies into certain losers. Looks like you're at least starting to account for commission. Don't forget slippage.

Inadvertent lookahead is an easy mistake to make. You can set up your code to help protect against it by only feeding data from a mock data source, rather than having it all in memory and just hoping you don't make a mistake in referencing the future.

You can't train and test on overlapping data. I couldn't quite tell if you were doing that from your description, but such tests are worthless for obvious implementation reasons.

If you've sure you're not doing any of the above, well, trade it by hand for awhile and see how it goes.

eastbay
Reply With Quote
  #2  
Old 11-02-2007, 04:08 AM
CallMeIshmael CallMeIshmael is offline
Senior Member
 
Join Date: Dec 2004
Location: Tis the season, imo
Posts: 7,849
Default Re: Market Model Thingy

eastbay,


nice post. I would say Im reasonably sure there wasnt any look forward/overlap. I was pretty paranoid about this, and even reran the results with coefficients that I thought had overlap to observe that the results obtained then were a ton better (they were). Also, it was just about impossible for overlap to occur on the second test (the second 7 year period), since the testing data needs to go through a semi-longish transformation that I never did on that data set (just trained using the more recent 7 years), and that showed moderately comparable results.


Evan and I talked about ask/bid spread, which appears to be the same as slippage, yes? I had no idea what this was until a few hours ago, and appears to be something that would be v imporant to incorporate. Assume that a stock has a listed closing price of X is there a reasonable function to get an estimate of the price I would be expected to sell at, assuming I sell at close? Im learning that it is slightly smaller than X, but Im wondering if its possible to estimate it quantitatively.


"If you've sure you're not doing any of the above, well, trade it by hand for awhile and see how it goes."

Just to note: Im more interested IF its possible to using past information to predict the future, not necessarily (at least here) with trading.



Also, just as a general comment to all: I dont really know how to explain it, but you often see people on the forums with little poker knowledge arging against the common beliefs, and you cant help but think that he just doesnt understand the game. Im well aware thats what Im doing here, Id like to stress that Im skeptical of the results myself. Given the debate over the EMH, its v odd that the model could predict the top 100 performers for the next day so well; it would stand to reason that if the model were accurate, that the EMH ought to be discared, yet it hasnt been. But, again, I just couldnt find the error. If anyone knows matlab well, Id be haappy to comment/clean up the code and have them audit it.
Reply With Quote
  #3  
Old 11-02-2007, 08:28 AM
edtost edtost is offline
Senior Member
 
Join Date: Feb 2004
Posts: 2,971
Default Re: Market Model Thingy

[ QUOTE ]

Evan and I talked about ask/bid spread, which appears to be the same as slippage, yes? I had no idea what this was until a few hours ago, and appears to be something that would be v imporant to incorporate. Assume that a stock has a listed closing price of X is there a reasonable function to get an estimate of the price I would be expected to sell at, assuming I sell at close? Im learning that it is slightly smaller than X, but Im wondering if its possible to estimate it quantitatively.

[/ QUOTE ]

slippage and bid/ask are totally different. bid/ask is the spread between where you can buy and sell a block of shares at any given point in time. slippage is how much the market moves against you while you are executing. for very small traders, fixed commissions tend to be their biggest concern. once your account gets bigger, bid/ask becomes the dominant 'cost' to your trading. for institutional-sized accounts, slippage winds up having the largest effect.

basically, until you wouldn't be comfortable sending your trade to the exchange as a single order because it probably won't get filled, slippage isn't really something you need to worry much about. at least not until something bad happens and market liquidity dries up.

i'm sure someone who knows more than i do about single-stock trading can quote you an average bid/ask for large caps.

[ QUOTE ]
Given the debate over the EMH, its v odd that the model could predict the top 100 performers for the next day so well; it would stand to reason that if the model were accurate, that the EMH ought to be discared, yet it hasnt been. But, again, I just couldnt find the error. If anyone knows matlab well, Id be haappy to comment/clean up the code and have them audit it.

[/ QUOTE ]

EMH only needs to be discarded is your system is actually implementable in a way that would make money. trading at the same price (the close) you use to make a decision is a good way to make your system unrealistic. start by modifying your program to include a one-day lag for trading and a linear transaction cost for bid/ask; if your system is still profitable after those changes, then this becomes a much more interesting discussion.

edit: also, to nitpick, when you do your out of sample testing, you should train your coefficients on the older data set and look at the results on the newer set.
Reply With Quote
  #4  
Old 11-02-2007, 02:03 PM
CallMeIshmael CallMeIshmael is offline
Senior Member
 
Join Date: Dec 2004
Location: Tis the season, imo
Posts: 7,849
Default Re: Market Model Thingy

[ QUOTE ]
trading at the same price (the close) you use to make a decision is a good way to make your system unrealistic. start by modifying your program to include a one-day lag for trading and a linear transaction cost for bid/ask; if your system is still profitable after those changes, then this becomes a much more interesting discussion.

[/ QUOTE ]

OK. Any suggestions as to how much of a linear cost?


Also, what exactly do you mean by a 1-day lag? Is using the next days opening price a more realistic sell price?
Reply With Quote
  #5  
Old 11-02-2007, 06:48 PM
edtost edtost is offline
Senior Member
 
Join Date: Feb 2004
Posts: 2,971
Default Re: Market Model Thingy

[ QUOTE ]
[ QUOTE ]
trading at the same price (the close) you use to make a decision is a good way to make your system unrealistic. start by modifying your program to include a one-day lag for trading and a linear transaction cost for bid/ask; if your system is still profitable after those changes, then this becomes a much more interesting discussion.

[/ QUOTE ]

OK. Any suggestions as to how much of a linear cost?


Also, what exactly do you mean by a 1-day lag? Is using the next days opening price a more realistic sell price?

[/ QUOTE ]

25 bps? 50 bps? can someone who knows anything step in with an average bid/ask spread for equities, instead of me almost randomly guessing?

there needs to be some sort of lag between calculating your positions and trading on them. calculating based on the close on day t and trading at the open of day t+1 would be a .5 day lag, which is better than nothing. a one day lag would mean trading at the closing price on day t+1, and would probably be more realistic for someone trading daily. best would probably be to average the open and close of day t+1, implicitly assuming that you used the entire day's liquidity to make your trade.
Reply With Quote
  #6  
Old 11-02-2007, 08:43 PM
CallMeIshmael CallMeIshmael is offline
Senior Member
 
Join Date: Dec 2004
Location: Tis the season, imo
Posts: 7,849
Default Re: Market Model Thingy

[ QUOTE ]
[ QUOTE ]
[ QUOTE ]
trading at the same price (the close) you use to make a decision is a good way to make your system unrealistic. start by modifying your program to include a one-day lag for trading and a linear transaction cost for bid/ask; if your system is still profitable after those changes, then this becomes a much more interesting discussion.

[/ QUOTE ]

OK. Any suggestions as to how much of a linear cost?


Also, what exactly do you mean by a 1-day lag? Is using the next days opening price a more realistic sell price?

[/ QUOTE ]

25 bps? 50 bps? can someone who knows anything step in with an average bid/ask spread for equities, instead of me almost randomly guessing?

there needs to be some sort of lag between calculating your positions and trading on them. calculating based on the close on day t and trading at the open of day t+1 would be a .5 day lag, which is better than nothing. a one day lag would mean trading at the closing price on day t+1, and would probably be more realistic for someone trading daily. best would probably be to average the open and close of day t+1, implicitly assuming that you used the entire day's liquidity to make your trade.

[/ QUOTE ]


I added to the model a discount on all sales by a factor of 0.995, and used the next days closing price as the sell price (I didnt have immediate access to the open price, and it would require a bit of leg work, so I just went next days close for now).

The results were still good, though obviously lower given the 0.995 discount.



Oddly, it appears that using the next days close price actually benefits the model.
Reply With Quote
  #7  
Old 11-03-2007, 11:15 AM
Phone Booth Phone Booth is offline
Senior Member
 
Join Date: Aug 2006
Posts: 241
Default Re: Market Model Thingy

[ QUOTE ]
[ QUOTE ]
[ QUOTE ]
[ QUOTE ]
trading at the same price (the close) you use to make a decision is a good way to make your system unrealistic. start by modifying your program to include a one-day lag for trading and a linear transaction cost for bid/ask; if your system is still profitable after those changes, then this becomes a much more interesting discussion.

[/ QUOTE ]

OK. Any suggestions as to how much of a linear cost?


Also, what exactly do you mean by a 1-day lag? Is using the next days opening price a more realistic sell price?

[/ QUOTE ]

25 bps? 50 bps? can someone who knows anything step in with an average bid/ask spread for equities, instead of me almost randomly guessing?

there needs to be some sort of lag between calculating your positions and trading on them. calculating based on the close on day t and trading at the open of day t+1 would be a .5 day lag, which is better than nothing. a one day lag would mean trading at the closing price on day t+1, and would probably be more realistic for someone trading daily. best would probably be to average the open and close of day t+1, implicitly assuming that you used the entire day's liquidity to make your trade.

[/ QUOTE ]


I added to the model a discount on all sales by a factor of 0.995, and used the next days closing price as the sell price (I didnt have immediate access to the open price, and it would require a bit of leg work, so I just went next days close for now).

The results were still good, though obviously lower given the 0.995 discount.



Oddly, it appears that using the next days close price actually benefits the model.

[/ QUOTE ]

For just sell? I think what he's saying is that if you're trading based on knowledge gathered during day 1 and day n, you need to compute returns between day n+1 and day n+2 instead of day n and day n+1 or even day n and day n+2. You should definitely not do the latter (n and n+2) if you're not normalizing the return.
Reply With Quote
  #8  
Old 11-02-2007, 11:14 AM
eastbay eastbay is offline
Senior Member
 
Join Date: Nov 2003
Posts: 4,123
Default Re: Market Model Thingy

[ QUOTE ]

Evan and I talked about ask/bid spread, which appears to be the same as slippage, yes?


[/ QUOTE ]

No, slippage is the difference between your data feed's quote and your fill. In general they will not be the same.

[ QUOTE ]

Just to note: Im more interested IF its possible to using past information to predict the future, not necessarily (at least here) with trading.


[/ QUOTE ]

Then put your pen down, because the answer is yes. It has been demonstrated many times. Google Jim Simons, for example.

The EMH is approximate, just like every nice neat academic theory any complex system.

eastbay
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:37 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.