Showing posts with label Trading. Show all posts
Showing posts with label Trading. Show all posts

Tuesday, July 23, 2019

Worst Loss on Bitcoin

Just got stopped out for a 7.06% loss on Bitcoin trading. That is the worst loss that the Bitcoin model has suffered so far. So, most losses won't be as bad as that. Back to short...

This position was never in the money. The position was entered on a spike in price, which just triggered the stop. But I exactly followed my approach. 

This is our equity curve (USD) so far in trading Bitcoin futures:


We also had some profits trading Bitcoin CFDs.

Monday, July 22, 2019

New Macro Trade


I've started another long-term macro trade by buying a treasury note futures spread. The spread is short one ten year treasury note futures contract and long two two year treasury futures contracts. You can execute this with one trade using the TUT ticker. The face value of a two year contract is $200,000 and for a ten year contract, $100,000, so actually the trade is long four times as many two year notes as it is short ten year notes. The idea is that this spread will gain value as the yield curve steepens, which following a yield curve inversion, it already seems to be doing. The curve would steepen mainly because the Federal Reserve would cut short term interest rates. So, if they don't cut much the trade will lose. The more they cut the more likely it is to make money.

My other macro trade is gold. Though that is also a bit more like an investment as we plan to allocate to gold in the long term and I am using the IAU ETF for tax and psychological reasons. I've increased my position at this point to 4.89% of assets. The net treasuries position is nominally $302k, which is much bigger than that.

I've also been thinking about how to improve my new day-trading strategy. I think that I will add exit stops to each order I place. This means, for example, if we go long initially in a "headfake"and then the market falls and the sell stop order is triggered, rather than getting out of the market it will initiate a short position. That would have been a profitable trade in the S&P 500 futures on 16th and 19th of July. The resulting short gained more than the stopped out long lost. Also, I am thinking to keep half of the position as a turtle style trend following position rather than an actual daytrade. The difference to the medium term turtle trading is that the stop is moved each day based on action in the first part of the day rather than action over the last few days.

So I now have three time frames of trades. I am hoping that this diversification, while requiring entering more orders, actually results in me being less anxious about the trades and so actually spending less time looking at the market. We will see.

Thursday, July 18, 2019

Systematic Day Trading


I figured out a way to adapt the turtle trading method to systematic day-trading. I plan to apply it to markets which tend to move strongly after the release of US economic news at 8:30am Eastern Time on many days and which have elevated volume when US cash markets are open. The idea is to put buy and sell orders in for these markets at around 8:00am (currently 10pm here in Australia) based on the movement of the futures markets over the day up to that point. If there is a breakout of that range you go long or short automatically. Then you close the positions at the end of the trading day. This is a day trading method where you don't look at the market all day.

I don't have access to historic hourly data at the moment but I have backtested the idea for a couple of months by looking at charts for the NASDAQ 100 futures. It seems that the approach wins more times than it loses, though average wins and losses are about equal in size. Once the market starts moving in a given direction intraday it tends to keep moving in that direction. It looks like it would work well for stocks, bonds, gold, Australian Dollars... It doesn't look like it would work for oil, soybeans etc. These commodities typically expand their trading range in both directions when the market gets more active. As a result trades would tend to get stopped out.

I'll start trading it using the new micro-futures that are a 10th of the size of the e-mini NASDAQ and S&P contracts as well as with CFDs for gold (trading 10 ounces say) and Australian Dollars (starting with AUD 10k) and see how we go.

Monday, July 15, 2019

Trading Bitcoin Futures over the Weekend or Not

Because recently Bitcoin rallied strongly over weekends, I decided to close any Bitcoin futures short position at the end of trading on Friday. That means that this weekend I closed my short on Friday at the worst possible point and missed a more than 1000 points decline over the weekend. However, I've resolved not to get into this trade now and just wait for the next long trade.

Not including this weekend's action the average return over the weekend in the last 15 months when my model was short was -0.2%, i.e. a loss. But this is a small loss and is statistically insignificant. The t-statistic to test that this mean is different to zero is -0.31 (p = 0.74). On the other hand, the average return over the weekend when long was 1.5%. And this return is highly statistically significant. The t-statistic is 2.33 (p = 0.026).

