Thursday 31 October 2013

twitter, FX and working in Europe

Working in Europe got me thinking about my currency exchange timings and so have been working on the analysis of GBPEUR, GBPUSD, EURUSD and the reciprocals, USDEUR, USDGBP and EURGBP and these are now being tweeted on @space_FX or https:twitter.com/space_FX.

The London Stock Exchange twitter feed name has changed to space_LSE - @space_LSE or https://twitter.com/space_LSE

But back now and have been trading here on the space_LSE feed with some very good results.

Sunday 1 September 2013

ORE II

its taken a little more than the 5 days, and this will be logged in the current Markov Chains, but ORE has now reached its desired level and continuing up. :-)


Thursday 20 June 2013

And legs for opera

As you will probably have seen, Twitter had changed its authorization scheme from XML to JSON meaning that the Oracle PLSQL XML based tweets no longer worked. I have been working hard to re-establish this process and have now completed my testing, and we are tweeting from oracle once again.

I have just Tweeted all companies that have been missing since Twitter changed the Authorization on the 11th June 2013. The twitter link is in the heading.

I have been able to accomplish v1.1 twitter app authorization by writing an external Perl script. This is not as difficult as it first appears although you will need to get all your ducks lined up in a nice row.

Chronologically, this is done by:

1. go onto http://search.cpan.org/ and first off make sure that your Module::Build is up to date - there are a couple of ways to do this dependent on if you are working with windows or linux. linux is pretty easy because one runs cpan as root, and then types in 'insert Module::Build'. On windows its a search and download and then copy the lib files to one of the Python @INC paths - if one runs "perl -e 'use Module::Build;'" you will see errors if this is not loaded, and you will see the path if you get an error.

2. cpan Net::Twitter

3. cpan DBI

4. write your Perl script to access the database and tweet.

The following is a very simple Perl script to test if one has competed everything as required:
(of course you will need the tokens and secrets from Twitter here)

--=====================
#!/usr/bin/perl

use Net::Twitter;

my $nt = Net::Twitter->new(
    traits              => [qw/API::RESTv1_1/],
    consumer_key        => 'xxx',
    consumer_secret     => 'yyy',
    access_token        => 'zzz',
    access_token_secret  => 'aaa',
);

$nt->update({ status => 'Hello world' });

--=====================

save this as tweet.pl and then run as 'perl tweet.pl'

And Robert is your father's brother.

Comment or email if you are doing something similar and would like help.

Tuesday 28 May 2013

High level oasis diagram

To the right is a diagram of oasis' high level processes.
Currently working on the indicators (looking at log-gammas as well as optimizing current indicators), the Context and Calculate Indicators processes (putting into external C programs)

Sunday 26 May 2013

Ubuntu 13.04, Oracle 11gR2, external C programs, OCILIB

Wanting to optimize the processing and so am in the process of converting the PL/SQL for the indicator algorithms into external C programs using OCILIB.

Because I am working away from my server at the moment, and in the process of setting up ssh, I decided to put Oracle 11gR2 onto my Ubuntu 13.04 laptop. This is not really an easy process, but essentially we have the Ubuntu 12 implementation here - except we no longer need the libstdc++5 library (the link is not valid in any case, but you can find these on the Ubuntu archive site if you search for libstdc++5 if indeed you feel that you need it). This process needs to be integrated with the following document here, taking into consideration that we are installing on a deb system and not OEL 6, the important pieces are the setup of the system parameters.

Be mindful that you should install the software only first using the above guides. After implementing both guides, run 'relink all' from the $ORACLE_HOME directory. Then run netca to create the listeners and dbca to create the database itself. Then redo the Enterprise Manager having first created a password file (this is important) using emca.

The chronological order of these is ultra important otherwise you will get an 'ORA-12547 TNS lost contact' error.

Then its a question of making sure that the listener is setup correctly, this guide will help.

Also you will find that the init'dbname'.ora file is not created in the dbs directory; copy from the sample and enter the correct info, comment out the audit lines, and put in the correct Control file information.

Then OCILIB setup, and allow external program access, full database access info "host:port/service name" for the OCI_ConnectionCreate function and Robert is your father's brother.

Then its compile your programs using the following options:


gcc -Wall cprog1.c -o cprog1 -I/usr/local/include -DOCI_IMPORT_LINKAGE -DOCI_CHARSET_ANSI -locilib


This gives me is a much faster turnaround time for the rather complex and long running algorithms on PL/SQL, and allows me to play with even more complex algorithms that I have been thinking about which necessitate the use of OpenMP which I'll describe in other posts.

Comment if you need help to do something similar.

Thursday 28 March 2013

SLG, VPHA and URA

Of note, whilst we are waiting for ORE and HALO, are some current risers tweeted either yesterday or the day before:

SLG 41% today
VPHA 14% today
URA 12% today

One aspect to note from the SLG tweet is that the volume was 101 times the 3 monthly average volume, and currently today LSE is reporting 25m sells and 6m buys, with a 15% spread.

Friday 15 March 2013

HALO

HALO

#LON:#HALO:14-MAR-13:#LSE_trace::115.9:100:9:4.38 http://t.co/MDwwsRqgSo

As you can see HALO's chart looks similar to ORE's and was also tweeted today, but with average 115.9% increase with a 7.41% spread at a current price of 27.5 and a fair cap of 7.5m GBP.

Meaning over the next 5 days we should see the price go to about 59.4, but our 11.5 % + 7.41% spread should take us to 32.7.

GLA and DYOR.


ORE

As an indicator of what I have found to be a prediction of something going on lets make a prediction here. ORE.

ORE came up on the Tweet yesterday for triggering today. The tweet reads:

::14-MAR-13:::49.6:100:4:.4

and currently there are sells of 2,235,040, and only sells (at least that is what LSE is reporting, L2 shows about 50% of these are buys),  with the price holding at 0.41 with a spread of 2.5% and is a fair size at 8.8m GBP cap.

what oasis is saying is that over the next 5 days ORE should reach 0.41 plus 47.1% (on average) giving  0.60, but as I am only looking for 11.5% I am looking for 0.47 (0.41 * (11.5% required + 2.5% spread)).

Lets play.

Tuesday 12 March 2013

NEOS

Would like to highlight NEOS which came up on oasis Twitter feed on 22nd Feb with a closing price of 0.105, it is currently 0.71 with an increase today of 389%.

Watching the other companies coming in on target too, although the 5 day rise is actually currently running at about 10 days, but each day at least one comes in that has been highlighted, as well as NEOS we have ARC up 16.7% just today.

I am working on the some more statistics on the rises and also tying in the success coefficients to the spread.

The Twitter feed link is in the heading of this blog, just above.

Friday 22 February 2013

TRV

TRV did very nicely today after being triggered yesterday, up 18%

Friday 15 February 2013

CAD

CAD is doing quite nicely today, was triggered on the 12th Feb, and today (15th Feb) currently up 29%.

Wednesday 13 February 2013

Success coefficients


I have aligned the trace and candlestick success coefficients to mean the same - tweedle dee is expected percentage rise and tweedle dum is the percentage time this has occurred.

As an example below is the tweet from today for a company named CAF:

@spacecadet99999: 

#LON:#CAF:13-FEB-13:#LSE_trace::23.9:100:16: 4.13 http://t.co/MPZaFd4x

This reads as:

On the London stock exchange, for the company CAF, on 13th Feb 2013, the trace was triggered with a prior 100% success rate of obtaining 11.5% increase within the following 5 days, on the 16 occurrences this trigger happened previously, with previously the price rise averaged 23.9%, and had today a volume 4.13 times the average 3 monthly volume. The final piece is the link to the LSE website for this company.

So dee is 23.9, and dum is 100, along with the count (16) and the volume analysis (4.13) gives the map for this company. 

Friday 8 February 2013

STK

STK from two days ago (in the legs for opera page) just went up 40% today. I will change the limits on the tweets for this type of exceptional situation.

Wednesday 6 February 2013

Bid and Ask Size

