Well I came to the realization that TradeStation functions don't necessarily backtest too well. In particular, the built in trailing stops don't optimize correctly. For whatever reason, they appear to lack enough intraday day to predict when the position will close due to down ticks in live data. Therefore, they optimize to an overly small trade trigger and trail percent. In backtesting, trades are held much longer than in the real word, causing poor backtesting results. So, for my breakout system I had to make some changes, using my Risk Amount as my trailing stop trigger and trying out a couple different trail percents between 10% and 30%. This has the effect of holding trades longer, lowering the profit factors, and increasing the size of the average win (a lot). Many stocks are no longer profitable. This is all good news, since the prior results *couldn't* be right but these new ones still look quite profitable for volatile stocks. A 2.0 profit factor and holding times of less than 5% should work out well. Again the full system test trading will take place in early December. I still have another couple systems to code and test before then. Chabah
I cringed at that one. Beware of overfitting and survivorship bias. I would not be targetting individual stocks per se, but broader and possibly correlated markets (the sector) to get a similar effect with less risk of hindsight curve fit.
I am aware of curve fitting bias, which is why I am not optimizing the strategy to each stock. I use the same entry criteria across all stocks. As for testing a market or sector, as far as I am aware, Tradestation does not support it. I have to run the strategy for each stock individually, manually changing the time frame as I go (some stocks seem to like certain timeframes more than others). If you are aware of a way around this, please let me know. It is a lot of work! I should note that since it is a breakout system, I expect many stocks to be flat or unprofitable - those stocks should be the less volatile ones. Likewise, all stocks above a certain volatility should show at least some profit, even if they are not tradeable. Thanks for the feedback - I appreciate it. Chabah
I had a little problem I was trying to work out: Given a set of systems that is in the market X% of the time, how often will N of those systems be in the market simultaneously? What I am trying to do here is figure out how big each pile of trading money should be, or alternatively how many piles I need to trade a given number of systems. I currently have 16 "systems", which is really the same system running on 16 different stocks. Each system is in the market around 1.5% or so. Definitely less than 2%, so I will use 2% as a cap. So how many "buy-ins" do I need to trade all 16 stocks without worrying about running out of funds? It turns out that Excel has this function built in - it is called the Binomial Distribution. The previous question looks like this: =BINOMDIST(2,16,0.02,TRUE) The result is 99.6%. So 99.6% of the time I will have at most 2 positions on. 96% of the time I will only have 1 position on. That tells me that I can pretty safely run these 16 stocks on 1 pile of money (I'm not worrying about the implications of margin yet). Now say I have 50 stocks, and I use the more accurate 1.5% for the time in the market. 99% of the time I will have at most 3 positions on, and 96% I will have at most 2. Again, I can probably run this off of one pile of money, missing a few trades but making the most of my buyin on each trade. The implication so far, though, is that I will be using at most two buyins. However, that means I will need to risk about $150 per trade. I would actually like to cut my risk per trade down and take more trades to give a smoother equity curve. So let's pose the problem another way - how many stocks do I need if I want to risk .25% of my portfolio per trade, using 1% risk per trade? In other words, how many stocks do I need to efficiently trade 4 buyins? Oh, and let's not forget that I trade only intra-day, so I have 4-1 margin. Since each trade uses between 1x and 2x of a buyin, 4-to-1 essentially doubles the number of buyins. So, 8 piles of money. And let's say that I want to peak my buyins only 1% of the time. Plugging this into the equation, it turns out that I need about 230 stocks to trade against my 8 buyins. The 9th trade will only happen .3% of the time. Let's look at timing. My account trades continuously from 10:00 to 4:00. That is 6 hours, or 3600 minutes. .85 * 3600 = 30.68, implying I will be peaked half an hour per day (not continuous). I would have 7 buyins working for 86 minutes per day, and 6 buyins a whopping 3.5 hours per day. This is pretty sensitive to time in the market - a 3% system needs only 150 stocks to trade 8 buyins. I actually plan to trade 6 buyins at first, which means I need to get up to about 80 stocks to be fairly efficient deploying capital. This is all theory - I'll post an update once I start running many stocks live. Enjoy, Chabah
Well I have been a busy bee even with the birth of my daughter over the weekend. I have been developing a new trend following system, but I have to admit I am a bit skeptical that the results seem so curve fit. The reason is that each stock can be made profitable through optimizaiton, but the parameters don't stand up among stocks. But anyway, my account is funded today and I am launching with 15 stocks. See attachment for a screenshot of the setup. This is an intra-day breakout system that is never in more than 2% of the time and always exits on the close. Profit factors range from 1.2 to 2 - not very impressive overall but given the amount of time in the market, not too shabby either. It could well lose money, but that is what I am here to find out. In coming days I will be hunting down more stocks - I need about 40 or 50 total, and a couple of my 15 could stand to be replaced. I will post results and further developments here - wish me luck. Chabah
So the system has been trading for 3 days so far, and has generated 24 executed trades. Another 8 or so were rejected, once because of a disconnect with the server and the rest because short shares were not immediately available. 24 isn't a very large sample size, so I am not too discouraged by the results. But, they are not good. The closed P/L is -$538 trading on a $5,000 base. That leads me to a problem with the $5,000 base. I posted earlier about the binomial distribution. Well, one thing I missed is that TradeStation computes the Time in Market based on the TOTAL time, not the time the market was actually open. Therefore, my percent of time in market calculations were off by a factor of approximately 5.6. Thus, instead of 3 positions being open only 1% of the time, it actually occurs more like 10% of the time. Even 4 positions occurs more like 3% of the time, or 46 minutes per week. Therefore, for 16 stocks I need more like 4 piles of money, which is a huge change. What that means is that if each stock returns 10% annually, that is about 40% per year uncompounded. That is OK but not too special, especially since there is no guarantee I will make 10% in a given year. All the stocks I picked made more than that *last* year, but that means very little. The good news here is that I am cleaning up errors and misconceptions pretty quickly. The bad news is, every correction seems to dampen the likely outcome - in other words, all the errors so far have pointed to outsized returns, not undersized. That's unfortunate. One last thing - if you plan to use the SetExitOnClose function in EasyLanguage, be sure to read the definition very carefully. I didn't, and I got stuck with some unexpected overnight positions. Chabah
You've lost 10% of your funds in 3 trading days... Most people would consider that a bit worrying. I have been watching this thread and it's been interesting to see you break down the mechanics of the trade and build the system. If the system you have created is reasonably modular, you should be able to swap in buy and sell signals fairly easily, no? Are you using the right buy and sell signals? Perhaps it's time to sit down and think about the actual money-making guts of the system as opposed to the mechanism that implements the system. The latter is just the wrapper, after all. Cheers Suss
Chabah, I have not read the whole thread so I don't know what is your trading style but I thing you are not well capitalized to trade. To day trade you need to have 25k base at all times but you said you have 5k and you have made 24 trades in 3 days so how it's possible? trendtech
Actually I tried doing exactly that, but it did not look so good. That is basically a "return to the mean" strategy which has very limited upside per trade. The advantage of the breakout system is the large gains on real breakouts. The 10% of funds is not a big shocker because each trade has 1% risk and I am down a net 10 trades over 24 total. That is similar to playing poker and being down after an hour - it happens. Psychologically, I am not sure I am ready for the real-time fluctuations - an automated system where I just check in at the end of the day definitely suits my personality. The channel system idea looks like it may address that - the equity curves are a bit smoother. I'll wrap things up after the week ends and I am back to work next week. The best news is that I am learning a lot - trading with live ammunition definitely reveals a lot that backtesting can not. Chabah PS The 10% doesn't bother me also because the $5k is my test bed - if the system doesn't work, best to find out with this amount than my full trading account. Finding out it doesn't work is worth some expense.