This explains why I was reluctant to be short over the weekend but not to be long over the weekend. On the other hand, the expected loss isn't much, so avoiding trading over the weekend when short is due to risk aversion. Especially as I can place an effective stop in our Plus 500 CFD account. If we go long there and are short futures we are effectively out of the market. But it's expensive to do so due to their spread and overnight financing charges, and they only allow me to trade a maximum of 6 Bitcoin. On the other hand, I am only shorting one futures contract (5 Bitcoin) at a time at the moment.

So, how did this weekend affect these results? The gain to being short over the weekend was 9.5%. The mean weekend short return is now 0.07% with a t-statistic of 0.11 (p = 0.91). So, that is even closer to zero. Someone who is risk averse would still stay out of the market as the expected return is insignificantly different to zero.

To deal with the frustration, I am just telling myself that there will be a better opportunity to go long the further the price falls :) In the longer term, I think I would be less concerned about this if I diversify trading to multiple markets.

Wednesday, June 26, 2019

Adding Individual Stock Trading

My last post looked at my trading profit and loss from futures, ETFs, CFDs etc. But it didn't include individual stocks, which I traded a lot in the early years. So, I went into my data and tried to identify, which individual stocks were trades and which investments. It's not so easy to tell in some cases. However, anything I was generally short was clearly a trade as well as stocks I held for less than a month typically. So, the result is quite rough.

But the picture is clear. Adding individual stocks makes my trading history look much worse up to 2006:


I have now almost recouped all my previous trading losses in the last two years of trading. There are still a few days left to go and anything can happen, but this month is looking to be a record trading gain.

Sunday, June 23, 2019

Trading History


I was wondering how my trading performance looked over the long haul and put together this chart which is cumulative profits from trading futures, ETFs, options etc. Mostly, I haven't included individual company stocks. Up to 2002 I just lost money really. Then from 2006 to 2008 I started systematic trading and had ups and downs and mainly went sideways. But then as the financial crisis deepened things went off a cliff. After that, I didn't trade for a decade until last year. After and initial dip, I made money every month till October last year and then took a break from trading. This year, I came back with a new approach and so far are doing even better. I am now better than breakeven in the long run from trading. I would say that I am optimistic now rather than confident that this can be a long-run source of profits.

Tuesday, June 11, 2019

Only 40 Active Accounts Trading Bitcoin Futures?

According to this article, there are only 40 active accounts trading CME bitcoin futures. I can't read the whole article without paying for an expensive subscription, so I don't know their methodology. I am surprised by this as I have two accounts regularly trading bitcoin futures. I wonder if all accounts at a broker like Interactive Brokers are bundled into a single virtual account?

Sunday, May 19, 2019

Weekend Trading

Bitcoin is again rising over this weekend, so far. I set a stop buy order in my CFD trading account, which allows me to trade Bitcoin 24/7 for 7700 and it has triggered. Bitcoin is around 8000 at the moment. This long position hedges my short futures position. It allows me to have a stop on my position over the weekend when the futures market is closed. I would have been better off and less anxious if instead I had closed the futures position at the close of trading on Saturday morning Australian time. I think that is what I will do in future.

Friday, May 17, 2019

Monday's Move in Bitcoin was a Huge Outlier

The weekend move in Bitcoin extended into Monday's trading and Bitcoin ended up rising 25%. You can see how much of an outlier that was on my daily trading return vs. volatility graph:




Since then, Bitcoin has gone into another consolidation range. This morning it looked like we might get stopped out of the long trade at the open, but the market bounced and we are still long from 5285.

P.S. 12:55pm
We just closed the long position and went short at 7715. Profit on the trade was USD 12.1k Of course, all this was done automatically via stop orders. 20 minutes later the short is up USD 5k. This is crazy price action.


Sunday, May 12, 2019

Bitcoin Going Completely Nuts Over the Weekend

I've noticed that in recent days Bitcoin has gone up starting at around 6pm US Eastern time when all stock markets in the World apart from New Zealand are closed. Of course, this is the afternoon and evening on the US West Coast. So, I figured that it was driven by retail investors in the U.S. Now this weekend, that trend has continued in dramatic fashion:


Bitcoin is up almost $700 on Friday's close. Luckily, I am long Bitcoin futures. It certainly makes me wary of ever being short Bitcoin over the weekend. Bitcoin has now popped up to be my 22nd best investment in dollar terms ever - I've been investing since 1996... Just about to overtake Pendal Property Investments. Anyway, anything could happen by 10am Monday Eastern Australia time when the futures market re-opens...

P.S.
Obvious solution to going short over the weekend is to have an account with a cash Bitcoin exchange that is open over the weekend and buy Bitcoin if the stop loss level is reached. What such exchanges allow stop orders?

P.P.S.
Bitcoin now up $1000 since Friday. If this persists till Monday it will be the biggest daily move in percentage terms in my dataset, possibly since the futures market open at the end of 2017. Plus 500 allows CFD trading 24/7. There are huge buy-sell spreads, so this would only be used as insurance. You can place conditional orders, such as buy only when the price reaches a certain level.

P.P.P.S.
I tried the demo platforms at Plus500 and eToro. eToro appears to be very limited and geared to novice traders. There were strong restrictions on the levels of orders that could be placed. So, Plus 500 seems to be the only real option that offers Bitcoin CFD trading 24/7.

Wednesday, May 08, 2019

More Asymmetry

A couple of days ago I posted about the asymmetry of market returns capture by the target portfolio. The portfolio captured less than 100% of the upside in the markets but almost none of the downside. The chart below, inspired by a recent paper from AQR, shows the Bitcoin trading model's daily returns compared to the absolute percentage change in the price of Bitcoin futures for that day:


The rising diagonal line are all the days when the model was properly aligned with market direction. The descending diagonal line are all the days where it was incorrectly aligned with market direction. The remaining cloud of points is where the model changed direction. Some of those days were winners and some very bad losers when the model ended up incorrectly with the market in both directions that day. For example, it was stopped out of a long position and entered a short and then the market rose for the rest of the day...

The fitted quadratic curve shows that for low absolute price changes up or down in the price of Bitcoin, the model tends to lose money. This is because of "whipsaw". There is a strong asymmetry in the response for large moves and so the fitted curve shows that the model captures increasingly more of the return the larger the move.

The results do conform to AQR's argument that returns to trend-following have been poor recently because markets haven't been moving enough.

Tuesday, May 07, 2019

Varying Position Size Still Doesn't Make Sense

Last year, I posted that increasing trading position size when volatility is lower didn't make sense for my trading system. When the volatility was low trades tended to lose more and win less. So, trading bigger because risk was supposedly lower didn't pay off.

Now I am using a more traditional trading system that wins by letting winners run and cutting losses short, without pretending to predict the direction of the market. Here, I have found that there is no correlation between the profit from trades and the maximum loss possible given the initial stop loss:


The chart shows all the trades in Bitcoin futures my system would have made in the last year The x-axis shows the maximum loss on the trade of one contract (assuming we can exit at the stop loss, i.e. no Black Swans). The y-axis shows the profit for the trade. There is a slightly positive correlation, though it is not statistically significant. On the other hand, you can see that realized losses do increase with increased initial risk. The system won 46% of the time with the average win 4.1 times bigger than the average loss. The average trade lasted 5 days.

If you adjust position size so that the initial risk of each trade is the same, returns do increase, but so does the maximum drawdown. If you scale back the average size of trades so that the maximum drawdown in percentage terms is the same as for trading with the same number of contracts each time, then returns turn out to be very similar for both strategies.

Bottom line is that varying position size increases returns but also drawdowns by a similar amount. If you care about drawdowns it doesn't help. So, I think I will focus on controlling drawdowns when choosing position size rather than equalizing initial risk.

Sunday, May 05, 2019

Margin Requirements for Bitcoin Futures Trading

I just discovered that while going long a Bitcoin futures contract requires margin of about USD 16843.75 per contract, going short requires initial margin of USD 200k at Interactive Brokers. Do they really think that Bitcoin could rise by a factor of 7-8x when the market is closed?* This makes it much harder for people to go short and contributes to the inefficiency of this market. Importantly there are no options on these futures, so you can't hedge against large adverse movements. I can't see anything about this asymmetry in margin on the CME site, so I assume that it is set by the broker.

* Stops will only work when the market is open. The Globex futures market is open 23/5 - closed one hour each day and over the weekend.

Friday, April 26, 2019

Bitcoin Trading Update



This morning Bitcoin plummeted several hundred dollars at the open of the US overnight session on Globex. It triggered both my sell stop to close my long April futures position at a profit of USD 194 and my sell stop to go short the May futures from 5375. This also triggered the set-up of a buy stop for the short position. Everything worked as it should. On the other hand, I was pretty lucky to come out with a profit from the long position, which at one point was much more in the money.

