Momentum Strategy On First Ride

This is the diary (or investment log) for the first ride on the entry signal till the exit signal. I called it Valentine’s Action, as it starts from 14Feb2017.

I will try to write down what happened in the market, how the strategy performed, and how I felt during the point of time. This should help me to review the strategy and my investment sentiment after the first ride.

Strategy start on 13Feb2017 market open:
Fund pool with 500K (reajusted to 750K) for allocation,
Stock Ranking using sharpe ratio
Component Risk at 25bp (readjusted to 20bp), allocation is based on ATR

Holding till 2/16/2017 with reduction of two stocks to reduce the risks
Reduce at T-1 closing.

2/16/2017: reduced two stocks to get even risks on all components during open session. after market, SEC announced to remove index future’s trade limits for hedge contracts.

2/17/2017: market is calm at open. the two reduced stock is going down a bit (banking sectors).

Recalculation on 17Feb2017 to check the position deviation.

Week 2
2/20/2017
first day of the week, session started very volatile; and 600827 went up to +10%.
this is the moment where i really wish my programme is fully operational; the strategy is supposed to re-position when friday is closing. then i will be fully in this 10% profit.
but anyway, i entered at 5%, and stock dipped to 2.5% and bounched back to 10%.
000858 was trading well as well.

2/21/2017
600827 hit trade limit on +10% again.
reducing sizes according to atr: 600827 reduced 600; 601328 reduced 2000. to maintain 20bp impact.

2/22/2017
First 3 session of the week was doing really well, and it went up to 3.8%.

The rest of two days of the week, index was performing weak, and the strategy performed slightly worse than index. On Friday, I was manually liquidating those stocks with lower rankings. Comparing to the closing price, manual has wins and loses, so it means that sticking with strategy isn’t too bad.

Week 3
2/27/2017
market start off as calm, so rebalance was smooth.
the whole day, market performs weak; strategy lost less that the market. 300ETF has -0.78%; strategy is -0.64%.

2/28/2017
market remains calm; strategy is at even. before the major meetings, usually authority will keep the market calm. banking sector, which the strategy suggests to invest heavily, is performing calm; they weigh a lot on the index.
so this time period, it’s good to bid for IPO stocks.

2/29/2017 – 1/3/2017
the market is moving sideways; nothing much is happening before the annual meetings happen this week.

3/2/2017
the index was slumping, but the strategy was calm.
one important thing to note is that the 300ETF composition has been adjusted; 600600 (青岛啤酒) was in strategy, but the closing price was not found when I snap the market data for all 300 components on 2nd March 2017 after closing.
Therefore, I need to create a tool to fix this problem.
1. build snapshot function to capture all last available 300 compositing stocks in HS300.
2. build snapshot functions to capture a given list of symbols (stock, index, etf and etc)
3. build a service to scrape historical data by equity+quarter; so that i can patch the missing data
4. build spring shell, so that item 1-3 can be linked into the shell.

3/3/2017(Fri)
market moved down -0.6%, dropping near to 3200 in the early morning trading session; US/Europe was dropping over the night. But the strategy was doing OK, since it’s heavily invested in banking sector.
In the afternoon session, banking sector started tumbling.
Daily: -0.32% vs -0.38% 300ETF
Weekly: -0.84% vs -1.24% 300ETF
So for the week, it makes sense to put higher weight on banking, as it acts more stable that other sectors.
I didn’t do any manual liquidation on this Friday.

3/4/2017(Sat)
The re-position of the strategy shows that I have to liquidate all banking stocks, and the new portfolio will be 45% on Technology, and 35% on Consumption.

Week 4
3/6/2017(Mon)
Reposition is done according to Saturday’s plan. The market was performing good; the strategy is performing better than market.
Sold off all banking stocks/meds/alcohols, for all of the liquidated stocks, med/alcohol went up a bit.
Buying IT stocks and electronics, which moves up more than the liquidated stocks. But the newly joined med/alcohol was not perform well. Mechanical (长城汽车) is not perform well either. Overall strategy is doing better than market for the morning session.