It seems that trades that are dealt with by Market Makers work on the basis of Size both for Buying and Selling.
What this has meant to me is that trying to sell 100,000 BLU when the Ask Size is 70,000, the trade will not appear on L2 and that more disturbingly it may not get executed, even if the price is within limits.

Thankfully the Bid and Ask Size are on L2 and so this is another aspect of trading that really needs to be added to the whole process and which I can monitor now.

Learning something every day.

recap III

Quite a few things have changed since the last update and so lets do another one.

This is all about getting a system that I have built called 'oasis' to deliver triggers as to when to buy shares, currently geared to the London Stock Exchange as I am based in the UK, but with the ability to easily integrate other exchanges - I have run tests on NYSE, NASDAQ and FX and these worked well, so am just waiting for someone to say they would like to see these and I will reinstate. 

oasis brings down via ftp, the end of day data each evening, cleans and uploads to a database. And then the calculations start.

We have 3 trigger processes, Candlesticks, Trace and Betas.

Candlesticks

This is the usual Candlestick algorithms with added bespoke relationship algorithms. We have 8 indicators related to the relationship between periods (day).
We calculate for each company the Markov Switching Multifractal (MSM) for each individual company for these 8 Candlestick indicators. 
Each evening we compare the daily calculated indicators against the MSMs and Tweet any that have a greater than 11.5% rise indicated greater than 95% of the time.
The Tweet contains 2 specific indicators, for want of better names I have called Tweedle Dee and Tweedle Dum which are average percentage price increase and percentage times that this has risen respectively. The Tweet also contains the number of times this has triggered and the day's volume as per the average 3 monthly volume, and are labelled LSE_cs.


Trace

After End Of Day data upload all indicators are calculated (PSAR, MACD, ADX, VI, RSI, Stochastics, Bollingers and quite a few mixed combinations of these such as the PSAR on the MACD)
Each one of these indicators and combinations has been assigned an alphabetic letter for the trigger, and for every combination of 6 of these indicators we have calculated the MSM prior to the End Of Day data upload. I noticed that more than 6 indicators resulted in very limited results. Examples of this are given in this blog here.
We then compare the daily calculated indicators with the stored MSM.
As an indicator the calculation of the MSM takes about 1.5 hours per company, and takes about 4 weeks of processing to complete the whole LSE exchange companies. This process is scheduled to run constantly.
All the trigger indicators are condensed into 2 indicators again called Tweedle Dee and Tweedle Dum, which are essentially the number of indicators triggered and the number of times this has been triggered.
After daily comparisons have been made, any companies that meet the specific criteria are tweeted under LSE_trace. The Tweet also contains the number of times this has triggered and the day's volume as per the average 3 monthly volume.


Beta

This is a fully bespoke and manual set of instructions the user can enter and test. This incorporates an HTML sql interface to the database along with full reporting capabilities.


There are two servers, one production that tweets and one development that tests new algorithms.
The production server is a 16 core Xeon processor, multiple solid state disks and 32 gigs of RAM.
The development server is a 12 core Xeon with ssds and 24 gigs of RAM.
Both servers run Oracle Enterprise Linux and Oracle 11g Database.

Email or comment if you would like more information

--- 
when does the Narwhal bacon ?

Legs for opera

No Tweets today but, there is one Candlestick triggered company of note, STK, that got filtered because tweedle dum was only 84%, but the exceptional aspect was that this related to 63 occurrences with an average 36% price increase. Lets see how this gets on:

05-FEB-13 STK LSE LSE_cs uuu0202021313 63 36.06 84.13

Please note that we are currently filtering at 95% occurrence probability and so a lot fewer tweets.

Sold BLU today splitting volumes with a 28% return.

Tuesday 5 February 2013

BLU

BLU is worth watching. Managed to buy in this morning prior to the 83% rise, but even though we had a sell at 11.5% the sell was not executed. Currently we have a 21.34% increase on BLU. But this does highlight the vagaries of the buy/sell process. We also did not see our sell trade on L2 and so really do not know what is going on, but would assume this to be all part of the game play. Will be experimenting with sell volumes and trying to see what the Market Makers are doing. Every step in this process seems to have its own agenda and the game is to enable some advantage to our side. Anyone have any views ? 

