AI in Action: Capturing Stock Price Patterns using Google AutoML – by Stephen Chan

Recently I have spent some time on technical analysis of stock markets, and started to build some tools in Python to help me invest in a more systematic fashion.

There are many useful APIs in the market that allow users to download end-of-day price and volume data of stocks listed in Hong Kong Stock Exchange. Then the next step is to apply simple trading strategies to extract signals from the market eg based on closing price vs moving averages, daily volume changes or as a proportion of average monthly volume.

“… what is obvious in the market rarely works…”, William J. O’Neil

Then I came across a common problem among retail investors: the more obvious the signals, the less reliable they are. As the legendary short-sale investor William J. O’Neil pointed out, “what is obvious in the market rarely works”. Scanning stocks where prices breaking through a particular moving average is just too simple. Hence I searched for a more sophisticated approach.

Credit goes to the legendary trader Mark Minervini. His notion of Volatility Contraction Pattern (VCP) seems interesting enough. Basically it refers to a stage where the stock price fluctuates in decreasing volatility, together with trading volumes going down. There are additional conditions that the stocks have to be in an uptrend in general (more at this link).

The case for using Machine Learning

  1. Rule-based approach is not feasible: Unlike identifying price breakthroughs vs moving average on a particular date, there are no easy ways to identify the VCP pattern over a period of time. Previous efforts in rule-based filtering or fitting sinusoidal curves had not yielded any satisfactory results. Image recognition is perhaps the way to go.
  2. Actionable insights can be generated automatically: Scanning the charts of hundreds of Hong Kong stocks by human eyes is time-consuming and distracting. If 10-20 VCP stocks can be identified by the model on a daily basis, investors can focus on a much smaller set of stocks, and decide the right trading strategy in the next few days

Deployment at Google AutoML

From technical perspective, it is a problem of objection detection within the context of image recognition. The labels are stock price patterns (ie VCP), and there could be more than one label appearing in one stock chart image. The labels need to be customised when training the model. The key outputs of the model are labels and the coordinates of bounding boxes.

I tested out my first deployment using Google AutoML, and were very much impressed by the results in the first run within a week. I generated ~400 images of stock charts using Python, then uploaded to Google Cloud/AutoML via API, and identified the labels available in each image (label was the most time-consuming part as always). Although the count of labels is around 100 each, it seems to be sufficient for the model to pick up labels in new images.

The rest of the article can be found here:

https://www.linkedin.com/pulse/ai-action-capturing-stock-price-patterns-using-google-stephen-chan

UK Budget 2021: Key points at-a-glance

Chancellor Rishi Sunak has unveiled the contents of his Budget in the House of Commons.

Setting out the government’s tax and spending plans for the year ahead, he announced new measures to help business and jobs through the pandemic and to support the UK’s long-term economic recovery and a series of tax-raising plans to help rebalance the public finances.

Here is a summary of the main points.

What BBC says:

https://www.bbc.co.uk/news/uk-politics-56266773

What ICAEW Tax Faculty says:

Personal tax – the big freeze – Allowances and thresholds frozen to 2026

  • No rate changes for Income Tax (IT), Capital Gain Tax (CGT), Inheritance Tax (IHT)
  • Personal allowance and higher rate threshold increases for 2021/22 go ahead before being frozen to 2026
  • Basic rate taxpayers caught by HICBC
  • National insurance class 1 and 4 upper limits remain aligned
  • National insurance lower limits increased – future alignment possible?
  • CGT annual exempt amount, IHT nil rate bands, pension allowances frozen to 2026
  • ISA and child trust fund subscription limits unchanged
  • Dividend, savings, trading and property allowances unchanged

Personal tax – Covid-19 measures – Extensions of existing measures

  • Self assessment time to pay
  • £6pw working from home allowance for employee borne costs not yet extended
  • Cycle to work relaxation extended to April 2022
  • Universal credit (UC) and working tax credit (WTC) uplifts extended for six months
  • UC and WTC easements extended
  • Stamp duty land tax holiday extended to 30 June 2021 (applies to England and Northern Ireland); Non-residents buying residential property – 2% supplement from 1 April 2021.
  • Self-employment Income Support Scheme (SEISS) grants 4 and 5

Reform of penalties and interest

  • Late submission – penalty point system introduced
    • Points accrue separately for each tax
    • Threshold depends on obligation frequency –£200 penalty when reached
    • Expire after 24 months max
    • Can be appealed
  • Late payment penalty
    • First penalty of 2% on tax unpaid 15 days after the due date, increasing to 4% 30 days from the due date.
    • Second penalty at an annualised penalty rate of 4% accrues on a daily basis on tax remaining unpaid 30 days from due date
    • Contacting HMRC to arrange time to pay before trigger date will be crucial

Business tax changes

  • Continuation of various Covid-19 business support schemes
  • Tax deductibility of business rates repayments
  • Coronavirus Job Support Scheme (CJRS) extended to 30 September 2021
  • From 1 April 2023 onwards, small profits rate (up to £50,000) at 19%; main rate at 25%
    • Close investment holding companies will become liable to corporation tax at 25% regardless of their profits
  • Trading losses can be carried back for up to 3 years, subject to cap
  • £1m Annual Investment Allowance (AIA) continues until 31 December 2021, then returns to £200,000 from 1 January 2022
  • New super deduction capital allowances allowing 130% of qualifying plant and machinery expenditure for 2 years from 1 April 2021

Indirect taxes – VAT and Environmental Taxes

  • UK withdrawal from the EU provides an opportunity to consider VAT reform
  • In the event, there were few VAT changes in the Budget
  • VAT registration threshold frozen for two years at £85,000
  • MTD for VAT to be extended to all VAT registered traders
  • Temporary reduced rates of VAT on tourism and hospitality
  • VAT deferral new instalment payment scheme
  • Plastic packaging tax starts on 1 April 2022, £200 per tonne; 10 tonne exemption
  • Climate change levy – rebalancing of rates

Freeports and designated tax sites

Designated tax site with Freeports will quality for generous set of reliefs:

  • 10% structures and buildings allowance
  • 100% capital allowances on plant and machinery
  • Reliefs from SDLT and business rates until September 2026
  • Proposed employers’ NIC relief from April 2022

Tackling Tax Avoidance

  • Extra investment in HMRC
    • 1,265 strong team to undertake compliance checks on COVID 19 support
  • Further measures to tackle promoters of tax avoidance schemes
  • Changes to the follower notice penalty rules
  • Conditionality (tax clearances)
    • Certain license renewals (taxis, private hire & scrap metal) require tax clearance from HMRC
    • Provision modelled on more extensive regime in Ireland
    • Due to come into effect in England & Wales on 4 April 2022
  • Electronic sales suppression

If you want to understand the above more, please reach out to p.w consulting.

Sources: BBC and ICAEW

Welcome to pow consulting

Welcome to our blog that shares our thoughts on accountancy, finance, taxes, sustainability and management matters. This blog is meant for everyone, but in particular for high net worth individuals and business owners. Please note the blog posts are time sensitive and subject to changes in legislation or law. Follow along on LinkedIn.

#powconsulting

#BeingDifferentToMakeADifference

#CommunityEnabler