7-9/Mar/2017
On 8Mar, strategy portfolio was down for 0.5%, in match with major indexes, but surprisingly 300ETF was flat; possible reasons is that 50ETF had enjoyed lots of inflow of funds, so 300ETF is stable, however, strategy portfolio was heavily invested in non-50 components.
On 9Mar, strategy portfolio was around flat (down at -0.15%) but 300ETF suffered huge loss, pnl at -0.9%.
strategy

10/Mar/2017
HS300 is moving side ways, and the strategy performed very well, at 1.07%; it seems that the market is shifting from large cap companies to medium-small cap ones. The strategy has entered to medium cap companies promptly, hence yielding good return for today, and for the week.
At end of day, strategy has repositioned all of the stocks; and identified 3 stocks to be taken out and 3 stocks to enter, with minor size adjustment on other components.

Week starting from 13/Mar/2017 will have lots of major events from all of the world. FED will hold meeting on rates hiking, where the market has priced in 93% of hike probability, and not is pricing in the faster pace of rate hiking.
EU central bank is discussion about rates hike with current pace of QE.
UK is holding a meeting as well.
China’s “two sessions” major political meeting will end this week; there’s 15 Mar annual programme in CCTV which might impact market as well.

13/Mar/2017
The market opened lower, but stablized in 30 min, with medium-small cap stocks going up first.
The 3 stocks taken out from portfolio was actually performing better than the 3 newly entered stocks;
The slippage problem is still there, where I was selling the 3 stocks at lower price when the market just open, and was buying the 3 new stocks when their price is going up, hence the slippage in both direction.
When market stablised, the 3 new stocks were moving down a little bit, and the 3 liquidated stocks were moving up again, and as of now, they are performing better than the 3 new stocks.
The loss is on the slippage, plus the less performing portion. The spread is considerable.
The solution that I’ve been thinking of is to complete the repostion and resizing calculations at 10 min before closing of the market, and action on the repostion/resizing before 5min market closing. Generally speaking, market is calm at closing than at opening.
Another way is that we do reposition calculations at end of Wednesday, when the weekly K line is reasonably accurate, and we the market is calmer than Friday closing and Monday opening.

国旅: it suffered around -3.01% loss for the day. the TR 49.81-51.45=-1.64, closing 49.9-51.45=-1.55; ATR @ 1.09

14/Mar/2017
海信: suffered -5.43% loss for the day. TR 18.22-19.53=-1.31, closed at -1.06; ATR @ 0.44. if we stop loss at 0.88, it will be less loss than the closing.

With these two days, I’ve been thinking to put in the stop of 2ATR for the component, when there’s a drop of 2 ATR in a single day; the stock should be sold off, and replaced with a new stock.

15/Mark/2017
300ETF was at 0.17%, the strategy was down for -0.49%. the market is waiting for FED rate hike announcement; and also the CCTV 315 party, which is supposed to protect consumers but it just became yet another show.

16/Mar/2017 (Thur)
Last night, I’ve calculated the repositions for all stocks. And this morning, I’ve rebalanced the portfolios. Going forward, I’ll reallocate the portfolio at the closing of Wednesday, or at the opening of Thursday.
And also, I’ve figure that my code is really too messy, and I need to work on the design of the calculators, so that back testing, regression, and running on live market data would be easier.
And also, last night, I had a discussion with my friend. We are thinking to extend the period of re-allocation from 1 week to 2 weeks, during the course, we can use stoploss level on: 1. daily TR below 2ATR; 2. weekly KDJ is down, or ranking below 60.

17/Mar/2017 (Fri)
Last trading day of this week; index has dropped around -1%.
It’s settlement day for equity index future, and the future is behaving quite strangely, by saying that, i mean it has dropped -10% by accident around 2 days ago, and it has hiked 10% by accident this morning. There must be something going on with the index future trading. In a rigged market, you won’t be surprised to see this kind of things, and it seems that the authority is not doing any thing yet.
Strategy was down -1.5% and 300ETF -1.12%.

