Thursday, April 20, 2017

Stochastic Systems Analysis

Engineers will recognize that this post is about stock trading, others may wonder what is a stochastic system.

Market price data is a time series of mostly random data, a stochastic system.  So a Day Trader is a Stochastic Systems Analyst - now doesn't that sound fancy!

Investopedia Simulator
 
The one thing I learned over the years is that if you want to make money from trading stocks or futures, then you need to have a simple and well defined system, with easy to calculate entry and exit criteria, otherwise you will eventually lose your shirt.

As the late Douglas Adams, the famous galactic economist of Bistromatics fame said:   
When it is infinitely improbable that something will ever happen, 
it will happen almost immediately.

Price data is mostly random.  In retrospect it seems to follow a trend and engineers and computer programmers get duped into thinking that they can easily devise a system to do automated trading based on historical and real-time data, with some Digital Signal Processing applied to detect a signal in the noise.  I tried it too decades ago, but downloading price data and adjusting for stock splits and companies changing names and ticker symbols, is a huge problem and if you then devise an automated trading system it may work for a while, but eventually it will diverge and you can lose your shirt.   

An automated trading system requires constant work, which defeats the original idea!

Mutual Funds / Exchange Traded Funds / Hedge Funds

The only people that make money from mutual funds are the people that manage the mutual funds.  In Canada, they make money twice - when you buy and when you sell - a total rip-off.   

So instead of investing in a mutual fund of a bank, rather buy the stock of the bank, pocket the dividends and stop complaining about how they rip people off.
 
The exception is when you live some place without proper internet access, or if you are too old and demented to do a proper job yourself.  In that case maybe, investing in Exchange Traded Funds (ETFs) may be a good idea.

Long Plays

One problem is that any trade also influences the market - it is a feedback loop.  One can get price volatility with a purchase of only a few hundred shares in a blue chip company, if nobody is selling at that nanosecond instant.  Now imagine trying to manage a pension fund and buying and selling tens of thousands of shares.  This is why there is always room for the little guy - us.

To build real wealth, you need to be in the market for the long haul - decades.  The pension funds periodically 'balance their portfolios' - usually in March and October and that can cause wild volatility and crashes.  So a good long strategy is to Buy in March and Sell in September, then buy in November and sell in February.  If you are in cash, then you can buy the crash.  If it doesn't crash, just buy it all back again a month later. 
 
An Apple a day, keeps the doctor away:
The best financial site is still http://finance.yahoo.com

For example, when I bought four blue chip stocks in my RRSP  (my buy in March entry), within a few minutes I lost $200 - bah, humbug.  If you trade long, don't look at the real-time graphs too much! 

To control the risk, buy at least 5 stocks for your RRSP and set stop loss orders 5% to 7% down - but you need to keep resetting them, since they expire after a few days/weeks.  If you use OCO orders effectively, then you can run your own mutual fund - periodically check and adjust your orders and keep the management fees.
 
Note that when the market is unstable, a stop loss order may trigger for no apparent reason.  This is likely due to the prevalence of high frequency trading. The problem is that your loss is someone else's scammy bargain bin.  So I quit using stop loss orders, since most of my losses were caused by stop loss orders.

Day Trading

Day trading is for making a little money to live on now.  Investing is to make a lot of money to retire on in 30 years.  It requires different strategies.

Day trading is also a nice mental exercise to keep your brain from atrophying while you wait for the  market grass to grow.

There are few millionaire day traders.  There are however many people who sell books and training courses on day trading.  Selling books and training courses is clearly more profitable and less risky!

You have to read two or three books (No more than three. Stop and practise instead), to learn the lingo and methods, just don't believe in it as the one true gospel - try to find the idea behind it https://www.rockwelltrading.com/

Bear in mind that if someone sounds like a second hand car salesman selling a lemon, he probably is.  Motley Fool is an example of a group that buys penny stocks, then hype them furiously to get others to buy into their scheme.  It creates an artificial market price bump, which they and a few followers can then profit off.   There are several other groups that do the same pump and dump thing.  This is not for me.

Day trading is limited by what a human being can manage.  People can juggle 3 to 11 complicated things at the same time in their head.  The result is that a futures trading system is best limited to a pot of $5000 to $15000 and trades limited to 1 to 5 per day.