Sunday 3 February 2013

Candlestick analysis

Looking back at all of the Candlestick Tweets since November 2012, we have not done too badly - column definitions are in a previous post, but to clarify tweedle dee (tdee) is the average percentage increase from the Markov Fractal Chain calculations, and tweedle dum (tdum) is the percentage times this Candlestick set has been triggered and achieved the over 11.5% price increase (all are 100%):


F_CO
F_DATE
F_BETA
F_COUNT
F_TDEE
F_TDUM
VOL_
VOLANA_
CLOSE_1_
OPEN_
HIGH_5
PERC_5
PERC_10
PERC_15
PERC_30
PERC_120
AUMP 30-JAN-13 LSE_cs 3 19.33 100 79 0.01 18 14 18 28.6 28.6 28.6 28.6 28.6
BLU 24-JAN-13 LSE_cs 4 24.5 100 75000 0.83 0.3 0.25 0.3 20 20 20 20 20
JMCS 23-JAN-13 LSE_cs 3 83.17 100 1988 0.1 2.625 1.16 12.99 1019.8 1019.8 1019.8 1019.8 1019.8
BLU 15-JAN-13 LSE_cs 3 28 100 11107 0.13 0.275 0.265 0.3 13.2 13.2 13.2 13.2 13.2
SPE 14-JAN-13 LSE_cs 3 26.9 100 2109 0.05 6.625 6.55 7.25 10.7 22.1 22.1 22.1 22.1
UVEL 10-JAN-13 LSE_cs 3 19.3 100 200000 0.49 0.525 0.5025 0.55 9.5 10.4 10.4 10.4 10.4
ADS 31-DEC-12 LSE_cs 5 19.06 100 375000 0.45 0.035 0.037 0.04 8.1 8.1 21.6 21.6 21.6
BRNS 21-DEC-12 LSE_cs 3 444 100 2116 0.11 0.275 0.06 0.365 508.3 508.3 508.3 508.3 508.3
BLU 21-DEC-12 LSE_cs 3 28 100 100000 0.5 0.325 0.25 0.325 30 30 30 30 30
CRHL 21-DEC-12 LSE_cs 5 25.38 100 269019 1.13 0.35 0.3 0.35 16.7 16.7 16.7 16.7 16.7
ADS 19-DEC-12 LSE_cs 5 19.06 100 500000 0.51 0.035 0.02 0.04 100 100 125 125 125
AUMP 14-DEC-12 LSE_cs 4 23.3 100 5204 0.37 18 14 20.5 46.4 46.4 46.4 62.4 62.4
ADS 11-DEC-12 LSE_cs 5 19.06 100 150000 0.15 0.04 0.03 0.035 16.7 33.3 33.3 50 50
CMI 05-DEC-12 LSE_cs 3 50.27 100 10062 0.03 0.925 0.888 1 12.6 12.6 12.6 12.6 12.6
ATI 22-NOV-12 LSE_cs 4 17.38 100 131 0.01 71.75 62.5 74 18.4 18.4 18.4 18.4 18.4
ADS 20-NOV-12 LSE_cs 5 19.06 100 248000 0.25 0.04 0.037 0.04 8.1 8.1 8.1 21.6 21.6
FASS 13-NOV-12 LSE_cs 3 29.53 100 15431 2.4 5.005 3.52 5.01 42.3 42.3 84.7 169.9 337.2

Thursday 31 January 2013

1-Feb-2013


The following are the companies tweeted over the last couple of days on the tweet site:

https://twitter.com/spacecadet99999


F_CO
F_DATE
F_BETA
F_COUNT
F_TDEE
F_TDUM
VOL_
VOLANALYSIS_
CLOSE_1_
OPEN_
HIGH_5
PERC_5
PERC_10
PERC_15
PERC_30
PERC_120
QIL 31-JAN-13 LSE_trace 4 1000 14892 2700 3.07 0.975






AUMP 30-JAN-13 LSE_cs 3 19.33 100 79 0.01 18 14 18 28.6 28.6 28.6 28.6 28.6
YKBD 30-JAN-13 LSE_trace 4 5296 1608 320000 7.79 2.9178