20/Mar/2017(Mon)
Market opened slightly high, and moving down a bit. Strategy was +0.4% (vs HS300 +0.2%) and moving to -0.2% (vs HS300 -0.4%). It’s almost sideways. Daily KDJ is in down cross, weekly is still in up cross.
Monday is not doing reposition, so we avoided slippage for the volatile Monday opening.

21/Mar/2017(Tue)
It’s the second day after future contract settlement day. It’s said that the stock market will be volatile 3days before and after future contract settlement.
In the morning, market is calm, with HS300 at 0.2%, and strategy is at 1.4%.
Some stocks with low ranks are moving up a lot today. It seems that we can consider to use 20% (aka rank 60) at threshold for liquidation.
At closing, strategy vs 300ETF: 2.28% vs 0.5%. It’s a very good day, and AUM has returned back to where it was 1 week ago. It’s probably that liquidity (drawn due to index future settlement) has returned to market.

22/Mar/2017(Wed)
Over night US market was down for more than -1% (S&P500); in the morning, Tokyo was down for more than -1%. Chinese market opened at -0.5%.
Strategy opened at -0.4%. Today might be a volatile day; usually Chinese market goes down with overseas market, but it usually won’t go up with overseas market. It’s interesting phenomenon that I observed, with the cause still unknown.

23-24/Mar/2017(Thur-Fri)
Friday index was not moving much, but strategy has logged huge return.

27-29/Mar/2017(Mon-Wed)
The market is moving down for the 3 days.
Monday: strategy was moving down faster than the market.
Tue/Wed: strategy was moving less than the market, and considering outperforming the market.

30/Mar/2017 (Thur)
Positions have been recalculated since it’s 2 weeks after the previous re-allocation.
The new allocation has liquidated all technology and electronics companies; and invested heavily in medicals, home appliances and alcohols companies.
At the morning 11am, The market is down for -0.66%+, and the strategy was down about -0.6%-.
The overnight rate hiked to 25%, and the market is in lack of liquidity. It’s at the end of the quarter, and it’s suspected that the central bank is doing stress testing in the banking system.
The market ended up with -0.95% for 300ETF;HS300 -0.82%;Index -0.96%; strategy was at -0.64%.
31/Mar/2017(Fri)
During the opening, I’ve liquidated 海康威视(002415) (which is a electronics company, who has major market share on survillance cameras for home and public usage in Chinese market) with profit of +25.62%; because its weekly KDJ is moving down; and entered into a new position with 宇通客车.
The overall market is getting stabled and moving up a bit. At 2pm, the strategy is still performing better than the market.
The market closes at 1.49% as compare to previous day; and -1.45% as compared to the previous week.
1/4/2017-4/4/2017 break for Qing Ming
5/Apr/2017(Wed)
During the holiday period, there were lots of political news, one of which is about the migration of Beijing’s political functions to a rural area (Xiong’an) in Hebei province. Hongkong market was hiking a lot for those companies who has takes in Xiong’an.
Today, in the morning session, market opens higher, and HS300 is close to +1%; however the strategy is almost flat, which makes sense as the strategy components are not affected by the political announcement.
One thing to notice is that two stocks (601258,002310) removed from strategy during last rebalance has hiked +10% this morning.

6/Apr/2017(Thur)
Market opens flat, and the stocks related to Xiong’an are still hiking up; strategy is almost flat, at about -0.3%.
The strategy loses to the index, and I guess, it will continue to lose to index; because the liquidity is drawn to the stocks hot on policy changes. There are new liquidity drawn to the market, and hopefully, when the news got fully dissolved by the market, the liquidity will stay in market, which then might benefit other stocks, include those components in strategy.
The index’ weekly KDJ is at high range, and I’m expecting this round of strategy will end in 2 weeks time (when K drops below D).

10/Apr/2017(Mon)
Xiong’an new district related stocks are still hiking up. All other compositing stocks are slumping. Strategy is down for -0.96%.

