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

Thursday, January 28, 2021

Treasury Wine Estates Rises Sharply on No News

Treasury (TWE.AX) rose sharply today with no announcement from the company or news in the media. At one point it was up 9%. This was on a day when the market was sharply down. It closed up 5.92%. I added to my position on the basis that my thesis was working out and that this spike would be continued.



Tuesday, January 05, 2021

Closing Plus 500 Account

 

 

I opened a CFD trading account with Plus 500 in Moominmama's name in order to hedge Bitcoin trades over the weekend and do other trading experiments with small position sizes. I no longer need the account and they are charging monthly inactivity fees. So, I tried to withdraw the cash in the account. But they wouldn't transfer the money to our joint Commonwealth Bank account. They also refused to transfer the money to Moominmama's Interactive Brokers account, even though it has a BSB and bank account number. So, I opened a new bank account in her name at HSBC. But now we have to wait a month to get a statement that would be acceptable to Plus 500... To be continued

Tuesday, December 01, 2020

New Investment or Trade? Treasury Wine Estates

 

Today, I bought 5,000 shares of Treasury Wine @ AUD 8.42 a share. The stock has traded as high as AUD 20.20 in the last three years. The price has fallen since China put a huge tariff on Australian wine. The company's announcement seemed positive to me. This stock was also recommended at the recent Sohn Investment Conference by Jun Bei Liu of Tribeca Investment Partners. I don't think she was betting on such a high tariff.

Thursday, December 12, 2019

Pulling the Plug on Short-Term Trading



I've decided to stop short-term trading. In recent months it hasn't made any money, it takes up a lot of time, and it gives me a lot of anxiety. Even though I am doing systematic trading I find myself looking at the market a lot and worrying about my positions. I can't seem to stop it. And my current position sizes are quite small. After a sleepless night, I've had enough. I already cancelled my orders that were waiting to execute. I will keep the existing Bitcoin and palladium positions until they exit naturally

Going forward, I will need to think about our overall financial plan again. Trend following funds aren't doing well in recent years, so we won't want to allocate that much to them compared to the current target allocation to "futures". What should we invest in instead? Should I still plan to set up an SMSF? I delayed that while I waited to see if trading was going to be a big part of it.

I've been here a couple of times before.

Friday, December 06, 2019

Trading Update

Well, that didn't last long. In November's report I said I would raise the risk allocation to palladium and soybeans. I just got stopped out of palladium futures though the contract is ending the day more or less where it began. I actually made a little money on the trade, but I'm not willing to take so much risk. So, I'm going to go back to trading palladium CFDs with a smaller amount of risk. I'll cut soybeans back to USD 2,500 risk as well. Yesterday, Bitcoin had a double stop out. First the long position was closed for a loss and a short opened and then the short was stopped out intraday. After all that, the contract ended near where it started:


I'm seriously thinking again of giving up on trading. Yes, you can make money doing this and I am now disciplined enough to always do the trades the algorithm says to do. But in practice there is still quite a lot of anxiety and mood swings. If I keep trading so small that I only make say a thousand dollars a month at it, it's not really worth the hassle. But if I make it big enough to make a difference I will have too much anxiety. That's the dilemma at this point. So far this financial year I am just losing money. I've given back all of last month's profit in the first week of this month.

Saturday, November 30, 2019

Performance of Optimal Portfolio


The graph shows the monthly profits from idealized trading of an optimal portfolio of Bitcoin, palladium, crude oil, and soybeans futures. The risk budget is the maximum loss possible in one day under ideal conditions.

My results this year somewhat track these. My trading hasn't always been ideal, I have been developing my methods, and my portfolio doesn't have the optimal weights yet. Midyear there were strong returns available and I also did well. Then, in the last four months returns were lower or negative and I also lost money. November was again a good month though not as good as April-June.

Next month I am looking to move closer to the optimal weights and increase the risk budget so that the average return would in theory be around the same amount as my salary, which is one of the goals I have set.

Monday, October 28, 2019

Capitalise

Capitalise is an automated trading platform that uses commands written in near natural English at a very high level. I heard about it when Interactive Brokers told us that we now have access to it. At the moment the service is free. You can put in commands where buy/sell levels and stops depend on functions of past prices and also various technical indicators. There is no need to learn a formal programming language like Python or understand any of the intricacies of actually executing strategies. They are based in Israel.