MGHC 30-JAN-13 LSE_trace 3 216 1416 587873 1.73 2.4 2.74 2.74 0 0 0 0 0

Wednesday 30 January 2013

No triggers or tweets today


I have been analyzing the companies that have not as yet reached close to 11.5% but were triggered in Jan 2013. These are AUR, HIW, FTD, MIRA, SIE, GBP and HVT. And of course HDY and WNER from the day before yesterday

To make it easier to follow I have added LSE links to the companies below.


F_CO
F_DATE
F_BETA
F_COUNT
F_TDEE
F_TDUM
VOL_
VOLANA_
CLOSE_1_
OPEN_
HIGH_5
PERC_5
PERC_10
PERC_15
PERC_30
PERC_120
WNER 28-JAN-13 LSE_trace 3 1034 1723 20000 0.09 1.56 1.85 1.85 0 0 0 0 0
HDY 28-JAN-13 LSE_trace 3 239 297 6058 0.12 111 108.75 109.5 0.7 0.7 0.7 0.7 0.7
BLU 24-JAN-13 LSE_cs 4 24.5 100 75000 0.83 0.3 0.25 0.3 20 20 20 20 20
JMCS 23-JAN-13 LSE_cs 3 83.17 100 1988 0.1 2.625 1.16 11.52 893.1 893.1 893.1 893.1 893.1
HVT 21-JAN-13 LSE_trace 5 2000 203 100 0.1 337.5






TND 18-JAN-13 LSE_trace 4 1955 1680 53 0.02 79.5 78.75 85 7.9 7.9 7.9 7.9 7.9
AUMP 18-JAN-13 LSE_trace 3 1063 1614 10366 1.02 18 14 22.74 62.4 62.4 62.4 62.4 62.4
VPHA 16-JAN-13 LSE_trace 4 1665 480 870242 1.67 0.735 0.735 0.75 2 8.8 8.8 8.8 8.8
BLU 15-JAN-13 LSE_cs 3 28 100 11107 0.13 0.275 0.265 0.3 13.2 13.2 13.2 13.2 13.2
SPE 14-JAN-13 LSE_cs 3 26.9 100 2109 0.05 6.625 6.55 7.25 10.7 14.5 14.5 14.5 14.5
GBP 11-JAN-13 LSE_trace 3 531 1090 1216235 6.15 8.875 9.4 9.4 0 1.1 1.1 1.1 1.1
TRP 11-JAN-13 LSE_trace 3 645 203 3921277 0.9 2.275 2.2885 2.79 21.9 21.9 21.9 21.9 21.9
UVEL 10-JAN-13 LSE_cs 3 19.3 100 200000 0.49 0.525 0.5025 0.55 9.5 9.5 9.5 9.5 9.5
SIE 10-JAN-13 LSE_trace 3 1157 1804 150182 0.51 83.36 83.575 85.025 1.7 1.7 1.7 1.7 1.7
AUMP 08-JAN-13 LSE_trace 3 1063 1614 2414 0.27 18 13.91 18 29.4 47.4 63.5 63.5 63.5
FTD 03-JAN-13 LSE_trace 3 1611 1419 2758 0.25 67.75 67 67.75 1.1 1.1 1.1 1.1 1.1
HIW 03-JAN-13 LSE_trace 3 990 990 2844048 0.62 0.89 0.929 0.929 0 0 0 0 0
WTRW 03-JAN-13 LSE_trace 3 209 580 4315 0.05 8 7.5 11.75 56.7 66.7 66.7 66.7 66.7
AUR 02-JAN-13 LSE_trace 5 3041 1855 1483115 11.33 3.625 3.8275 3.95 3.2 3.2 3.2 3.2 3.2
PCTS 02-JAN-13 LSE_trace 3 654 3340 77576 5.42 8.25 7.02 8.5 21.1 21.1 21.1 21.1 21.1
HVT 02-JAN-13 LSE_trace 5 2000 203 500 0.51 337.5 300 370 23.3 23.3 23.3 23.3 23.3