As Lazarus Long, the famous American futurologist said:  
The odds are terrible, but if you don't play, you can't win.

If you trade with E-mini futures, buy and sell one or two contracts at a time, then you could make $50 to $200 a day.  Buy a contract and sell when it is up by 8 ticks or down by 3 ticks.  On average you should win some - not much, but enough to pay the bills.  If you don't know what you are doing yet, you can loose $50 to $200 a day - so you have to practise in a simulator.

The methods are the same for day trading stocks, but you would need a bigger pot of money - about $25,000 to play with - https://www.sec.gov/investor/alerts/daytrading.pdf.  
 
You can also improve your yield by buying more stocks than you have cash on hand - by buying on margin - borrowing from your brokerage.  Interactive Brokers offer margin rates of less than 2%, so if you can make only 5%, then you are good. Of course, your risk is then also higher, so I don't recommend using margin for day trading, unless you like gambling your money away.

In general, don't day trade with more than 1% of your pot of money to keep the risk down and test your system in a simulator for a week or two before turning loose on live trades.  If you only make one trade a day, then two weeks of practise is only 10 dummy trades - precious little.  If you cannot make money in a simulator, then real live trading will be even worse and you will join the crowd of suckers at the bottom of the heap.
 
Never buy a stock that you would not want to keep.
 
Even when day trading, it is prudent to only play with stocks that are worth keeping for the long haul.  The simple reason being that if a trade goes wrong, or the bottom suddenly falls out of the market, then you may be stuck with that stock for a few months, or a year.  So I mostly play with stocks that also pay dividends - when I get stuck with it, I can always wait for the dividend.

If you are good, then you should invest half your monthly profit for the long haul in blue chips, like that nice fruit company mentioned above...

Trading Software

Trading software programs now are a dime a dozen - there is no need to write your own anymore.  Ninjatrader is popular for futures trading, but your own bank probably has a system that is good enough - a fancy expensive program will not magically make you a better trader if you only do one trade per day.

TD Bank for example has four trading systems that I know of, the default Webbroker https://webbroker.td.com system, a more advanced Java based Advanced Dashboard program that you can download from the Webbroker site, which provides real-time data and also ThinkOrSwim and the related TD Ameritrade - https://www.tdameritrade.com/tools-and-platforms.page

Note however that the TD Bank Advanced Dashboard only works properly in North America.  In my experience it doesn't work in the Middle East and it doesn't work in Central Europe and probably doesn't work in many other places too (it just sits there and shows some useless error messages when you click on a stock ticker) and they will happily charge your account a usage fee for your frustrations too.
 
TD Bank Web Broker works anywhere, but for Mutual Funds specifically, you cannot set smart orders like One Cancels Other, or even a simple Stop Loss order - any order executes immediately.   So if you use the TD Bank trading system and you own Mutual Funds, then you practically cannot go on a remote outback holiday - you can lose your shirt while you are away.   
 
For stocks and ETFs though, you can use automated trades (Click on Buy or Sell, Strategies), so this could be another reason not to buy Mutual Funds.  My typical daily play is to set a FTO First trigger Limit at 0.5% below close, Sell Limit at 2% above buy.  Then I close my eyes, cross my fingers and wait.  Other times when I feel more pessimistic, I Buy Limit at 1.5% below close and Sell Limit at 1.5% above buy. When I am very pessimistic, I Buy at 0.75% down and Sell at 1% up.  By only taking a small nibble, it usually works.
 
The lowest cost reputable international broker that I know of, is Interactive Brokers.  If you do more than one trade per day of a few hundred stocks/futures, then they may be the best, but figuring out exactly how much it will cost you is difficult, since they have a complex pricing schedule - https://www.interactivebrokers.com/
 
Interactive Brokers do work all over the world, so it is one of the best if you travel around, but bear in mind that their Phone Hell Desk is pretty slow / nonexistent, so I won't entrust them with a large amount of money.

Depending on how much you trade and how much you have in your account, a trading platform will cost about $60 per month.  So the cost is not ridiculous if you are dedicated to trading and not just doing it for fun.  However, a Pro Trading Platform needs a very good internet connection to work.  Also write down the help phone number of your trading system, so that you can call them when you have a computer or network problem and cancel your trades.   
 
For me, the Web based application of TD bank is good enough and it works (almost) anywhere in the world.  It works, since I don't trade real time - I set up an OCO trade before the market opens and then I let it play out.

Historical Analysis vs Reality

If you find an elevator stock that goes up and down, but stays the same on average, then you can trade it and make money every few hours, or days simply by sitting and staring at the real-time price graph, but eventually something will change.  There will be a war, a plane crash, a court case, a dishonest CFO, a SARS-COV2 lock down... and you may loose your shirt.

It is therefore important to use simple statistics and automated orders to control the risks and identify opportunities, but you should steer clear from very complex systems, since finely tuned systems will only work in the short term 
 
A One Cancels Other Order, is a good way to lock in profits and protect against disaster: 
  • Set the Sell Limit at 20% above the buy price
  • Set the Sell Stop Loss at 5% below the buy price
  • Set the duration of the order to Good Till Cancelled 
  • Now, you can go on holiday!
Note that by the time that you buy the book of a successful trader, he is already retired and canoeing in the Caribbean and his lucky streak has long since ended.  So whatever you do, always bracket your holdings with an OCO order to protect yourself.  Don't think that what you read in a book (or in this article!) will always work.

You can learn from the past, but the past will never be repeated exactly the same way.

Simple Statistical Analysis

The Greek philosopher Democritus said that a thing is worth whatever someone is prepared to pay for it and the stock market to me resembles a pack of lemmings running over a cliff, with traders trying to outbid each other before the inevitable market crash, which happens on average every 4 years - but you don't know which year it will be.

The first book I read on stock trading was clearly written by a trader who was just lucky (or had inside information).  He made an enormous amount of money with Eli Lily when they invented the anti-baby pills.  His 'head and shoulders system' was impossible to recreate and everything worked only in retrospect, not with real data.  Successful plays almost always resemble a 'head and shoulders' graph - after the fact.   It is very easy to predict that you should have bought a stock last week.

Much later, I encountered a book by Burton Malkiel,  'A random walk down Wall Street', which rigorously proved with Montecarlo analysis that most hedge and mutual fund traders were just lucky and will blow up eventually.  It is a very dispiriting book, but it proves that one cannot predict the market by looking at price data only - you need to have inside information also.  Ordinary mortals don't have inside information, but big traders and institutions do (the managers sit on multiple company boards and are all golf buddies) and they are the ones leading the pack of lemmings and since they own the trading desks, they also know exactly what the little lemmings (you) are doing.

The front running big lemmings will never admit to randomness explaining their strings of successful trades, since that will make them look dumb and they will not admit to having inside information, since that is supposed to be illegal.

Successful trading systems for small time investors invariably boil down to a price moving average and a standard deviation calculation, plus a volume indicator.  A Bollinger band https://www.bollingerbands.com/ is very good to see what the price is doing, while a trading volume indicator (there are many), can identify what the other lemmings are doing and the trick then, is to run with the pack just a little bit and stop, before they fall off the cliff.

The Lemming Effect

Successful trading strategies look not only at price, but also at volume and track price volatility to get a handle on the Lemming Effect.  The big lemmings out in front of the market are the institutional investors with inside information who run our pension funds - successful small trading systems calculate how to follow the fat lemmings for a little while.

Bulls make money, and bears make money, but pigs get slaughtered.

When the market is stable (going sideways) or going up (bullish), then you can buy low and sell high and make money, a little bit at a time.

However, when the market is stable or going down (bearish), then you could reverse things to (short) sell high and buy low.  It is exactly the same operation, just reversed in time - but more risky, since the stock can go up rapidly.  I cannot recommend short selling - selling something you don't own is illegal everywhere, except in the stock market.

As Shane, the famous American cowboy said: If god didn't have a sense of humour, then he would be a very lonely man.

Here is a good write-up on Bollinger Band trading - https://www.forbes.com/2007/05/11/bollinger-intel-yahoo-pf-education-in_jd_0511chartroom_inl.html

So how do you know when to buy long, or sell short?  Look at the long term trend - where are the lead lemmings going.  Is the market going up, or going down and if you get a losing streak of five dud trades - reverse what you are doing - don't fight the market - flip your strategy around - ping-pong - http://www.traderslog.com/ping-pong-trading-making-money-in-sideways-markets

Practise Makes Perfect

It all sounds easy until you try to place a trade, then you wonder what amount to enter at the buy limit, what is the ADR and the profit target and what to enter in the stop loss and would the profit be big enough to cover the trading fees - and by the time you figured it all out, the opportunity has passed.  

Therefore you have to make a spread sheet or prepare a programmable calculator with your formulas before the market opens, so that you can enter and place a trade quickly.  You need to keep a spread sheet of your trades anyway, since come tax time, you will need it.

How do you find a stock to day trade?  Well, that is the boring part.  Here are some clues:
  • Daily volume between 500K->25M shares
  • Stock price $25 to $100
  • Range between hi & low to be > 50c
  • Look for a small gain of $100 to $200 day on $10,000 risked.
There are not all that many.  You could play with Bank of America (The one that Warren Buffet made his fortune on) in a simulator to get started, but even a bank (BMO.TO), an oil company (IMO.TO) or a motor car spares manufacturer (MG.TO) can work.  Take small nibbles to avoid losing your shirt: Buy at 1% down, Sell at 1% up usually works for a small day trade.
 
Note that if you try to make a trade of 500 shares, it may not execute, since there may not be batches of 500 shares available and the opportunity may blow right by your carefully set play.  So that is another reason to take smaller nibbles. A trade with 300 shares should work.
 
If you are conservative and have $10 to $15 thousand to play with, then you can make $1000 to $2000 a month this way.  It is a nice hobby that only takes a few minutes per day and is more than many simple people make in a regular job.

Keep it simple https://www.rockwelltrading.com/tw/book-simple-trading-strategy/, and practice in a simulator http://www.investopedia.com/simulator/ or http://www.infinityfutures.com/ for a few weeks before you risk real hard earned moolah.

OCO and FOCO Orders

In my experience, the most important thing is the One Cancels Other order, which I mentioned above, but which should be mentioned over and over.  An OCO is a two legged order, only one leg of which will execute - the other will be cancelled.  In TD Webbroker, click Sell, Strategies to do multi leg orders.
 
One cannot normally enter two orders on a single holding - the broker software will not allow you to do that.  An OCO provides a pair of linked orders to actually do exactly that, for example:
  • Set the Sell Limit at 2% above the buy price
  • Set the Sell Stop Loss at 5% below the buy price
  • Set the duration of the order to Good Till Cancelled 
  • (Check it every day, since it can get cancelled!)
With a properly set OCO order, you can make some pocket change on almost any stock.
 