This would be great for me except at the moment it doesn't allow position sizing based on functions of prices. You have to give it a numerical position size. I chatted with Arica on their platform and she said that they might develop that functionality in the future. For now I can handle updating my orders each morning (Australian time) as I am only systematically trading in 3 markets (Bitcoin, palladium, and oil). Maybe they will have this functionality by the time I can't handle trading manually anymore and I won't need to learn Python etc or collaborate with someone who does know that stuff.

Saturday, October 26, 2019

Silver, Six Losing Bitcoin Trades in a Row...

I tested silver futures as a possible addition to the trading portfolio. When combined with Bitcoin, palladium, and crude oil its optimal portfolio weight was 2%. So, I'm not going to be trading that.


Overnight and in today action in Bitcoin has been insane. I was up around USD 5k on my last Bitcoin trade and then it became a USD 1k losing trade, the sixth in a row. We switched to long from short and subsequently bitcoin skyrocketed to over 10,000 from around 7,500. This long trade is only one contract though compared with two contracts on the previous short. It seems like this spike might have been generated by Xi Jinping's new enthusiasm for blockchain. He told party members to study blockchain. This is despite China banning cryptocurrency exchanges, though a lot of Bitcoin mining takes place in China.

Wednesday, October 23, 2019

Five Losing Bitcoin Trades in a Row


The bad news is that the worst historical losing run in Bitcoin is eleven losing trades in a row. The good news is that least we now have the losses more under control after adopting position sizing and a constant (more or less as we use rounding of contract numbers) maximum dollar risk. I am also now 100% disciplined in following the algorithms. That was a big struggle. We are now back to short again.

Without slippage the previous trade would have been a $120 win. We had a $30 loss. The last trade though was a $2,000 loss when rounded up to two contracts.

Monday, October 21, 2019

Trading and Mortgage Inversion Update

We switched from short one contract of Bitcoin to long two this morning, booking a USD 30 loss on the short trade. We are long two as the per contract risk is lower now. After four losing Bitcoin trades, hopefully this is a winning one...

I sold a lot of shares this morning and already was allowed to move some of the proceeds to our offset account. I also paid down AUD 100k of the mortgage and was surprised to see that I could redraw it immediately. I had thought I would need to wait to 4th November for the redraw balance to update. This means that I might be able to complete the inversion this week.

P.S.

So I paid off another AUD 300k later in the day. Am still waiting on a transfer of AUD 100k from my margin loan. When I get it I should be able to complete the "inversion".

Monday, October 14, 2019

Optimizing Trading Portfolios and Shifting to Return on Risk Metric

I started exploring testing portfolios of trading strategies. For this, I decided that in looking at return on capital where capital is the face value of a futures contract doesn't make much sense. It seems to make more sense to look at the return on money at risk. It makes the most sense to measure that in dollars as a share of a total risk budget. This then leads me to making the primary measure of return also to be in dollars. Here is an optimized portfolio of Bitcoin, oil, and palladium:


The portfolio has a total risk budget of USD 5,000. This is then allocated across the three markets with the resulting profit curves. The analysis assumes that you can trade fractional futures contracts. Oil and palladium help diversify Bitcoin and increase the information ratio. Using a zero benchmark and daily returns on risk the portfolio IR is 2.96 rising from 2.17 for Bitcoin alone.

Oil hasn't gone anywhere in the last year, but did well in 2018 when Bitcoin struggled. Going forward, I will test whether each new market I look at improves the portfolio IR or not.

This approach then also leads to computing the prices for continuous futures contracts additively rather than multiplicatively – so that differences in dollars are preserved -– and to focusing on a constant risk budget in dollars. It also allowed me to simplify the back-testing program quite a bit. In the following chart the blue line is the daily profit curve for trading one contract of Bitcoin futures:


The red curve is based on completed trades only. The green curve has a constant dollar risk equal to the average of the single contract. To be more realistic I have rounded the number of contracts to the nearest whole number, which could be zero. This keeps the strategy out of the market in late 2017 and early 2018, when the single contract strategy had a big drawdown. The constant risk strategy has a higher return and a smaller maximum drawdown than trading a single contract. So, this is the strategy I am adopting for Bitcoin going forward. This morning, we switched from one contract long to one contract short...

Monday, October 07, 2019

Trading Progress

I've now tested Bitcoin, ASX200, palladium, and crude oil futures trading using Barchart data. So far, only ASX200 futures were not profitable. I'm now trading one contract long or short of Bitcoin futures, trading palladium with position sizing using CFDs, and have put in an order to short crude oil futures.

With palladium I am aiming to risk about 10% of the CFD account on each trade. My current position is long 10 ounces of palladium and I have an order to short 20 ounces of palladium. The typical risk for trading a 100 ounce palladium futures contract is too big at this stage. The contract face value is around USD 160k. So, even if the stop is 5% from the current price you are risking USD 8000.

On the other hand, a crude oil contract has a face value of around USD 50k (1000 barrels of oil). I am targeting 5% of the face value as the risk we can take on. To compute the number of contracts we can trade we calculate: 0.05*price/abs(price-stop) and round it up or down to the nearest integer. If that is zero then we don't put an order in. This is why I only have a short order at the moment and no order to go long.

Both oil and palladium have longer optimal periods for measuring breakouts against than Bitcoin does. My palladium strategy looks for breakouts from the last seven days of prices in either direction. My oil strategy uses breakouts from the last eleven days. However, it will exit a long (short) position if the price falls below (rises above) the previous day's low (high).

Palladium has about the same risk/return trade off as Bitcoin, but oil isn't as good a risk/return ratio. Here are the average maximum potential loss and the average trade profit for trading with a single contract:

Bitcoin: Risk =  USD 3,722, profit = USD 1,036, ratio = 0.28
Palladium: Risk = USD 4,910, profit = USD 1.462, ratio = 0.30
Crude oil: Risk = USD 2,030, profit =  USD 225, ratio = 0.11

Compared to face value of the contract, the average Bitcoin profit is a 2.7% return, while for palladium and oil it is 0.9% and 0.4%, respectively. Relative to required margin, though, Bitcoin is not so good compared to the others.

The reason for trading all three of them at this stage is for diversification. I want to have more consistent returns rather than boom and bust. That's why I am still allocating the largest amount of risk to Bitcoin. I also still have a treasuries futures trade on and am long more than 100 ounces of gold via the IAU ETF.

At this point, I think I got beyond the experimental stage of trading and am now in a more developmental period. My backtesting programs work pretty well, I have good quality data, am more used to trading in a disciplined way, and am now testing which markets and position sizes make most sense.

Saturday, September 28, 2019

ASX200 Futures

I put together a dataset for the ASX 200 futures for the past 5 years - Barchart have this data. Every possible "Turtle" strategy I tested lost money. So, we're definitely not going to trade this! I tested breakouts from 1 to 40 day periods and they all have similar poor performance. Position sizing to always trade the same percentage risk made things much worse.

Here is a 2,2 strategy without position sizing assuming no slippage – The best case scenario:



The blue line is the continuous futures contract price I constructed and black is the equity line of the strategy. This actually makes a slight gain over the 1200 trading days. But including reasonable slippage, it will turn into a loss. A 2,2 strategy means that you buy or sell breakouts from the previous two days highs or lows and exit those positions on breakouts from the same number of trading days in the opposite direction.

I have now put on a small (10 ounce) Palladium trade using CFDs. I'll probably test trading oil next.

Monday, September 23, 2019

Data Quality Matters

I did an analysis of the optimal trading strategy for Palladium futures using Barchart data. Previously, using free data, I had found that we should make trading decisions based on very short periods of past prices. For example we might go long (short) if prices broke out above (below) the previous day's high (low), or maybe the high or low of the previous two days. Now I find that the optimal strategies use periods of 7 to 18 days for breakouts. This shows that using good quality data really matters in trading, and not just a little bit. Using one day breakouts would actually lose money over the last five years of data that I tested. I lost money on all the Palladium trades I previously made... though four trades is not a large sample.



At the moment Palladium is in a winning long trade, but I am reluctant to go long at this point. So, I put in a short trade which will activate if the market reverses.

I also found out today that Barchart has past ASX 200 futures prices. I don't know if these are as high quality as their US futures data.  I will download them next.

Sunday, September 15, 2019

Variable Position Size, Again

I signed up for the Barchart Premier subscription. Among other things, this gives access to daily open, high, low, close etc. data for all US based futures contracts back to 2000. The data seems to be much more accurate than the various free sources. To start with, I downloaded all Bitcoin futures contracts data. I constructed a continuous series of prices going back to the beginning of trading in Bitcoin futures. I use proportional splicing that preserves percentage changes rather than absolute dollar changes. I also saved the actual futures prices for computing trading costs.

When we include the very volatile period right after the all time high in Bitcoin, the optimal trading strategy changes:


