a blog about using technology such as python/pandas to analyze different data to dig out stories underneath.
Wednesday, 22 February 2017
My way to the Quantitative investment strategies
I have been trading in the stock market for 19 years and have been after a reliable way to earn profit. In the last few years, I found the terminology 'quantitative trading', which is very useful for me. My current career, software engineer, is a advantage for me, so that I can code myself to obtain data from various sources, finding patterns on the data, back testing my trading strategy, adjusting parameters for optimisation, applying strategies to real world and it is fantastic! I have been using ninjaTrader,VBA, python, so far I find python is the most efficient approach for me with its convenience and flexibility.
First of all, reliable data source can be found at hand thanks for the internet. Yahoo finance can sometime wrong with dividend data, I need to validate them with data from other sources. I tried to find relationships among daily share price, historic earnings and dividends. Yes, they does have tight relationship in Australia and HongKong share market.They are not in China, so I have to focus on more technical analysis in Chinese stock market.U.S share market is in the middle way of China and Australia, I have to combine interior value elements with technical element to achieve the best result.
e.g.I found highest and lowest dividend yields annually on Wells Forgo, its maximum and minimum PE every year:
Wells Forgo: historic dividend yield
Wells Forgo: historic price earnings ratio
Using my strategy to back test,adjusting parameters:
settings = dict(
Cash = 50000,
Tick ='WFC',
HighDiv = 0.05,
MediumDiv = 0.028,
LowDiv = 0.025,
HighPe = 100,
LowPe = 12,
Name ='Wells Forgo',
ObserveWindow = 7,
UpDays =4,
UpMovement = 1.5
)
to get the optimal results:
2008-01-10 00:00:00 strategy [INFO] BUY 2109 WFC at $20.96/share
2008-01-29 00:00:00 strategy [INFO] SELL 2109 WFC at $25.25/share
2008-06-09 00:00:00 strategy [INFO] BUY 2596 WFC at $20.71/share
2008-09-19 00:00:00 strategy [INFO] SELL 2596 WFC at $36.05/share
2008-10-13 00:00:00 strategy [INFO] BUY 3862 WFC at $24.94/share
2008-10-22 00:00:00 strategy [INFO] SELL 3862 WFC at $25.91/share
2008-11-14 00:00:00 strategy [INFO] BUY 3863 WFC at $23.18/share
2008-12-03 00:00:00 strategy [INFO] SELL 3863 WFC at $20.43/share
2008-12-04 00:00:00 strategy [INFO] BUY 3586 WFC at $22.63/share
2009-01-05 00:00:00 strategy [INFO] SELL 3586 WFC at $24.44/share
2009-01-20 00:00:00 strategy [INFO] BUY 5775 WFC at $13.78/share
2009-01-29 00:00:00 strategy [INFO] SELL 5775 WFC at $16.30/share
2009-02-04 00:00:00 strategy [INFO] BUY 6680 WFC at $15.49/share
2009-03-18 00:00:00 strategy [INFO] SELL 6680 WFC at $12.06/share
2009-03-19 00:00:00 strategy [INFO] BUY 5625 WFC at $14.62/share
2009-04-13 00:00:00 strategy [INFO] SELL 5625 WFC at $15.78/share
2009-04-21 00:00:00 strategy [INFO] BUY 6112 WFC at $13.86/share
2009-04-30 00:00:00 strategy [INFO] SELL 6112 WFC at $17.04/share
2012-01-04 00:00:00 strategy [INFO] BUY 4260 WFC at $24.45/share
2012-09-14 00:00:00 strategy [INFO] SELL 4260 WFC at $31.33/share
2012-11-15 00:00:00 strategy [INFO] BUY 4701 WFC at $27.89/share
2014-11-07 00:00:00 strategy [INFO] SELL 4701 WFC at $50.78/share
2015-08-25 00:00:00 strategy [INFO] BUY 4649 WFC at $51.18/share
2016-11-18 00:00:00 strategy [INFO] SELL 4649 WFC at $52.10/share
Name of the company Wells Forgo
Initial portfolio value: $50000.00
Final portfolio value: $257302.73
net profit percentage:$414.61%
I also helped some of my friends to back test their trading strategy.
They like me to do data analysis,financial modelling to forecast financial product behaviour in the future. I kept their strategy confidential and assist them win money from stock market in their own way.
BTW, strategies mean success in the past not in the future, so we should still be very cautious to use them in the real world.
Labels:
quantitative
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment