Monday, November 10, 2008
Wolfe Wave - look for them
Sunday, October 26, 2008
Tipster Trendlines - things to come
The "free" version is no longer available. Go to the Tipster Trendlines 2.1 post for additional information.
Here is a short video showing you what I'm working on next for the Tipster Trendlines code. The code is not yet 100%, when it is, I'll post it. If you have any comments on what is being planned for the next version, leave a comment.
The new version will feature drop down menu's and trigger buttons right on the chart.
Enjoy!
Wednesday, October 22, 2008
What do you think is going on?
This post is not meant as investment advice, it's purpose is to spark some comments and discussion.
What's your opinion on what the market is doing? Why all the volatility? Why the melt down? Why is the US dollar going nuts? What's up with the huge drop in oil? Why are great high dividend yield blue chip stocks taking a hit? Here are my thoughts;
Liquidity seems to be the issue. Investors were, and still are worried that the firm they have their money invested in will go bankrupt, or worse, the firm they have there money in has invested in some other firm that goes bankrupt. Either way your funds would be locked up in a bankruptcy and that's not liquid. This has caused people (or those on wall street) to cash out, stocks, commodities, everything. You never saw this coming did you? Wall street did, that's why there was a huge drop to begin this mess. Read the user groups on the early questions on the put volume of some of those firms that bit the dust. People were trying to figure out if they were buying or selling puts. Looks like they were buying puts and made a huge, huge killing on the firms that went tits up.
Why is gold not going up since it is the safe haven? Cash. Everyone wants cash. The biggest cash nation, rather richest nation is the USA. That's where the credit crunch started. Funds are liquidating investments world wide causing all indexes to fall from the massive selling. Once they sell a stock in a foreign country they must then convert the currency back to USD. The USD is going full tilt in an uptrend. I think you can almost compare currencies to see where the biggest exchange of funds is happening to some extent. In Canada, the oil and commodity prices are also killing us, that impacts the Canadian dollar. Why are the commodities dropping such as metals and gold? Liquidation.
This is going to be a long healing process, not a quick snap back to the market. The volatility is probably due to huge amounts of money being moved around, not the norm for the market. To end this, the mass amounts of cash has to be moved to the US and invested elsewhere.
So what is next?
When the time comes, when all the cash is back at home in the USA, who knows what will move. The first sign will be the indexes stabilize, then slow decline in the USD, then accelerated decline of the USD against the Canadian dollar, oil will rise, and whatever the US giants invest in will rise. If a recession is coming, look for a rise in recession proof stocks. The USD will cease to rise since there will be no more buyers.
What am I going to do? I'm going to try to ride the USD higher. When it snaps the uptrend, short away. But be careful and manage risk. The market will start to settle down and into a trend when the normalcy again, weather its a bear or bull market.
That's my theory. What's yours?
Saturday, October 18, 2008
Globe and Mail and the way forward
This is a look at the past, the present, and the future.
A while back I was contacted by the Globe and Mail and asked to participate in the "Me and My Money" column. The column is below, click to enlarge. The paper version has a fairly large picture of me playing my guitar, very cool.
Larry MacDonald also mentioned me in his own blog, where he discussed day trading on the TSX. Anyone else out there day trade the TSX? Technically, I'm not day trading since I don't watch the screen during the day. I put my order in at night, it could trigger the buy and sell in the same day, thus called a "day trade". Below the article I describe what has changed since then.
Page 1
Page 2
Something has changed since the article was written. I have moved all of the RRSP accounts that hold mutual funds to a discount brokerage. IB does not offer RRSP, LIRA, or RESP accounts so I went elsewhere.
Why did I do this?:
First of all, I had my funds in RRSP's for the same reason most other people do, not enough time to manage it and for the long term I felt the pro's would do a better job. For the most part this might be true. The single issue I have with this is their ability to exit when they smell something rotten, such as a declining 50 day MA, even worse with a declining 200 day MA. Even if they knew a few US firms were about to implode, how could they liquidate a fund of that size? Who cares. I know I could liquidate my holdings in a blink of an eye and not cause any market movement.
The long term plan:
First of all, cash is a position. Decide for yourself when to get in and get out, before your emotions take control. Here is my plan. After reading a book about a guy who purchased solid dividend paying companies, and retiring, I decided to go on my own. I will only purchased companies with that meet certain criteria, the top two are "must pay dividends" and "from the chart". There is more to the dividend research than that, just like there is more to the "chart" than that. Basically, dividend paying companies in an uptrend, or at support.
How has it worked so far? Pretty good. In the past few weeks some of the fund transfer was complete so I went on a search to find some stocks on the TSX. (I wasn't about to buy on the US exchange as the CDN dollar has been beaten up lately). One of the stocks that I set up an order for was BMO. All four stocks had limit orders set up, set up at prior support. I figured it could take up to 4 weeks to get a fill if the market was going to be ranging. To my surprise, the very next day the market got killed. All four orders were filled. Scary you might say. It turned out pretty good. Patience to wait for the price was a key, after all, it's long term. Here's a chart, my fill price is the white horizontal line.
BMO.TO - WeeklyBMO.TO - Daily
Notice that there is a triple bottom, and each bottom on the weekly chart has less volume, that's good. As far as risk management for this trade there are two options.
First, if the price breaks that support - get out quick, usually a fourth test of a horizontal line is like a hot knife through butter.
Second, set the stop at my break even while considering any dividends received, perhaps setting the stop a little lower for breathing room. I'm looking at the close prices before I place a stop order.
Third - never sell. Strange thing to say but at the white line it is 7.5% yield. Better than a sharp stick in the eye.
So lets sit back and see which way the market heads. The path of least resistance is down. To be back in an uptrend we need higher lows and higher highs. Or we could range for a long, long time. If you want to see what a bottom looks like (it's hardly ever a V on a daily chart), check out today's video at alphatrends.net. Also take a look at this Bear Market Post to gain perspective. Yo be your own judge. If your confused, put your money under your mattress and wait for the bullets to stop flying. Cash is a position. If you know what your doing, follow your trade plan.
One more thing - I almost have a working version of an updated tipster trendlines with more bells and whistles. This one has trigger buttons and drop down menus right on the chart. Should be ready in a week or so. Is anybody using version 1.0 or 1.1 of the code to trade with?
Saturday, October 4, 2008
Chart Trading Question
Line BS is the buy stop order. The price must go below this level for the order to trigger. This is the "Parent" order.
Line ST is the stop loss order. This is a child order, child of Parent order "BS". This order is will not trigger until the Parent order triggers (BS).
Line TA is the target order. This is a child order, child of Parent order "BS". This order will not trigger until the Parent order triggers (BS).
So in this example, if the BS order was a "DAY" order and not a "GTC" (Good 'Till Cancelled) order, at the close of Oct 2 the order BS has not triggered, therefore ST and TA will not trigger. At the close of the day the orders will automatically disappear from TWS and you would not have a position.
How does this work in TWS? To see how this works, left click on the coloumn titles of your order page inside TWS. You need to add a field called "OCA" (One Cancels All). The Parent order (BS) will be blank. The two child orders (TA and ST) will have the same numbers in the field.
When you set up a bracket order manually within TWS, this is basically what TWS is doing for you. You can also do it manually. Try it manually to learn something. You can also use this technique to capture a breakout of a range, such as a squeeze in price, if you want to catch a move to the upside or downside. I haven't played with this type of order very much but I'm sure it can be done so that when you get a break in one direction, the orders for the other direction are cancelled.
Friday, September 26, 2008
Risk Management
Risk is job 1. Patience is job 2. What the hell does that mean?
Patience is important for entries and exits, jumping into trades to early, not waiting long enough for the price to run, can be counter productive to the outcome of the completed trade. I think this goes without saying but it's harder to do in real time than most think. This post is not about patience, I mention it only as a comparison to risk being job 1. Risk can be managed, and should be to avoid your "hope" that price will follow.
There are poeple who make a killing from "pump and dump". The people who buy once its hyped, and do not sell even though the price keeps declining, are 'hoping' and are not controlling risk. You would think that the stock is purchased prior to the pump by the insiders. It is, but it is also shorted at the crest when no more buyers show up. Watch the volume, that shows you how many people are at your party. When the party gets lame, leave and look for a new one. Easier said than done for most. Use bracket order to control your risk, thats one method.
Rather than write about what I mean by risk, here are some posts on the topic.
The 2% Rule
Position Sizing - Bull Trapper
Position Sizing - Trader Mike
Position Sizing Spreadsheet
R-Multiples
Another source is a book called "Trade your way to Financial Freedom", or "Technical Analysis using Multiple Time frames" . To search for books that may be available on the net in pdf, take a look at this post "Tools For Trading Post".
I developed a screen that shows me how much to risk based on the account balance. I use some afl code in Amibroker I developed with the help of some code from the Amibroker Knowledge base web site. The starting code had nothing to do with risk. It is using Amibrokers new graphics commands and allows you to put buttons and graphics on the screen, the same area as the price plot. The code is a bit rough around the edges but I post it so you can at least have basic functionality. I plan on making it much more robust shortly. The final version will not be shared though, unless the is a contibuton made.
There is two parts to this code. First, a chart to draw lines. Second, a pane that has code to display risk, profit, etc. The first chart with the lines writes the static variables of entry, stop, and target as well as the ChartID and order of lines (long or short set up). The second retrieves the variables and some information from your Interactive Brokers account and computes a bunch of information automatically for you.
Here is a video that explains what it all is and the code. I also explain some of the basic of the bracket order; how it triggers, how it cancels, etc.
Part 1 - To use the code, you need to draw 3 (horizontal) lines on your charts to define entry, stop, and target. That code can be found on the post titled "Tipster Trend lines Post"
Part 2 - The second chart, or pane, or code snippet is right here. "Risk Management Code"
Wednesday, September 24, 2008
Michael'sScreen Shot
This is my screen shot, as you can see it is nothing special, I use at most two indicator like PPO and ADX for detect HDIV and DIV and pattern like Wolfe Waves.
Michael is also preparing a guest post on Wolf Waves, we look forward to that post.
Short Interest
If you use Short Interest as part of your strategy, I draw your attention to a recent comment.
"If you're doing this sort of thing for a living, then you need more timely information. Here's a site that provides that for a nominal cost:
http://www.squeezetrigger.com
He also states that he does not how good the info is. I haven't done any digging but as far as I know the short interest for stocks is release twice per month by the NASDAQ exchange and I'm not sure about the NYSE. Therefore, I doubt the info is more timely than anywhere else, but it might be for other exchanges. If anyone knows, please share.
Tipster Trendlines
Thanks to Murthy for additional code for the Tipster Trendlines, trading from the chart.
He has added functionality that tells you if your lines are off the viewable chart area along with some other functionality.
A new version of Tipster Trendlines is available.
The "free" version is no longer available. Go to the Tipster Trendlines 2.1 post for additional information.
Pete's Screenshot
Pete sent me his screen shots. He shows us one EOD and one Intraday screen. He's trading index fuures on these charts. From his description, it looks like he's visited DayTraderRockStar. Pete, great set up, good job. This is an example of simple uncluttered screen. This is very close to a template I'm working on at the moment for futures. I'm currently working on my "Radar Screen" that has overall market Ticks, Puts/Call ratio, and Trin as well as some of the majors.
Instead of me re-writing what he has sent me here it is;
I would also recommend www.powercharting.com for some really great information on trade setups for trading futures intraday. The two charts I'm sharing are rather new for me. I just configured them a couple weeks ago when I started doing a little intraday trading.
The intraday setup chart is pretty simple. I use the real-time quote window on the bottom to select the security I want to view. The 15 and 5 min charts are linked so they show the same ticker. I use a 20 period EMA along with a 200 period MA. Those horizontal lines you see are pivot levels. I have since refined the code to calculate weekly and daily pivots on an intraday chart automatically. I just love the flexibility Amibroker offers.
The EOD setup is an example of my pivot point calculations (shorter lines at far right), and I have a few longer trend lines which are there to remind me of weekly and monthly support/resistance levels.
I have been working all summer long on developing a trading system. For now I don't have anything to show in that area as it is still a work in progress.
Thanks again for sharing and also for providing an environment for others to share.
Thursday, September 18, 2008
New Feature
A new feature has been added to the right sidebar. You may have seen this on other blogs, the "Recent Comments" list. It takes the most recent comments from all posts and sorts them by when the comment was made. I guess it could also double as a text messaging type chat. So next time you post a comment, no matter what post, it will be displayed under the recent comments header.
Monday, September 15, 2008
Screen Shots
Often we read about trading systems and methods, risk management, triggers, market indicators, and the list goes on. As I read through blogs and trading books that talk about set-ups, triggers, stops I often ask myself "everything is being presented except the final piece of the puzzle", usually this is the entry and initial stop placement. Sure, once the trade gets going there is an entire different approach; when to take profits and how soon to move the stop. I wonder what the screen looks like that these guys are trading from? How do they arrange the windows to make it easy to monitor the things they need to monitor. I've seen pictures of huge desk's with multiple monitors. What's on these screens? Have you ever watched videos on Youtube by the "Suck My NASDAQ" guy? He's a day trader that makes pretty good calls but he never gives you details and never shows you his screen. Until we see what he is looking at, we cannot tell his source of info, or what he's using to form his "opinion". Not that we need too.
Method 1: This is the method I use. Maximize your application that you want to capture. Press the "Prt Scr" key (above the "Home" key). Open up your email application and "paste" the image. If you want to trim it first, open up your Microsoft Paint or something similar (I use a really old version of Paint Shop Pro) and edit the image.
Method 2: Use other software the capture, Paint Shop Pro also does this (I use a really old version, simple but effective). You could also use something like screen Hunter 4.0 (Freeware).
Danger:
Above: Main screen with MA's. Watch the videos for additional info on this screen.
Screen Shots by David W
He writes:
"I have lots of screens and indicators that I have tested and tried over the last few years – and now tend to use 2-5 indicators, CCI, and a price chart. In other words I have my favorites. This is a great idea because I got to this point looking at other peoples screens and setups. Would only take a few minutes for the screen shot. Also this is exactly how I am documenting my system – screen shots and descriptions in Word. Further, If I like someone’s idea – I add it to my future plan section in my Trading Plan. "
Thursday, August 28, 2008
Tipster Trendlines
This page is out of date, click "Tipster Trendlines" at the top of the page.
The "free" version is no longer available. Go to the Tipster Trendlines 2.1 post for additional information.Trading from the chart - what a concept!
AFL code to trade from your Amibroker Chart
I've had many emails asking me for the code that I use to trade stocks from the Amibroker chart as seen in this chart trading example video post. I've decided to release the code since that is the spirit of the Internet I enjoy most. I was using separate files but to make this easier I've rolled them up, now there are only two files. Before you grab the files, please watch the quick video.
Make sure you test this yourself, all types of trades, Long, Short, at MKT, at LMT, at STP. And always make sure you double check the order entry in TWS before your transmit the order. I take NO responsibility if your a hammerhead and don't check your orders before you send transmit to the exchange.
- MessagePanelInclude.afl - put this file in your default include directory. This is usually /Amibroker/Include/
- TipsterTrendlines.afl - put this in your "custom" folder, or where ever you like, it will work from anywhere.
(BTW, donation button is on the right)
What it will do and won't do
- Use this code to place bracket orders with trend lines drawn right on the Amibroker chart.
- It does NOT allow you to use Amibroker to sell or cover, only place bracket orders.
- Lines should be called BS - Buy or Short, TA - Target, ST - Stop (case insensitive)
- Once you place the order and transmit, you need to manually adjust the target and stop inside TWS, the code does NOT do this for you once your order is placed.
- You must have Amibroker 5.0 or above for the coloured bar to appear at the top of the chart.
- Put the file "MessagePanelInclude.afl" in your include directory.
- Put the file "TipsterTrendlines.afl" in your custom directory
- Right click on the TipsterTrendlines" in the "Charts" sidebar and click "Insert" or "Insert Linked"
- You can run "Debugview" to see what the program is transmitting to TWS. Debugview is in your windows directory.
- You need to install IBController for Amibroker to communicate with TWS, it's available on the Amibroker website.
- Make sure you set up TWS API interface under "global" config, and set trusted IP to 127.0.0.1
- This code uses GetChartID and therefore might give you odd results if you open another chart with the same code and place trend lines with the same labels (BS, ST, TA). It might place an order for the wrong symbol, I have not tested this. To get around this either consider using the actual chart ID (available in the parameters window)
- There is no code to keep from placing multiple orders. If you hit "Buy" twice, you will place two orders, so be careful.
- The code also does not check for waiting or pending orders.
- This code works for stocks only, or other instruments with 2 decimal places. Forex uses 4 decimal places, so if you try Forex, you order is rounded, therefore do not use with Forex.
- In the future I may add additional functionality such as that listed above. If you have improvements on the code please let me know about the improvements.
- Check for pending or waiting order to prevent multiple orders from being transmitted
- Make display bar used as buttons (transmit, auto-trade on off, Long, Short, Close, Reverse, Cancel Order
- Drop down menus can also be added And lastly, if you like the code, please post a comment to this post.
Monday, August 25, 2008
Stock data from Yahoo
Here is a sample of data that is retrieved from Yahoo! for MDCO, on the Nasdaq. This is the data source that I use for the short interest scan.
Trading from the chart with Amibroker
I've had a few inquiries about the code for chart trading with Amibroker. I will be posting the code soon. Should be up in the next week or so.
Sunday, August 24, 2008
Weekly Nasdaq Scan
Wednesday, August 20, 2008
Monday, August 18, 2008
Another example of trading with trendlines
I thought I would take the "potential" set-up Brian Shannon spoke of in his video today to show the "Trading with Trendlines" code I have written for Amibroker, interfaced with Interactive Brokers TWS platform. Both the set-up video by Alphatrends and my own video are below.
Alphatrends
Trading with Trendlines
Poll
I've added a new poll on the right side of the blog, "Do you trade from work?" This assumes you have a regular day job. Please take the poll, I'll be doing a short video soon on trading from work.
Do you have a questions that would be appropriate for a poll, that would give you a better sense of what other trader are doing? Perhaps "do you use a moving average crossover as part of your trading system?" If you have any suggestions, I'd like to hear them.
Saturday, August 16, 2008
NASDAQ scan for upcoming week
This scan includes short interest as well. Watch the video for details. All the stocks are longs and all are on NASDAQ. You can also get the excel file for the NASDAQ Scan Aug16 2008.
Monday, August 11, 2008
A nice toy, just say it!
If you use the command "Say" in AFL, or some other kind of audio alerts, check this site out;
http://www.research.att.com/~ttsweb/tts/demo.php
This site lets you type in the text, listen to it, and download it. Easy and painless. You can select different voices as well. It sounds tons better than other text to speech engines I've heard, and it sure beats the basic voice Microsoft gives you (Amibroker uses the Microsoft engine when you call the "say" function, look it up in AFL help)
I use the "Lauren" voice to tell me all about the orders I submit, or if there are data errors, etc. Why stop there? You can use these sounds as part of your windows sounds scheme too.
So when you boot up your computer after dinner to plan the day for tomorrow, this is what you could hear.
Sunday, August 10, 2008
Software Applications for Trading
Here's what you need to interface between Amibroker and TWS to trade with trend lines and auto trade. I also do a scan of the TSX and update an earlier trade.
Scan of NASDAQ and short interest
Tonight I ran a scan of the NASDAQ looking for stocks that are in one of two categories, the same criteria used in the last video I posted. There is one addition, I have added the short interest to the output (not used in the filter, just displayed on the output)
1. 10 day MA > 20 day MA > 50 day MA and 50 day MA rising
2. 10 day MA < 20 day MA < 50 day MA and 50 day MA falling
Other filters are in there as well, simple things like today cannot be the highest high in the past 5 days, the 20 day avg volume has to be more than 200K, today cannot be the lowest low over the past 5 days. This is trying to catch a basic pull back, or a stock correcting over time in a range. Here is the link to the spreadsheet with the scan. In the video I explain the san results.
Saturday, August 9, 2008
Indicators
DAX, QQQQ, SPY, IWM, TSX Stocks, Forex, whatever you trade, price patterns and understanding why price moves is probably better than memorizing patterns. Take a look at a MACD divergence and a price chart that uses the same MA's as the MACD. Find a divergence. Look at the patterns of higher highs and lowers lows. Notice that you can see these if you look. I find the most use for indicators is to filter my scan results.
Here is an interesting concept that I have looked at, it comes from some forum somewhere. I believe it has merit.
Crossover systems will generally do well when traded intraday, not so good when traded of daily prices. By substituting different filters based on the most recent action of the chosen market, you can use their basic rules (idea) forever. You can program this to be self adjusting (auto optimize).
As part of my exploration scan for trending stocks, I use the double stochastic, it filters out stocks that aren't pulling back quite to where I would like to see. This is a good use for an indicator, not as sole selection criteria. Support and resistance, and a dose of anticipation.
Friday, August 8, 2008
Using Multiple Trading Systems
Some info I found while surfing. I don't use neaural nets but I can relate to using multiple systems to increase trading frequency. The system should be non-correlated. It's a good read.
First find out what is going on in the market you want to trade in the timeframe you plan on holding a position. If you want to day trade with one trade per-day then find out all the different ways the day has played out in the past. Ex. trend day, two-way day, reversal day, etc.
Once you've done this you should have an idea of which type of day is most common and which is most profitable. Then define something which could be of value to trade one of the market types. An example might be in a reversal day to find out how often the market makes a low of the day in the first 15 min. of the session. If it happens often enough to be of interest then you go on to the next step.
Take every period for which the target is found and create a table of outputs with 1 for the target and 0 for non-targets. Then pre-process all the inputs into the target and convert them to binary inputs. (A common mistake is to take open, high, low, and close data -- analog and assume you can find relationships with the target). For ex. yesterday close > day before yesterday close. If found mark the input as a 1 if not present mark it as a 0. Do this for as many identifies as you can. This may present a hundred or more binary inputs leading to the target for each day of the data.
Then you'd pass the data into a backprop neural net and have it train on the data. (You’ll need to set aside some data for out of sample testing). Once it's trained to hit at least 90% correctly test the NN on the out-of-sample data. If you hit at least 85% correctly then you can do one of two things. If you're a discretionary trader, setup the NN and pre-process the inputs every day and use the net to predict whether tomorrow has the target (in this example the low of the day is within 15 min. of the start of the session). If so use it to trade to the upside as long the net remains 85% correct. If you're a systems trader then go back to the net and look at the weights of the net to see which of the binary inputs were most important in hitting the target. Use the inputs to create a back testable system based on the patterns. A system might be when xyz pattern exists then buy next bar above the lowest bar as long as the time is within the first 15 min. of the day. Set the stop to one tick below the low.
If the system tests profitable enough to be of interest then move on to the next step.
Next, take the trades and test them against random trades pulled from the same year (the edge test). Rank the trades versus random for each year of the back test. If the trades score consistently above the 70th percentile then you can guess you've found an edge-based system. If not, then you have to assume you've found a temporal characteristic in the data that can be exploited for some period of time.
If its edge based then all you need to do is adjust the trades for market volatility and apply a money management strategy. Check the trades on a periodic basis to ensure the edge continues and plan what to do with your next million. If it's not edge based you can still trade it but you need to setup an objective bailout method such as running a monte carlo sim and determining the bailout point to be say the 95% level of the predicted max drawdown point. Your trading would be more defensive using a non-edge based method as well. Maybe you'd split the trade size in half and have a 15 min. or 10% of daily range as a filter to adding the second position (letting the position prove itself) as long as the volatility was large enough to justify the scaled entry.
Every model I've worked on has gone through the same process. Look at the behaviour’s present in a market; characterize them by creating a rule and checking the fit until all behaviour’s are noted. Then start looking to see if there is a component to the behaviour that is non-random. If so, develop a system to mine it and create a way to monitor the behaviour to ensure it's persistent over time. For example, one of the behaviour’s widely known is the trend day in the SP market. It can be identified just by visually inspecting a chart. I characterized it as a low/high within 10% of the low/high of the day and the close within 20% of the high/low of the day. With the definition I can see how many of these days have persisted over the years (averages about 25 day’s per-year). Then I can see if there is a way to identify these days in advance (realizing I'm going to also be capturing some false days as well).
The algorithm used to adjust the number of contracts traded to volatility is calculated by the range (high - low), then average it for the past ten days. I use ten because I want my model to cut back on size pretty quickly if the volatility jumps. Then I divide the highest historical 10 day volatility (approx. 48 pts.) by the current volatility (ex. 8 pts) to come up with a multiplier (ex. 6). The model would then apply 6 contracts for the next trade. This is not the final size used to trade. It's just used to adjust the model for volatility levels so I measure one period against another without volatility being a consideration.
By doing so, I can see if the same level of opportunities persist from period to period. I can also use these normalized trades to feed into money management models as well as Monte Carlo tests to estimate future performance and drawdowns. If you were to use trades from say 2000 and 2004 for the SP market in a Monte Carlo test without normalizing volatility you'd get a much distorted estimate of future performance.
Comment from reader:
Just to make sure I understand the big picture, this is all being done to increase frequency in the desired profitable time period, correct? So if I understand, sub-par models tested individually with low frequency can be morphed into an above-par model when combined with other non-correlated sub-par models (assuming they're not too sub-par), thus increasing frequency, consistency, and lowering the need for a higher profit factor? Thank you for presenting the information the way you did, I would not have made that connection otherwise (assuming I’m on the right track). Fascinating.
Trading System Development
Trading system development – The DUM method
D - Define
All systems are based on finding and pulling a fundamental truth about the market. Define what fundamental truth you'll be going after. Eg. All markets have a tendency to trend beyond random. Now you've got the definition that most technical-based hedge funds are derived from.
U - Understand
Determine the conditions under which the defined truth tends to occur. In the case of a trend tendency it could be when does the trend tendency begin beyond random? This will lead you to how to measure a trend. Since trends can occur randomly, how do I determine if a trend is beyond a confidence level of randomness? Does the trending tendency beyond random exhibit the same degree of persistence beyond one year? two years? 5 years? If not, is there some point at which the persistence beyond random occurs every year? If so, does it also persist at the same frequency for 5, 10, 50 different markets? If so, you've discovered a fundamental truth and you now understand what you need to know about the behaviour.
M - Mine
Once you understand the conditions under which the behaviour occurs, you write the code necessary to map the understanding of the behaviour. Is the code going to be all inclusive of many markets? or try to just go after the best of the best? Once mapped it's a mechanical process to determine how well it maps against the behaviour. After you're satisfied you've developed a satisfactory method for mining the behaviour, you can do an edge test to see if it happens beyond random. If not, use Monte Carlo sims to determine confidence levels for trading the method. Determine at what confidence level you'll stop trading. Examine the drawdown versus the profit. Is it worth risking any money on this? If so, allocate money using a money management scheme.
After you're done with this, you'll have your first system. Next, develop a complimentary system (non-correlated). Go through the same process for (a different type) a range bound system. Once you've gone through the mining stage, use the correlation test to weight the two systems. Apply the weights to the money management scheme and move on to your third system.
Trading with Amibroker
Update can be found here:
http://blog.tipster.ca/p/tipster-trendlines-3.html
Wednesday, August 6, 2008
Short Interest and the Short Squeeze
Sunday, August 3, 2008
Scans
Check back frequently, I'll be posting scans for the TSX and the US markets. The TSX scans are based on momentum buys. The US market scans are for short interest. You can use the short interest scan to look at some charts and select those that look poised to move on a short squeeze.
Wednesday, July 23, 2008
Basic Rules
All the list of rules floating around, what do you belive, what do you use? What works? After spending a few years digesting lots of information I can now quickly read an article or blog post and know if it fits me, my style. There are a few very very basic rules that I remember each day. You should do the same. Make a top ten list. Revisted the list every now and then. Put the list on the wall. Modify it as you learn and progress. Here are two rules I have boiled down to one, once I learn to understand the first rule and was burned a few times, the second just made more sense.
Don't chase price. Do not chase price. All the books tell you that, but then they go on to tell you about indicators or other stuff. Want to prove it to yourself, run a system where you buy after a run, say 3 up bars and see what happens. You get hammered that's what happens. Why do we do it? It's not based on logic. This is one of the reasons I want to implement a mechanical automatic trading system to keep me from doing it. Yes, I have done it it and I look back and wonder what the hell I was doing.
Patience. Have patience. If we follow this rule, we don't have to worry about chasing price. This is rule #1.
I think the single most meaningful sentence I have read in any book or blog is "Most of your time trading is spent waiting". I hate waiting. Who likes to wait in line for a ride at the amusement park? Who like to wait in traffic. We are trained to not like to wait.
Learn to WAIT for the opportunity to appear. Sometimes the wait is short, sometimes long. LEARN TO WAIT. BE PATIENT. If you miss your entry, learn to trust that you will get another chance. If you miss your exit, just take what you can and be happy.
"What you do determines whether you lose. What the market does determines whether you profit." (Sun Tzu)
Wednesday, July 16, 2008
Price Patterns
We have all tried to use indicators to build a system, I have tried to use them to build an auto trading system and have found that it’s not worth the effort of looking for a great combination of indicators only. You need to use price action first and foremost. Support and resistance with a few other gems like a simple momentum and moving average are, to me, what works.
I have also found that indicators and patterns are just another way of looking at the same price action. Now that I've been staring at indicators for a long time and understand price action, and memorized patterns such as head and shoulders, bull flag, etc, understating basic price action has allowed me to forget about all that stuff. It's all just another way of saying higher high, higher low. If you read the book you might also have this "moment". After watching Alphatrends videos and reading Brian Shannons new book, the approach that makes the most sense to me is support and resistance, higher high, lower low, etc. For auto trading, the trick is to be able to program the rules as you apply them when looking at a chart, into software. Not so easy.
I trade Forex based on an auto trading system I developed, currently, no real money as there are still bugs. I also trade the TSX stocks (real money) based on the approach demonstrated in Brian Shannon's book. Each night I’ll perform a scan of the TSX and set up the trades for the next day. My approach has been altered somewhat since reading his book. The original was based on reading his blog and watching his videos. I have created code to scan for these stocks that are in stage 2 or 4. So far so good. Obviously it would be more profitable to check on the trades intra day and adjust the stops to protect profit. That doesn't seem to be the most damaging though. The entries are planned to be on a stage 1 to 2 short time frame but a morning gap usually kills me as it retraces. This doesn't happen all the time. TWS (IB platform) does allow conditional orders but not to the extent I need them. I need to look for a pullback to a level, then a break above another level (buy stop) to pull the trigger. To do this I will need to program Amibroker to follow the stock and place the order. That's my next project after I get this auto trading forex code working well enough to make some $. As for the TSX, its working out, but it would be more profitable if I had the code mentioned above implemented.
Technical Analysis Using Multiple Timeframes
Brian's work has been published or written about in Technical Analysis of Stocks & Commodities, Barron's, Active Trader, Stock Futures and Options Magazine, and hundreds of online sites.
I bought this book recently and read it from cover to cover twice. The presentation makes it easy to understand the concept of support and resistance and offers some input on why markets move the way they do. Brian also eliminates chart reading bias by removing the symbols from the charts.
The trend is your friend, but which one? Opposing trends can be found on various time frames in the same stock, at the same time creating confusion and worse, unnecessary losses. Understanding market structure and trend alignment allows you to put emotions aside and focus on the right stocks at the right time. Techniques covered in this book are appropriate for anyone (from day traders to investors) who is looking to improve accuracy in their buying and selling.
To order this book, just click on the image below.
Thursday, July 3, 2008
How's your autotrading system? - Response
Post 1
When you cut your losses and let your profits run, it tends to produce about a 35% accuracy (i.e. win rate). The problem seems to be sitting while the losses accumulate. If you're doing lots of trades on one-minute data, maybe it isn't so hard. Does your software run unattended?I have a preference for higher-frequency trading because it seems to produce a smoother equity curve. I am also a bit impatient, and I have difficulty watching my systems lose money. The computer trades better than I do in that regard.I get my ideas from pretty much anywhere, including some unlikely places (e.g. elitetrader.com). My main criteria for choosing an idea to develop is how well it would fit with my needs and lifestyle. I have been at this long enough to know how important that it. I want as smooth an equity curve as I can get, and I want the most reliable system that will generate a minimum return. I reject ideas because they trade too often or not often enough, or because they have drawdowns that are too deep or too long. I also develop trading ideas as a form of -- don't know what to call it -- entertainment, I guess. It's a treasure hunt.I write almost all of my own software using Delphi/Pascal. I like to test everything I do, but I have developed and run system that I cannot test beforehand. Christian Gross also talked about that with regard to algo trading. That can be scarey.[rwk]
Post 2:
This is going to be a very long-winded response, but I think itmight be helpful. So, before I even get into how I come up withtrading strategies, I think it will be helpful to give a little bit ofmy painful history, just for context.....Let me start by saying that I'm (by trade) a full-time softwareengineer and have been for about 18 years. I've tried to trade/investfor about 10 years with very little long-term success. If I wouldhave kept my money under a mattress for the majority of those years,I'd be better off today. But, I don't think I'd be better off 10years from now.....All of my trading endeavors/techniques were based on more-or-lesssubjective opinions and the latest book from Borders or Barnes andNoble. So, after trying to trade/invest half-heartedly for severalyears and then loosing my $#*&^*&@&# about 5 years ago, I took a breakfor about 1 year and then started treating investing/trading moreseriously. I read many books (all of which I'm sure you've heard of)and really just took the time to understand the let some of the basicssink in (namely-RISK MANAGEMENT). After I learned how to properlydeal with risk management and position sizing, I still tried to trade(by hand) and mostly broke even (or lost a little money).So, about 2 years ago, I think I finally got serious enough aboutnot loosing money that I decided to try to "objectify" a few tradingstyles (based on one or two recurring intra-day market patterns that Ihad my eye on). My stategy ideas were a result (I think) of my ownfailures, reading books, reading blogs and understanding what I likedand didn't like (I like speed). By the way, none of the books that Iever read from any bookstore have helped me with trading techniques. To be honest, I have found them all 100% useless. Now, with thatsaid, I have read some very good trading books, but they were onpsychology.I started doing this (by hand) in my IB SIMULATION tradingaccount. By the way, the decision to finally "objectify" my tradingtechnique was as a result of reading "Trading in the Zone" (by MarkDouglas). If I would have read this book early on in my "halfhearted" trading career, I probably would have stopped reading halfway through as it would have been boring to me. But, after being aperpetual looser and beating my head against the wall for so manyyears, I think I became a better listener. I guess I was at a pointwhere much of what the author had to say actually mattered to me andmade sense.As I embarked on trying to objectify my trading style, I quicklyrealized that putting numbers & reasons to everything I did was adaunting task and there wasn't a chance in hell that I could do it byhand. Hence, why I started to consider automating my tradingtechnique. This process was a HUGE "eye opener" for me as I quicklystarted realizing just how darned hard it was to objectify ABSOLUTLEYEVERYTHING that I did (including setup determination, individualposition/stop management, entire portfolio management, etc, etc, etc).I also had to work around all of IB's crappy API and market datalimitations. Everyone on this forum knows what I'm talking aboutthere......It also quickly became apparent that my trading methodologystill sucked. In fact, I completely changed my trading methodologyabout 3 times over the course of the last 2 years, until finallysettling in on something that seemed to work. It was in writing,tweaking and simulation trading my system that enabled me to finallyhone in on a successful methodology. I kept tweaking and working overthe course several months with my Simulation Account until I startedto see a positive expectancy emerge.Once I started seeing positive expectancy for a for months, Istarted trading with real money (only $27,000---very near the $25,000pattern day trading limit). Not much to my surprise, I saw myexpectancy drop when I went to real money, but it still remainedpositive. Moving from a simulation account to a real money account isjust a different beast--all together. Strangely enough, the thingthat has hurt me the most has been psychology (and commissions). Slippage hasn't really hurt me very much moving to a real moneyaccount (at least not yet at this small account level). Commissionshas hurt me, because I simulation traded with a $100,000 account andas such, the commissions were less of a percentage hit per trade. Many of my trades are "odd lot" trades below 100 shares.As far as psychology is concerned, I find myself thinking that Iknow better at various parts of the day and I prematurely close outpositions. I've also had several instances where I've introduced a"money loosing" bug the night before or have changed stuff thatadversely affects my expectancy and I don't find out what it was untila week or so later. I now document (in a journal) every single changethat I make to my system and I back up my code base every night, incase I need to revert. I also document how the system did that dayand various problems or fixes that I need to work on in the near future.My system trades only stocks and I've been running it now (withreal money) for only 3 months. It's placed 1,330 trades (822 long and508 short). It's going to make IB rich with commissions. I've paidthem $2,938.93 in three months and I've only made $3,165 (11.7% inthree months) and my overall expectancy is only .08. Because I'm aday-trader and I sometimes can carry up to 40 positions on a givenday, my risk size is very, very small. I keep it to a max of .135% ofequity on every trade (or approximately $40 bucks per trade rightnow). I'm a bit bummed about my expectancy, but I've tweaked andhoned just about everything during these 3 months and as such, Ibelieve things are going much better now than they did in the beginning.As far as back-testing, I don't actually have a piece of softwarethat backtests my strategy yet. I've written back test software forprevious END-OF-DAY strategies, but not for my current intra-daystrategy. I'm actually collecting all of the data that I need tobacktest. It's just a matter of finishing my backtesting software. Just collecting the darned data was a pain in the rear, because mysystem uses 5 second bars and tick data to make its decisions and itmay look at anywhere from 500 to 1,000 stocks per day. So, justwriting decent software to collect and store this volume of data was abeast. I only collect 5 second bars on TRADES, BIDs and ASKs. Idon't actually grab the tick data from anywhere like opentick.com forbacktesting.As far as a suitable result, I'm not really sure. Perhapssomeone else can chime in on this. I think 11.7% in three months (inthis shitty stock market and with this small account size) is prettydarned good. Going forward, I think I'll do much better than this,now that I've perfected just about everything that I can perfect. Ican't wait for a nice bull market, as my system seems to do betterwhen the market mood is positive and not negative. I also plan ondumping more money into this after another 3 months of positiveresults and once I break through my previous equity high of +17%. Jason
Post 3
I dream of indicators, non-standard correlation, and edge detection.I love indicators.Take the CCI, smooth it with an SMA and then take a KAMA of that. Whenthis KAMA pivots (reverses) beyond a CCI threshold of 30-50, look forprice confirmation (shorter time frame [15 min] price reversal), thenenter three positions, 1 at market, 1 at limit +- 10% of 5 period ATRand 1 at limit +- 20% 5 period ATR. If you don't get hit on the limitswithin 3 periods, close them. Close positions scaled out after certain%'s. Leave one in until a trailing stop knocks it out. Run this on 45minute data, and 90 minute data.To me it's indicators that drive strategy development. If I canenvision new indicators, or recombinant indicators, like thatdescribed above, I can build up a version of the strategy and see howthe price action and indicator action play out. If it looks promisingI keep it around as a potential rule. I've got dozens and dozens ofthem, all dreamed up and waiting for me to code them up.But as rwk mentioned - I dream and build them mostly forentertainment; confirmation that I can see a market pattern and buildan indicator to trap it.Backtesting strategies is first and foremost for me. It's how I canconfirm an indicator is doing its job. I trade FX only and data is nota problem, unless I want 10 years of 5 minute data...Matching strategies/indicators up with instruments is important I'vefound. A curr pair that doesn't behave well with strategy A may workjust fine in strategy B. EURCAD/USDCAD for some reason - just don't dowell for me. Just like metals and softs don't behave in a similar wayto make you think you could trade them with the same strategy. Sostrategy/indicator : instrument pairing is one way I like tocustomize.Non-standard correlation is something I came up with that allows me tocompare say gold with a home built AUD index. Or lumber and copper andthe home builders. Dump them all into a single chart and see if youcan get leading/trailing correlation events out of them. Of course thetrouble is decoupling price so that they can all fit in the samechart...Then there's edge detection. This is a popular concept but one youshould test for. It allows you to separate your entries from yourexits and position and risk management. Testing for strategy edgeallows you to understand that your personal trading edge may notstrategy based but perhaps money mgmt based or risk aversion based. Doyou make money because your strategy picks excellent entries? Orbecause you've got a great exit technique? For instance you could waitfor a certain volatility level to be reached and then you could entera spread position (long AND short). Use a chandelier exit for both.One will get closed out pretty quick but the other will tend to run awhile - hopefully long enough to clear your commish and make you some$. It's all in your exit. But you should know what type edge you haveso you don't screw it up and try switching it or changing it.To me the shear breadth of potential with regards to all the marketsand trade lengths and trading styles and just so much data to be mined- all of this boils down to endless possibilities, of which I spendmost nights dreaming about. Yeah, I know, I'm an odd duck. MM
Thursday, June 12, 2008
How's your autotrading system?
Here are the questions
1. Is your system fully automated or partially automated
2. If fully automated, how often do you check on your system?
3. If partially automated, what component is partially automated?
4. How many different strategies are in use at any one time
5. How long have you been auto trading for?
6. In your opinion, is your system complicated or based on simple techniques?
9. Is your system(s) consistently profitable?
10. A few brief words on the strategies utilized (without giving away any secrets of course)
11. Other than actual buy/sell signals and formulating a winning system, what were two of the toughest problems you faced while trying to implement auto trading?
If your interested in participating, email me your comments, my contact information is at the top of the blog under "What this Blog is all about". Alternatively, you could just as easily post a comment.
Wednesday, June 4, 2008
New Links
I have updated the links on the left side of the blog with some sites and tools I use often. One link to check out is the news calendar. There are four video's by the Knight that I have posted below to show you how to trade the news after the initial pop. This is less risky than trying to guess the direction of the pop or chasing the intitial spike. Try it on your demo account first, but remember, demo accounts do not mirror actual fills you would get in the real world.
Delayed Entry
Using Fibs to enter
Multiple Targets
Re-Tests: Resistance Becomes Support
Thursday, May 15, 2008
Scan - for May16, 2008
Trades
Here are two trades I'm in right now. These both appeared on the recent scans I posted. On the charts, green is a long entry, black lines are stops and targets.
Stops and targets are changed daily, these are the entries yesterday. Tonight I will adjust the stops and targets based on intraday charts.
The good, the bad, and the ugly will be updated once I exit the trade.
RIG
The good: Profit. 1% risk, followed entry rules, placed stop. The stop moved up the day after the trade to above break even. In the trade 3 days.
The bad: Profits taken too soon, but this was the plan. I haven't completed setting up my entire trade plan, specifically the exits. I have three target ideas - use MA's with a coefficient, use ATR, use a target that is only in reach in case of a huge gap up (unlikely), use resistance levels (could be far in the past, so perhaps too weak to worry about?) , don't use a target, only a trailing stop.
The ugly: Good lookin' trade, considering "the bad"
LLTC
The good: Still in the trade, moved stop to break even.
The bad:
The ugly: