Sunday, June 14, 2020

Risk management lessons from negative oil price fiasco in Apr 2020

When people who care about me know I invest/trade in financial markets, the natural question they will ask next is whether I can make good money from the markets. I tell them I am not sure if I can make good money but I am at least confident I won't lose big money. I feel more confident in my risk management than money-making ability because risk management is a more controllable process.

The 20Apr2020 negative oil price fiasco has shaken my confidence in my risk management even though I was not personally affected by it. I do not touch oil futures or whatever stuff which I am not confident of having an edge. I am lucky to have lost enough in the past to learn that lesson.

 I have 3 basic rules for risk management;
  • diversification
  • keep each position size small
  • cut losses quick (for trading positions) 
These rules failed to protect a person from blowing up his account even if he is conservative and is disciplined with taking risks had he bought oil on 20Apr2020.

On that fateful day 20Apr2020, May WTI oil futures fluctuated between USD18 and -USD40, settling at -USD37.63. Suppose a retail trader bought at $0.50 that day and the notional value of his oil position amounted to only a small 3% of his portfolio. If oil had dropped to zero and stopped there, he would have lost 3% of his portfolio at most. However, oil settled at -USD37.63 and that would result in a loss of 225.78% of his portfolio value just from that single small 3% position alone.

This should not be so disastrous if the trader had been able to cut his losses quick. Unfortunately, several retail traders were not able to because their broker's software was confused by negative price and could not take in new orders to cut off the losing position. This happened to customers of Interactive Brokers (IBKR).
At midnight, Shah got the devastating news: he owed Interactive Brokers $9 million. He’d started the day with $77,000 in his account.
Fortunately, IBKR will compensate the losses incurred by customers who were locked in with a long position during the time the price was negative.

I have always thought my risk management rules will keep me safe as long as I remain disciplined but this false sense of safety could have led me and my family to disaster if I had taken even a small oil position that day.

Here are some lessons I draw from this black-swan event;

  • Avoid open-ended risks as much as possible. 
    Open-ended risks mean losses can go beyond 100% of principal. Oil futures has the possibility of negative price, so even going long has become an open-ended risk. Furthermore, futures have built-in leverage.
  • Use futures for hedging, not speculation unless one has an edge.
    Futures were invented for hedging purposes, not speculation. Retail traders really have no business trading in oil unless they have an edge.
    If experienced oil traders like Hin Leong have blown up, what chance do retail investors have of success?

    A wise investor advised not to trade in commodities unless one is a user of the products. Oil futures are more relevant for genuine users of oil like refiners who need to hedge the cost of crude oil. 
  • Invest/trade/speculate only when one is confident of having an edge
    If I did not follow this rule and made an oil trade on that fateful day
    20Apr2020, I would have suffered many sleepless nights until the day IBKR announced they will make their customers whole for the losses incurred for negative price.
  • Stick to financially strong brokers
    IBKR agreed to make good the clients' losses since it was IBKR platform's fault for not letting clients cut their losses when prices went negative. IBKR can easily afford to make the compensation because it is financially strong. It takes money to be ethical and do the right thing for the long-term good of the business. 
    I have been a happy customer of IBKR for several years and am one of the admins for a Telegram group set up by voluntary IBKR customers to support Singaporean IBKR customers. Having said that, it is not safe to put too much of your eggs into one basket. It is safer to use a few brokers for diversification even if it results in higher cost.

Friday, May 15, 2020

Code to download intra-day price quotes using Interactive Brokers API into csv files

Some time ago, I was searching the internet for data download of intra-day price quotes of futures contracts and forex.

The best I found was from Interactive Brokers(IBKR) which provided an API for programmers to download the quotes. This is applicable only for IBKR customers who need to write their own code to download the quotes. Not all data is free. Futures, stocks data require paid market data subscription. Forex and index CFDs are free.

I have written python code to download intra-day hourly price quotes of continuous futures contracts, CFDs and forex from Interactive Brokers API as csv files which are convenient for analytics purposes. The csv files can then be uploaded onto charting software like Amibroker which I use personally.

The code has been uploaded onto github.

It should be useful to Interactive Brokers customers who have a programming background. The code can serve as a base for further modifications. It will be difficult for those who have no programming experience.

If someone knows of better alternatives to this data source, please drop a comment on this blog post or drop a message to me at Telegram user hyom448. Thank you.

PS: Regarding leveraged financial instruments such as futures, CFDs, forex, please avoid if you are inexperienced and do have not much interest in financial markets. Better stick to plain vanilla stocks/bonds or better still, stock/bond index ETFs which are non-leveraged, diversified by nature. 

I personally will steer clear of leveraged instruments unless I am confident of having an edge protected by risk management rules.

Sunday, March 22, 2020

Covid-19 market selloff: It's ok to "panic". It's key to survival

Many retail investors have been caught up in the panic selling caused by the Covid-19 virus scare. REITs and local banks are popular among retirees and FF(financial freedom) seekers for their dividends. Several REITs fell 50% within the last 20 days. Naturally, many retail investors will panic sell at recent lows. Last Friday (20Mar2021), some REITs made monstrous gains as much as 20% intraday. Those who panic-sold at recent lows may be having a miserable weekend regretting their bad sell.

During panicky time like now, here are some standard investment advice you hear;
- Our worst enemies are ourselves because of our emotions
- Fear and greed drives humans to buy at the highs and and sell at the lows.
- Panic is bad.
- Be cool as a cucumber. Don't lose your head while others lose theirs.

I can't argue against these standard investment advice. They are standard because they are mostly right but in investment, there is no absolute right. It's not a STEM topic. Based on personal experience, it's ok to "panic". It's why I'm still surviving in the financial markets. The key is to panic early with a sense of proportion. Easy to say, not so easy to execute, though.

My personal favourite proprietary market timing indicator on when to get out as the market gets jittery is the lao-sai(diarrhea) indicator. When I start to shit too many times a day because of a bloody market, I sell and cut my risk exposure to the point when I can resume my normal shitting of once per day. George Soros has similar timing indicator. He gets backache while I shit more often. My shitting has served me well and is key to my survival in the financial markets. If your portfolio is affecting your body and mind, then sell to the point until the risk exposure no longer affects your body and mind.

Some people would say this is proprietary and cannot be copied. I would argue that fear is a basic instinct of human beings. Nature has blessed all of us with this basic fear instinct which is key to survival of the human race. You don't have to copy. It's in all of us. Don't try to suppress your fear by pretending to be a cool cucumber. Use the Force!

Having said that, do try to sell with a sense of proportion. Don't sell until the baby is thrown out with the bathwater. I can't go into specifics here. I don't like to write articles as if I sound like a guru. Frankly speaking, I don't know what the market is going to do tomorrow or which stocks are going to make money with a high level of certainty. When I get fearful, I don't read other people's articles/opinion pieces for assurance. Often, these financial articles are biased. If the writer has a huge position on, he will be bullish and talk up his stocks. If the writer just sold off his position, he will be bearish and talk down stocks. The bias can be subconscious with no ill intention if the writer is not paid. Now, if the writer is paid, I won't say he has ill intention but he has got to do whatever he is paid to do. The paid financial analyst/salesman can wax lyrical on whatever stance he is paid to promote.  In investment, you can always find data to support whatever stance you want to make. If you don't know about the topic, you are a sheep waiting to be fleeced.

So, don't rely on others, especially when it comes to money matters, because there's a lot of hidden agenda. Better rely on yourself. Nobody knows your own unique situation better than yourself.

If I were still an amateur with no systematic process to deal with an unprecedented market sell-off, then what I will do is to get in tune with my own body signals. For example, my lao-sai indicator. Be myself and listen to myself, not others. Use the Force, Luke. It's in all of us.

If you happen to be one of those who panic-sold and the stock you sold one day ago shockingly rise 20% the next day, don't feel bad. I think you did the right thing to survive. If you stay put or even double-down and the stock subsequently crashes another 50%, rest in peace. Nobody knows for sure how the stock will turn out but I would rather be the person who fights and runs away, so that he shall live to fight another day.

In financial markets as in everything else in life, you don't have to win all the time but you damn well have to survive all the time.