Tuesday, April 23, 2019

Update on Trading Research

I came to the conclusion that none of the trading tools I developed are reliable. They can match market behavior for a while and make money, but then the relationship breaks down. In the long run there is no relationship between any of these indicators and returns.

I wrote a back-testing program for Turtle type trend-following models. This allows me to optimize the time periods to use to maximize profits. There is the potential for over-fitting and unstable relationships here too. The answer I think is to regularly re-optimize as the market changes. This re-optimization is easy to do. Given that a wide range of values is profitable in the exercise I did, I don't think there would be a sudden failure. We will see.

In the backtest there were 78 trades with a 48% win rate. But wins were on average 3.45 times larger than losses. The annualized Sharpe ratio is 2.2. Here there is a negative correlation between the initial risk taken (amount of money lost if the stop is triggered) and profits. That means it makes sense to bet bigger when the risk is lower:


I am now trading Bitcoin futures with the optimized algorithm (Long Bitcoin since yesterday). Next step is to see if there are other futures I could trade. Stock index futures aren't more profitable than just going long the index.

Sunday, April 21, 2019

Doing More Trading Research

Seems like April is the time for me to think about trading. I developed a very simple mechanistic trend-following model for trading Bitcoin futures. I have placed orders in the market but they haven't triggered yet. Initially, I tried to be too clever, but quickly decided that just using mechanical rules will work better...

Now I am returning to thinking about more sophisticated models as well. Here are the results from a very simple mean reversion model – it goes short when stocks are strong and vice versa, with daily trades on the NASDAQ index:


This assumes perfect trades with no fees. It worked great until the end of 2008. Then it did nothing for three years and then started working again. But in the last five years it again went nowhere. Strangely, it looks a lot like the returns from trend-following over this period. Still, from 2005 to the present it returned 19% per year. I might be wrong, but I'm thinking that this is a benchmark for more sophisticated forecasts. If we can predict that we should trend follow rather than mean revert for a few of the worst days here, returns would improve a lot. But it has to be a very simple method that won't result in overfitting.

On the other hand, the NASDAQ 100 index itself returned 14.18% and go long with a stop if the market falls 1% or more intraday returned 19.85% a year.

Wednesday, April 03, 2019

Bitcoin


I thought it was time to buy Bitcoin when I heard that CBOE was dropping Bitcoin futures contracts. Supposedly, when everyone hates something, it's the time to buy it. I have also seen research, which argues for a big rise in Bitcoin. I set up a simple trading model and it confirmed that I should go long now. I got approval to trade CME Bitcoin futures on Monday. Looking at the stochastic oscillator on the chart above, I thought there would be a bit of a pullback and put in an order yesterday to buy at $4000 when the futures were trading at $4140 with a stop at $3845. I went to a meeting and when I came out  I saw Bitcoin was at $4700. So, trying to be too clever, I missed the boat. The problem is that the stop is still the same according to my trading model. One contract is 5 Bitcoins. I don't want to risk USD5000+ on this trade. So, I will need to wait, probably a couple of weeks before the stop will change and I can place a trade with acceptable risk. The alternative risk is that Bitcoin continues to go higher from here. But after yesterday, I really want to stick to the model and not try to be clever.

This is one of three more "macro" trades that I am thinking of doing. At the moment, I don't have the time to do the research to fix my shorter term trading model.

Thursday, November 29, 2018

Put Writing Strategy

ERN recently posted again about his put writing strategy. Despite the market falls in October he ended up for the month. This seems to be down to luck that after his contracts went into the money (which means a loss if you write options) around 12th October, they then recovered substantially before the expiry date. I was curious about the performance of such a strategy in the long term. You can now buy an ETF that implements a similar strategy. It differs a little from ERN's strategy. In particular, the ETF sells options each month, rather than 3 times a week. It tries to match the performance of the CBOE S&P 500 put writing index. The index goes back to 1986! In the following I analyze the performance of the strategy since January 2007. Looking at the chart of the index, it seems to track the fluctuations in the stock market quite closely over the last 10 years:
Most of the time there is lower volatility and then there are occasional spikes. When I regress monthly returns on the monthly returns of the S&P 500 total return index (i.e. including dividends) I get a beta of 0.64 and annualized alpha of 0.9%.* The R-squared is 0.74. After transaction costs that alpha will likely disappear. This is looking a lot like investing 64% of your money in an S&P 500 ETF and the rest in cash with occasional volatility spikes added in.

Of course, this might not be much like the return profile that ERN is getting as his performance in October shows.

 * This isn't the classic CAPM regression where you deduct the risk free rate first, but that won't make much difference here.

Wednesday, November 07, 2018

Model Performed Badly Since I Stopped Trading

Since I decided to temporarily stop trading the model has performed badly losing about 9% while the NASDAQ 100 index is down about 4%. It still gained 5% for October overall while the index was down 8.7%. I gained 18% on capital invested due to leverage. It's good I stopped trading when I did.

Saturday, November 03, 2018

October 2018 Report

As I'm sure you know, this month was very volatile, which is good for trading but not for the performance of investments generally. This was a good test of our overall strategy, except that I abandoned trading after 17 October when I found the model was overfitted (and I also got ill with flu/pneumonia or something for the rest of the month). At the end of the month we received the grant of probate and so I am now adding in the inherited assets (cash and half an apartment) from the end of this month. This will suppress returns on both the upside and downside in the near future but doesn't affect the numbers for this month.

The Australian Dollar fell from USD 0.7228 to USD 0.7083. The MSCI World Index fell 7.47% and the S&P 500 fell 6.84%. The ASX 200 fell 6.04%. All these are total returns including dividends. We lost 5.30% in Australian Dollar terms and 7.20% in US Dollar terms. So, we  outperformed both Australian and international markets.

Because of the high volatility this month here is a detailed report on the performance of all investments and asset classes:


The table also shows the shares of these investments in our post-inheritance portfolio. Futures contracts are at the bottom. It doesn't make sense to compute shares or rates of return for those. Yeas, we lost a total of AUD 117k, which is our worst ever monthly result in absolute dollars. Things that worked quite well in this market crash:
  • PSSAP Superannuation fund - this fell very little, by contrast with Unisuper, which surprised me.
  • International hedge funds: Platinum, Tribeca, and Pershing, each did fairly well in relative terms. We should invest fully in these (12.5% is allocated to them in the model portfolio and 10% to Australian hedge funds).
  • Futures: Our own futures trading worked perfectly until I stopped and Winton's downside was not too bad (better than in February), but still not performing with zero or negative correlation to equity markets. Gold rose (will be a priority to invest in it). We need to get trading working, but it will take me a lot of time to do the needed research.
  • Real estate, CFS Diversified Fund etc all had more limited downside as we'd expect (estimated return for CFS Conservative Fund was negatively affected by trading).
What didn't work:
  • Cadence Capital, which fits in the (mostly) Australian hedge fund category, fell sharply. 
  • China Fund - this isn't surprising given the supposed drivers of the market correction.
  • Yellow Brick Road - I should have sold out of this when the Mercantile offer terminated

The following is table of investment performance statistics computed over the last 60 months (extended from 36 months previously) of data:



The first two rows gives the annual rate of return and Sharpe ratio for our investment performance in US dollars and Australian dollars. The other statistics are in comparison to the two indices. Based on beta, compared to the MSCI World Index we seem to be slightly geared, while compared to the Australian index we are less sensitive to market movements. We have a positive alpha compared to the Australian and a negative alpha compared to world markets. We capture more of the up movements and less of the down movements in the Australian market and the reverse in the international markets. The fall in the Australian Dollar over this period explains the poor performance compared to international benchmarks. The rate of return in USD terms is just horrible. US markets have been super strong over this period compared to the rest of the world.

This month I made USD 6k trading futures. This is the second best result to date and occurred as the NDX declined for the month. As I stopped trading partway through the month, I won't post the usual comparison of market, model, and my own performance. There seems to be potential here, but we need a system that is robust to different market conditions.

We actually moved away from the new long-run asset allocation in quite a dramatic way with the infusion of cash:



Total leverage includes borrowing inside leveraged (geared) mutual (managed) funds. The allocation is according to total assets including the true exposure in leveraged funds. All asset classes apart from cash and real estate fell as I added the inherited assets. My share of the inherited apartment is about 6% of net worth. Australian large cap fell by more as I switched out of the CFS Geared Share Fund just before the market correction got going.  Hedge funds were boosted by the addition of Tribeca (TGF.AX), which started trading on the ASX and Pershing Square Holdings, which I made a new investment in.

We also invest AUD 2k monthly in a set of managed funds, and there are also retirement contributions. Then there are distributions from funds and dividends.