11/Apr/2017(Tue)
Intraday session, market was down nearly -1%, and the strategy lost over -2%.
Over the weekend, CSC has declared to investigate companies who announce high split ratios. Lots of technology companies and newly issued companies are tanked at -10%.
Xiong’an related stocks still hike at +10%. The funds are flowing into stocks on the hot topics.
The strategy has lost -1.17%, where the index edged higher. With the continuous losing to benchmark, the strategy’s excess return is vanished.

12/Apr/2017(Wed)
Xiong’an new district related stocks suffered huge sell off at yesterday’s closing. Institutions were taking profit from it. Some suspected that “National Team” were selling off all of their holdings.
Expectedly, those stocks hike less than 10% today, and the transaction volume has increased. Lots of them are trading lower than yesterday’s closing.
The strategy were performing well in the morning session, with one exception (601888 中国国旅).
About stoploss. 601888 has suffered huge loss and exceeded 2*ATR. It was down for -3% while all other components in the strategy was around flat. I was wondering if I should square the position, however the stock’s ranking was high (above 20), and weekly KDJ signal is good; so I decided to stick with the strategy initially. However, it later drops exceeding 2*ATR limit. The 30day ATR was at 1.7, and 2*ATR is defined at 3.4. Strategy has defined loss at -3.4, so I’ve executed stoploss; after the morning session, the stock ended up at -5.71 (-10%). So the stop loss actually works this time. It’s expected that the stock will open low from tomorrow morning’s session.

13/Apr/2017(Thur)
Repositioning is done on every two weeks on Wednesday. Ideally, all calculations should have been done at the closing of Wednesday, and repositions should be done at the closing as well. However, the program is still half automatic, so I could only do the computation after work when market is closed. On Thursday opening session, I will perform the repositions.
About Slippage
Today’s slippage is very obvious.
The market is at pre-session between 9:15-9:30am, and opens at 9:30; I was selling 9 stocks (and keeps 2 stocks which remains in strategy). Market opens low, so the orders were all at low prices; and I need the cash to purchase new stocks for the strategy.
When orders are getting filled, I could then place orders for the new stocks (9 of them). However, the stocks are already edging up. I managed to execute 8 stocks with the at-the-market prices, however, 600009 (上海机场) has jumped up a lot, and the strategy has totally missed the good price. By the time, I have filled up all of the orders, the stocks sold were all edging up.
I’ve been thinking about slippage cost, where what happened this morning is a typical case. The reason why I moved the reposition from Friday/Monday to Wednesy/Thursday (and reduced reposition frequency from weekly to bi-weekly) is exactly to reduce the slippage. But maybe the timing is still not so great? Right after market opens, the prices are still volatile, and maybe 10-10:30am is better time interval; or maybe the 5min before market closing is still the best time interval?
The slippage cost is around 5000CNY for this morning, which is a considerable amount for the strategy.

14/Apr/2017 (Fri)
Overnight US market went down quite a lot; gold spot is hiking up. With the concerns on instability in the region (N.Korea might launch nuclear test; US has bombed Syria earlier this week with 60 missiles, and bombed Afghanistan just last night, and US is going to hold military exercise with joint force from S.Korea very soon. US is warning N.Korea that if they launch a nuclear test again, US army will take N.Korea down.).
A share market index HS300 has sunk -0.8% as the deepest in morning session, and it’s up a bit trading at -0.6%; strategy is down for -0.8% at the moment.

17/Apr/2017 (Mon)
The benchmark index (HS300) opens lower, and continues to move lower during intraday session, and hits as low as -0.93%; and it ended at -0.2%.
The Xiong’an related stocks (the newly announced sub-capital-to-be, as the government decides to move financial functions off from Beijing to Xiong’an) have stopped hiking after almost doubling prices in the previous weeks. Some of the stocks encountered huge sell off, and fell as much as -10% at opening.
The components in strategy are getting stabled as the funds are moving from stocks on hot topics back into index components when the hot topics get cool down gradually.
At weekly KDJ level, the index is at down trend now. The strategy will keep on selling stocks without any replacement. So I will start selling stocks from Wednesday when weekly KDJ confirms the down trend.

