Showing posts with label stock picking. Show all posts
Showing posts with label stock picking. Show all posts

Saturday, 3 September 2011

day 3 - nothing for free

all of this has now been running for one year.

has this worked ? predominantly yes

getting up signals is not too much of a problem, with the best alpha's this is over 80%, one alpha approaching 100% (alpha7) but only produces a stock pick on average about once per month, which is great if you want 11.5% per month, I need 20 alpha7's.

the sell signal is a little more problematic

currently I am working on a flat 11.5% up from buy price to sell, which I am trying to reduce to between 3 and 5 days giving me the required about 3% per day.

my trading strategy needs some thought now

day 2 - next 6 months

so here we are with a system that downloads eod data each evening, uploads to a database and then calculates some indicators

psars are calculated on close, open, high, low and vol (although psar on vol is a little strange to say the least because the numbers involved are so large), as well as psars of open up and close down and high up and low down (psars trip at the top and bottom of trends, so these switch the up and down basis)
to make sure we have a trend we need the other indicators:
adx, vi and st are calculated as per wikipedia.
psars on vi and macd are also calculated just for fun and have proven very useful, as is the psar on the close psar

I enabled the embedded web server in the database and output reports to a web page, my ip is static and the database allows the creation of http code - I have programmed an http5 canvas reporting system. OEL has apache 2.2, may use this if I split the server into web and dbase in the future, but simple is the name at the moment

the interesting analysis happens when I link the indicators... as these are the start of the stock picking process I have called these alpha's.

alpha's consist of statements such as

show me all companies which have an average volume greater than 10 x 10,000 / close price (indicating that buying and selling of the shares will not be a problem), that over the last 10 days have had a minimum st of 0, +adx is greater than -adx, psar on vi is positive but was negative over the last 3 days, psar on macd is positive but was negative over the 3 previous days and the psar on close is positive with the previous 3 days being negative, and give me all companies that follow this rule from 1st Jan 2010 to the present day

this is approximately alpha 12, an alpha that works very well

the coding of alpha's interface is also via a web page, so the development cycle is I pick which alpha I want on a web page, edit, save, run, check resulting company charts, all via the web.
for live alpha, I merely run and due diligence the companies coming out with the date of today.

I run this statement from a specific date and can gauge effectiveness of alpha's, at the same time have programmed a routine that automatically goes through the alpha's and indicates which are good and which are not, this takes a lot of processing. current analysis is choosing companies at random and checking out movement, if price goes up after indicated date, then choose another company until I find one that does not follow the up rule and start the process of finding out what indicator runs against the other companies. I do this iteratively, each time changing the code and then running and checking again. each time the number of returned companies that follow the rule reduces - the art is to not restrict the companies to an extent that no companies are returned, but return all companies that increase in value over the proceeding days.

the production of a fully tested alpha takes weeks

the result is that I have built up and am building a set of alpha's that under specific circumstances indicate a good probability that the company share price will go up...

day 1 - first 3 months

with an interest in number manipulation, databases, finance and beating systems, I have set about doing all 4 - this is the story of my journey

trading, that sounds interesting. a little digging and the next thing I know I am developing a system and buying a server.

so...

lets have some fun with the stock market, all indicators point to this being the biggest game in town

it seems that this game is where you pick a company, buy some stock in said company and watch while either the value of your stock increases or doesn't - the first stage of this process is the choosing of the company stock, and where I start

anyone who has tried to stock pick knows it is not easy, random picking works randomly, which means that there has to be a system.

the premise is that money can be made from stocks and that the system is geared in some way making this possible - there is no point in carrying on if this is not true -
if the premise is true then we can get data, manipulate it, report on it to pick stocks with certain indicators/patterns and trade

dont want to get bogged down with the due diligence although some has to be done - this is not the point and as a black art as stock picking itself and highly dependent on market sentiment - I have heard of systems tracking posts on forums, texts and news reports looking for company names and then calculating the overall tone of the post to indicate sentiment - this is not what this is about but I am not discounting it in the future.

its a game, ok with real money but still a game, a serious game.

and so to set up...

what is available data wise ?
seems that easy to get data is stock close, open, high, low and vol at the end of a day
(I am looking at stocks only at the moment, options and derivatives will come later as will shorting - at the moment keeping it simple and going long on (buying) equity only)
there is other information available but I have to start somewhere.

what indicators are out there - indicators that tell us how a stock is doing ?
I have chosen:
psar, vi, adx, st, macd and rsi - Wikipedia, yey - all will be explained - there are others, I have chosen these for the moment
psar is interesting as this is the one indicator that tries to look into the future whilst the others are looking at the past. remember the name... parabolic sar

how about another goal ? 1 million, 1 year, from 10,000 which equates to approx 2% per day compound - surely this is possible ? on 2% this gets interesting at about day 90 when funds reach about 50,000

my system... I like oracle. I like unix and windows. unix for the server (oracle enterprise linux), windows 7 and ubuntu for the laptop for testing
the server is currently a 12 core Xeon with 24Gb ram and ssds, lots of fans and lots of noise, and a ups;
the laptop is an i7, dual boot win7 and ubuntu and gets very hot when in full calc mode
downloaded data manipulated with sed and awk, scheduled with crontab, and uploaded to the database, validated and then the calcs start, all in the evening over night...

buying stock... a First Direct sharedealing account seems a fair place to start, internet based - there is stamp duty and trading costs, must remember to add these to the 2% per day.

being uk based I look at LSE and see where data is out there - first land on google finance.
create script (wget) to download all data via http from all companies each evening... I guess google does not like to be whacked and found data missing and a rather nice error message saying that google thinks that the ip address is up to no good and has decided not to send, reeks havoc with my calcs. the exact same thing then happens with yahoo finance
need a reliable source of end of day (eod) data - a quick search and 25 a month later I have a regular feed of eod data, and ftp access, yey.

so the scene is set...