This graph shows the drawdown for a simple strategy that always buys the same number of contracts (in red) with a strategy that always has the same initial risk in percentage terms (in green). The latter targets a constant maximum 5% potential loss of the face value of the Bitcoin contracts before stopping out. The simple strategy soon finds itself 40% down at the end of January 2018. On the other hand, it manages to claw back that loss by late March... The constant risk strategy only loses a maximum of 15% over this period. On the other hand it performed worse during the string of 11 losing trades in a row in late 2018. But the Sharpe ratio for the constant risk strategy (2.45) is quite a lot higher than for the constant position size strategy (2.21). So, I am going to start varying position size, targeting a maximum loss of USD 5,000.

I will also start to revisit other markets to see where there is potential.

Previously, I found that there was a positive relationship between the initial risk of a trade and its return. When volatility is low moves seem to be more noise than signal. Looking at the relationship between initial risk and return, there is now a negative correlation between them, though it isn't statistically significant:


On the other hand,  the "lowest risk" trades here mostly had negative outcomes.
 

Monday, August 12, 2019

Trading Back on Track

After suffering some losses, it looks like I've got our trading back on track for the moment:


We were stopped out of Bitcoin this morning for a USD 16k gain at $11595 and $11600 in the August futures (3 contracts in total). As we are only doing long trades in Bitcoin, we don't have a Bitcoin position. This should be the impetus for subscribing to a data service and doing some backtesting of other markets...

We are also net positive in trading since 1996. However, the month is still not half-way over, so anything could happen by the end of the month.

Tuesday, July 30, 2019

Stopping Daytrading

Well, that didn't last long. I think it is definitely possible to make money using this daytrading method, but it is definitely not for me. The problem is that though entry to positions is "automated" the exit is discretionary. If you say it is the end of the session, then you can't do it exactly at the end  -say at 4:30pm for the ASX200 futures. So, do you do it at 4:00 pm? 4:10pm? 4:30pm?, 5:10pm? or what? There is a temptation to hang on for the price to improve. And I seem to have a strong self-destructive tendency, which I need to control with rules based trading.

Monday, July 29, 2019

Long Only Bitcoin Trading

I continue to struggle psychologically with shorting Bitcoin futures and as a result make mistakes and lose money. So, I investigated how taking only the long trades would perform. If the "model" says to short Bitcoin, we close the long and stay out of the market. This is equivalent to being always long 1 unit of Bitcoin and going long or short one unit in addition.

Statistics since March 2018 for long trades only are very similar to the statistics for all trades. But because you are in the market only half the time, total returns will be lower. Since the beginning of 2019 total returns have been the same - short trades have added nothing to returns. Winning long trades outnumber losing long trades 10 to 6. Losing short trades outnumbered winning short trades 10 to 5.

So, I think that in the interim I will only take long trades in Bitcoin.

Note that in the last 10 months of 2018, long only trades gained a total of 18% while Bitcoin lost 65%. So, taking long only trades doesn't mean losing if Bitcoin returns to a bear market.

Saturday, July 27, 2019

Trading Account Equity Curves

Thought I'd just post the "equity curves" from our three trading accounts. Moominpapa:


There is trading in the first half of last year and then in this year. In between, I didn't trade in this account for tax reasons and then because I wasn't trading over the Australian summer.

Here is Moominmama's account (which I trade too):


There is trading in the second half of last year instead. Most of the recent moves in this account and Bitcoin long trades. The short trades are in Moominpapa's account.

Plus 500 CFD account:


This is mostly long Bitcoin trades. As it is expensive to trade in this account I use it for hedging Bitcoin positions over the weekend and for experimental trades at a smaller scale than I can do with futures contracts.

Generally, the curves show a two steps forward one step back pattern. Hopefully, we can recover from the recent drawdown soon.

Trading the SPI


The graph compares idealized trading of the ASX200 futures contract, known as the "SPI" (share price index) vs. buy and hold. The trading uses my new day-trading approach. I actually transcribed by hand all the opening, high, low, and close values off a chart of the past month with 8 hour bars to get the data. The ticks are each of the five daily 8 hour bars. Yes, they're not all actually 8 hours long. 9:50-10:00am is one of them! Each index point is worth AUD 25 per contract and this tracks trading one contract.

The good news is that trading would have made money over the past month. On the other hand, buy and hold would have done just as well. But trading is less volatile. Hopefully, trading also does better in down markets. As I started near the end of this chart, so far I have lost money. But I have been making money in daytrading the Australian Dollar and the S&P 500 index in the last week. I also did a rough backtest on the NASDAQ 100 Index. But as I don't have access to bulk hourly data I can't do very extensive backtesting. Either I need to get that data or I need to just trade at a small scale until the results are statistically significant.