18/Apr/2017 (Tue)
HS300 opens flat and is moving sideways during intraday session.
Xiong’an related stocks are edging slightly lower in the morning session; and other components of the index are hiking. The strategy is performing much better than the index for the morning.
The weekly KDJ is still signaling down trend.
600519 (贵州茅台) breaks the record high and closed at 400 in the morning session.
002475 is still pending for liquidation on Wednesday, when the weekly signal is more confirming.
The market tanks in the final minutes of today’s trading, and it closes below 3200.
I’ve been thinking about 7/3 equity-bond ratio to be implemented in the momentum strategy, so that it would not lose all of the excess returns if this allocation is in place. However the fixed ratio does not make full sense, instead it should depend on the strength of the trend signal. I will research more on this area.

19/Apr/2017 (Wed)
EXITING POSITIONS
Yesterday at closing, SH300 has dropped -0.5%; strategy closed higher at +1.08%
Today, the market opens low and is ticking lower, at -0.67%; strategy is at -0.4%.
Globally, USD index is moving lower, and the overnight LME market is crashing (Cu/Zn/Al/Pb/Ni all went down a lot while dollar is moving down which is unusual). Nikkei 225 opened lower this morning as well.
I will start exiting the strategy, starting from those stocks out of holding criteria.
At closing, the market recovered from -1.28% and closed at -0.49%. Strategy closes at around -10bp. Liquidation has done on two stocks: 002475, 601225. Funds are invested in 7day repo with 3.2% annualized rate.

20/Apr/2017 (Thur)
HS300 opens flat, and hikes up to 0.5% in the morning session; strategy logged nearly 2% profit.
In the afternoon session, HS300 moves down, and strategy has given up earlier gains and now around 1.4% profit, while the market is still trading.
It seems that 100 enjoys lots of fund inflow, and more specifically, 100-50 received lots of investment for today’s session.

21/Apr/2017, 24/Apr/2017 (Fri-Mon)
Flash crash happens on the Friday on 3 stocks.
600519: it’s sold on Friday, because it’s ATR is around 7, but it dropped more than 15. On Monday, it continues dropping. It’s recently high was at 420, and it was sold at 400.3.
600089: it should have been liquidated on Friday, but I didn’t have chance to execute the order; and it continued dropping on Monday. It was sold in Monday morning for stop loss. The stock was having +8% profit, but it was sold at around -2%. The market is behaving very odd in this two days.
600068: it looked OK on Friday, but it dropped till -9.89%, and I’ve executed stop loss when it recovered to -6%.
For Monday morning session, global market is doing fine, and Japanese market is moving up actually, however Chinese market is crashing, including shares, bonds, and commodities. There are lots of political changes recently, where China Banking Regulatory Commission (CBRC), China Security Regulatory Commission (CSRC), and China Insurance Regulatory Commission (CIRC) are investigating bribery, corruption, manipulation, and etc.

25/Apr/2017 (Tue)
Over the night, global market were on risk-on mode, where Europe and US stock indexes hiked a lot. It was believed that French election has encouraged market to take on risks.
Chinese market is edging up generally; however strategy is losing to the index. Xiong’an concept stocks are hiking to 10% again, and other stocks are not performing as good.
At the closing for morning sessions, HS300 vs strategy is at 0.4% and -0.2%.

26/Apr/2017 (Wed)
Overnight, global markets are still hiking up a lot, and investors are willing to take risks. DJI enjoys historical high before Trump government announces tax reform policies.
Chinese market opens high and trades at high level. However, single stocks are still volatie during the recovering process.
HS300 index against strategy is at: around 0.11% vs +0.6%, where strategy performs better.
Strategy is still at stage of exiting, since the indicator suggests market at weak signal and losing momentum.

27/Apr/2017 (Thur)
Overnight, US market is having new high. Nasdaq index reached 6000, the new high since the dot com bubble.
Chinese market opens low, and moves lower to -1%. HS300 dips to as much as -1.2%.
As of the time of writing, market is trading at -1%, and strategy is at -0.6%. It’s at down trend, and the strategy is still liquidating holding components. It’s at around 50% cash holding now.
Liquidated 601111 (sold at the market, but the market later bounced back to 5d average), 002415 (placed order at 5d average and market matches it later on). Lesson learnt is that when exiting, market is moving volatile, but it might bounce back to 5D average.