A Limit order will almost always execute at the exact price you set.  Once in a blue moon, it will blow past the limit and then you will buy at a lower price, or sell at a higher price.  I have on occasion made $400 from a carefully crafted small $100 trade strategy, but that is just luck (and someone else's pain I suppose).
 
There is also a three legged trade strategy variant, which you can use to set up the whole buy and take profit (or stop loss) in one go before the market opens.  It is called a First Triggers One Cancels Other order. The First leg is used to buy the stock, then the other two legs do the profit/loss taking and the neat thing is that you can enter it all at once and then go and get another coffee.
 
If you carefully calculate and enter a First Triggers One Cancels Other order and it immediately crashes out, causing you to lose 5% - don't be annoyed - get a cup of hot chocolate instead and find a better stock.
 
In my experience, I lost more money because of Stop Loss orders, than from bad trades.  So I eventually stopped using Stop Loss orders and just play a bit more conservatively.  The problem being that one man's Stop Loss, is another's Bargain Bin and I found that I gave too many bargains away.


Short Selling Scams
Bear in mind that the stock markets are not free markets.  They are rigged in favour of the big institutions, which literally own the markets.  
 
When trading volatile stocks, you may once in a while get done in by your broker, or exchange stopping trades, or forcing your orders to execute at levels far from what you set, causing you to lose money on the trade.  Therefore, keep your day trades small, so that you can trade again.

Short Selling is when a trader sells a stock he doesn’t own at a high price and buys it later at a lower price.  The short seller is supposed to borrow these stocks from somebody else for the duration, but they have a 4 day loophole.

Some hedge funds are colluding on this and selling much more stock (140% in the case of Gamestop) of a small company than actually exists, causing the price to drop, since they flood the market with nonexistent paper. Then they buy everything  available at a low price and take control of the company, before the SEC can clue in and stop them.  Since they then control the company and can blame the previous management, their scams may never come to light.  It is a lucrative example of a 'legal scam'.  The exchange regulations actually allow this unethical behaviour.

A few people clued in to the short scams and started to buy some of these shorted stocks, causing the prices to go back up. Once the scams came to light, the hedge funds had to buy stock to cover their shorts at much inflated prices, costing them billions.

https://www.foxnews.com/media/rush-limbaugh-gamestop-story-mirrors-politics-elites-attempt-regular-people-benefiting
 
I was not aware of all this going on in the US - thought it was only Gamestop and lost a few thousand on a trade of Canadian Blackberry stock, when TD Waterhouse kicked my connection off and forced the transaction to stop at a very different price than I had set.  So instead of making a modest couple hundred dollars on my day trade, I lost about 3 thousand.  In retaliation, I bought Bank of Montreal stock and will close my accounts with TD later in the year.  There isn't anything else one can do, since they control the markets.  Changing banks, merely amounts to a symbolic gesture of protest, that they really should not treat their small customers this way.  Caveat emptor.


Dividend Harvesting
You do not need to own a stock for the whole year, to receive the dividend.  The dividend is paid out to the registered owner of a stock on a specific day, the Ex-Dividend date.  For Imperial Oil, this is 28 February.  So if you buy IMO on 27 Feb and sell it on 29 Feb, then you will later receive the dividend of about 3.4%.  Since many people are doing exactly this, the price will tend to bump up around 28 Feb, so you should buy it maybe two weeks before and since the price will dip after, it may erase your dividend gain.  Caveat Emptor again.


FOREX Trading
An alternative to stock trading is foreign exchange trading.  Depending on where you live and which countries you have citizenship of, you may be able to open bank accounts in multiple currencies, for example CAD and Euro.  The exchange rate between major currencies drifts slowly up and down by one or two percent and mostly goes nowhere.  So you can make money, by simply shifting funds between your own accounts, every week or three.  
 
This is low risk, since the money is always in your own accounts and provided that these are reputable countries, then you will never lose your capital.  If you miss an up/down cycle, simply wait a week or two for the next cycle.  
 
For this to work, you need a pot of money about equal to the value of a fancy car, which is a good reason not to waste money on a fancy car - keep your clunker and make some money first - then buy the nice car with cash.
 
There are many scammy Forex Exchange Trading Desks, but you don't need them, if you simply transfer money back and forth between your own accounts.  It is just between you and your bank (and the taxman).

It is a very unexciting and steady way to trade, unless you get a lucky break like Soros did, years ago.
 
You could buy a small apartment, rent it out and make 2 to 3 percent per year, or you can use the money to trade and make 2 to 3% per month, which is rather better.

Same as with stock trading, forex capital gains are taxable in most countries.
 
 

Words of Wisdom

Don't buy stock that you would not want to own long term.  There are lots of stocks, you only need to identify 3 or 4 good ones.  If you day trade with AAPL and the trade goes haywire, then you own some more Apple stock.  Nobody will lose any sleep over that.
 
Don't day trade with stock in a different currency.  The exchange rate can fluctuate and cause a profitable trade to become a loss.

Keep day trade profit margins small at 1% to 2%.  Bulls make money, bears make money, but pigs get slaughtered.

Don't buy any stock with a price below $25.  Trading in penny stocks is random gambling.  No amount of analysis will help you with penny stocks, they are just smoke and mirrors.

Buy in March and Sell in September.  This age old rule works in the northern hemisphere with Blue Chip stocks.  It is due to the agricultural growth cycle and the pension funds who rebalance their holdings in February and October.  During those two months, you should be mostly in cash, so you can Buy the Crash.

Taxi Drivers and Hair Dressers

There may be exceptions to this rule, but when your taxi driver, or hair dresser, starts to talk about making money in stocks, then the market is far over extended and due for a serious crash:  
Tighten up your Stop Loss Orders, or better, Sell everything and go on a long holiday.
 
 
La voila!

Herman




No comments:

Post a Comment

On topic comments are welcome. Junk will be deleted.