28/Apr/2017 (Fri)
Market yesterday had a very volatile session. It bounced back and ended higher. However the strategy is trading almost flat. The market wins over the strategy.
Market opens low, and trades flat. Nothing exciting; strategy is at -40bp, and HS300 index at -40bp as well.

1/May/2017 (Mon) Market is closed for public holiday.
2/May/2017 (Tue)
HS300 moved -0.4%, vs strategy moves +0.4%.
Index still signals weak market condition, so strategy is still exitting. Currently, stock holding is at 35%. All cash are invested in 7-day repo.

3/May/2017 (Wed)
Market keeps sliding, as the authority starts to discourage leverage.
HS300 is down for -0.40% vs strategy at +0.20%. The benchmark is losing momentum, while the 3 stocks in the strategy is still performing well for now. In overall direction, the strategy is exiting stocks and investing in repos.
O/N REPO in the morning hiked to 4.3%.

4/May/2017 (Thur)
Stock market continues sliding, commodity and bond market are crashing. Commodities in global market are going down, including oil, base metals, ferrous metals, precious metals, however european stock market is breaking new highs and bitcoin is hiking.
HS300 index closes at -0.26%, versus strategy at +0.20%.

5/May/2017 (Fri)
It happened again, where all markets (stock, commodity, bond) are crashing. Over night repo didn’t change much though.
HS300 is trading at -0.6%, versus strategy at -0.2%.

8-10/May/2017
Strategy continues at exit stage. 000725 has sunk -10% on Monday; this suggests that setting -2*ATR stop loss trigger is important. However, the broker doesn’t seem to support the stop loss feature in their trading software yet. It’s a pain.
000725 is at selling stage, so I’m selling whenever it’s moving up. On Wednesday, I’ve cashed out half of positions at 3.88.
The other two stocks still carry momentum so I’m still letting them running, although the HS300 index has dropped drastically and the market is in bad shape.
The equity allocation is around 20%+ and less than 30%. The overall portfolio value is not changing too much these days, in comparison, the market has been going down quite a lot these days.

11/May/2017(Thu)
Global markets are at new highs; domestic market is still going down quite a bit. One theory is that the central bank wants to reduce it’s debt holdings. While FED is still at the stage of discussion and sending market signals, Chinese central bank is already doing it. As the deleverage becomes the norm, institutions have to reposition their investments, which creates the recent market down trend.
000725 has been liquidated at 3.88; half was done yesterday, half today.
Strategy has 2 stocks remaining. As the market is losing momentum, most stocks start to losing momentum as well, which explain the current movement of holdings in the strategy.
There are 70% cash invested in repo; I’ve been thinking to explore in trading equity index options. In weak conditions, especially when strategy at exiting stage, there will be lots of cash available to serve as option margin as required by regulator, and taking a reasonable amount of risk to hold long-dated put options might not be a bad idea, because in reality, the excess return on strategy over HS300 is increasing, while the absolution return on strategy is not improving too much.

12/May/2017-23/May/2017

There’s no position rebalancing in this period. Two outstanding stocks are still in portfolio, and actually they are performing quite well. After the heavy selloff in April, these two stocks have managed to survive the huge fall in the market. When market is bouncing back, the two simply performs well. With 30% invested in the stock, the portfolio is performing better than the index of HS300.

24/May2017 onwards

Positions were all liquidated before and during my hiking trip to Sichuan province. The weekly KDJ was in upper cross when I departed, but as I would be in remote area and it will be inconvenient to adjust stocks, I decided to hold all repo (7d or 14d repos). In eastmoney software, I created a simulated portfolio, which reported 1.5% profit after I return from hiking.

During this round of exercise, AUM increased from 750k to 800k. Abs return is 6.6% in around 3 month, and annual compounded return is around 30%.

7/Jun/2017, I started second round of the strategy.