Thursday, March 31, 2016

2016-03-31 Trading Top5s Securities: GOOG

Markets Top5s analysis for 2016-03-31

Created snapshot 20160401-022441; shunted to google drive

scrape:
2016-03-31
Mkt_Cap:DD-A,IBM,CHL,GOOG,XOM|GOOGL,DCM,AAPL
Price:FCE.B,MDVN,SC,FIT,ANAC|NPBC,HQCL,SLW,P
Volume:BAC,PFE,MU,VRX,MRO,GE,F,FCX,EEM,T
Updated /Users/geophf/Documents/OneDrive/work/1HaskellADay/Seer/data/top5s.csv with 2016-03-31 data
bubbles:


Let's analyze GOOG, an Alphabet company.
geophf:writing geophf$ analyze GOOG
Wrote analysis files for GOOG

GOOG SMA



GOOG EMA

GOOG Stochastic Oscillators

2016-03-30 Trading Top5s Securities: RIO

Markets Top5s analysis for 2016-03-30

Created snapshot 20160330-203856; shunted to google drive

Scrape
2016-03-30
Mkt_Cap:AAPL,RDS.A,GOOG,RDS.B,FB|MTU,BA,TM,CELG
Price:LTRPB,IOC,LULU,OPK,EPE|NSR,WMS,VRX
Volume:HSBC,MT,RIO,USO,DB,VXX,BCS,EEM
Updated /Users/geophf/Documents/OneDrive/work/1HaskellADay/Seer/data/top5s.csv with 2016-03-30 data
HTTP/1.1 100 Continue
Bubbles


Active day in the markets today. Let's analyze RIO
geophf:writing geophf$ analyze RIO
Wrote analysis files for RIO

RIO SMA



RIO EMA

RIO Stochastic Oscillators

Wednesday, March 30, 2016

Standing up Haskell (GHC) on an AWS EC-2

Steps for standing up dev tools, and Haskell, on AWS EC-2

So, you’ve configured your EC-2 with the standard AWS-Linux image, and now you want to compile your sources and have running executables to demo, including in not only Java and Perl but possibly C, C++ and, for my prototypes and graph-systems, Haskell. How to do this?

Unfortunately, the AMI for Haskell is rather unforthcoming, as it seems to compile the GHC from sources, an endeavor that takes hours of AWS-time. Unnecessary. So, I’ve cut out those middle steps and have a Haskell-image on my S3 that can be downloaded and used once the dev-tools are in place.

Let’s do this.

1. Get the ghc image from my public-S3-bucket:
$ wget https://s3-us-west-2.amazonaws.com/haskell-7-10-2/haskell-platform-7.10.2-a-unknown-linux-deb7.tar.gz

2. install the dev-tools from Amazon (this takes a bit)

$ sudo yum groupinstall “Development Tools”

3. Now you need to provide a soft link to libgmp.so:

$ cd /usr/lib64
$ sudo ln -s libgmp.so.3 libgmp.so
$ sudo ln -s libgmp.so.3 libgmp.so.10
$ cd

Yes, you need both of those soft links.

4. Once you have all that done, unzip ghc:

$ sudo tar xzf haskell-platform-7.10.2-a-unknown-linux-deb7.tar.gz

5. And now ghci will work for you:

$ ghci
Prelude> 3 + 4
~> 7

YAY! Do a happy dance!

2016-03-29 Trading Top5s Securities: MSFT

Markets top5s analysis for 2016-03-29

Created snapshot 20160329-202854; shunted to google drive

Scrape:
2016-03-29
Mkt_Cap:AAPL,MSFT,GOOGL,GOOG,WFC|PTR,BAC,NVS,JPM
Price:HIMX,AYA,CNL,CXRX,SNX|BCOM,MDVN,CHK-D
Volume:RIG,OPK,EEM,SPY,BHP,VXX,BBL,RIO,BP
Updated /Users/geophf/Documents/OneDrive/work/1HaskellADay/Seer/data/top5s.csv with 2016-03-29 data
HTTP/1.1 100 Continue
bubbles:

As you see, we've added a [:PRIOR_TRADING_DAY] relation to simplify analytics: analytics need not navigate structures like 2013-03-02 to something else to get to 'ten days ago.' YAY! (ref:  Analytics.Trading.Web.Cypher.RelateDays)

Let's analyze MSFT
geophf:writing geophf$ analyze MSFT
Wrote analysis files for MSFT



Huh! All of tech is on the up-and-up!

MSFT SMA



MSFT EMA

MSFT Stochastic Oscillators

Monday, March 28, 2016

2016-03-28 Trading Top5s Securities: P

Market Top5s analysis for 2016-03-28

Created snapshot 20160328-214956; shunted to google drive

scrape
2016-03-28
Mkt_Cap:TM,GE,PBR.A,BRK.B,MSFT|AAPL,PFE,UNP,AMZN
Price:ALDR,FCE.B,ACAD,CIG.C,P|HQCL,NBL,RDUS,ARIA
Volume:BAC,GE,FCX,PFE,VRX,WLL,PBR,P,MU,MRO
Updated /Users/geophf/Documents/OneDrive/work/1HaskellADay/Seer/data/top5s.csv with 2016-03-28 data
bubbles

let's analyze P for Pandora media https://www.google.com/finance?cid=4592563


geophf:writing geophf$ analyze P
Wrote analysis files for P
P SMA

P EMA

P Stochastic Oscillators



Friday, March 25, 2016

2016-03-25 Markets closed: Good Friday

Today the Markets are closed.
geophf:1HaskellADay geophf$ ghci stock-market/trading-cal.hs
*Main> cal "stock-market/trading-cal.tsv" ~> tc
*Main> Map.lookup (read "2016-03-25") tc
Just (Closed "Good Friday")
Yup.

Thursday, March 24, 2016

2016-03-24 Trading Top5s Securities: PTLA

Markets top5s analysis for 2016-03-24

Created snapshot 20160325-000818; shunted to google drive

Scrape
2016-03-24
Mkt_Cap:AMZN,ACN,VZ,IBM,WFC|TM,AAPL,WBK,BRK.B
Price:SPIL,P,ODP,PTLA,CXRX|AM,UTHR,SWHC
Volume:BAC,FCX,F,PFE,MT,CHK,ABEV,ITUB,MRO,WLL
Updated /Users/geophf/Documents/OneDrive/work/1HaskellADay/Seer/data/top5s.csv with 2016-03-24 data
bubbles





Let's analyze PTLA
geophf:writing geophf$ analyze PTLA
Wrote analysis files for PTLA
PTLA SMA

PTLA EMA

PTLA Stochastic Oscillators 

2016-03-23 Trading Top5s Securities: AMZN

Markets Top5s analysis for 2016-03-23

Created snapshot 20160324-122048; shunted to google drive

scrape
2016-03-23
Mkt_Cap:AMZN,JNJ,V,PTR,GILD|NKE,BABA,CVX
Price:POM,VA,HQY,AYA,INSY|OAS,TCK,CHK
Volume:PTLA,USO,EWZ,SPY,RIO,MT,SDS,UWTI,ERIC
Updated /Users/geophf/Documents/OneDrive/work/1HaskellADay/Seer/data/top5s.csv with 2016-03-23 data
HTTP/1.1 100 Continue
bubbles

let's analyze AMZN



geophf:writing geophf$ analyze AMZN
Wrote analysis files for AMZN
AMZN SMA



AMZN EMA

AMZN Stochastic Oscillators

Wednesday, March 23, 2016

2016-03-22 Trading Top5s Securities: AGRO

Markets Top5s analysis for 2016-03-22

Created snapshot 20160323-073132; shunted to google drive

Scrape
2016-03-22
Mkt_Cap:AAPL,AMZN,AMGN,TM,RDS.B|RDS.A,HSBC,PTR,LYG
Price:AKRX,VRX,AGIO,GIII,DF|AGRO,INFN,MFRM
Volume:NGD,LNG,BTG,SYRG,FAX,GSAT,NG,TXMD,CEF,IMO
Updated /Users/geophf/Documents/OneDrive/work/1HaskellADay/Seer/data/top5s.csv with 2016-03-22 data
bubbles


Bleh! The markets are just bleh, today!

let's analyze AGRO, a big loser today
geophf:writing geophf$ analyze AGRO
Wrote analysis files for AGRO

AGRO SMA



AGRO EMA

AGRO Stochastic Oscillators

I, in principle, don't like holding companies. They just muddle the markets. But who am I to criticize a $1+ billion company?

Tuesday, March 22, 2016

2016-03-21 Trading Top5s Securities: BAC

Market Top5s analysis for 2016-03-21

Created snapshot 20160322-124832; shunted to google drive

scrape
2016-03-21
Mkt_Cap:PM,FCE.B,STZ.B,QVCB,DD-B|KSU-,TAP.A,CHK-D
Price:FCE.B,HL-B,GXP-D,CHK-D,KSU-|QVCB,GZT,BSM
Volume:RIG,SPY,GDX,VRX,BAC,AGRO,NOK,BP,PBR
Updated /Users/geophf/Documents/OneDrive/work/1HaskellADay/Seer/data/top5s.csv with 2016-03-21 data
bubbles

let's analyze BAC
geophf:writing geophf$ analyze BAC
Wrote analysis files for BAC

And this is what happens when you do a related-companies study just before the markets open :/



But BAC analyses work fine ...

BAC SMA



BAC EMA

BAC Stochastic Oscillators

Sunday, March 20, 2016

Share a Public-Acess/Read-only Clone of your Graph Database

Problem

So, you want to show off the amazing tech you've been developing to your potential buyers using Graph Database technology. How do you do it safely?

Well, the safest way is not to and you can show off power-point presentations to your heart's content.

But the power-point presentation, no matter how slick, is nothing to what your graph database can do for your customers, and you know it, and I know it. Believe me, I've been involve in generating twenty power point presentations, and the customers just don't get it until you put the graph database in their hands and let them play with it (that's what I do, and that's how we got the sale, and then the follow-on contract).

Solution

So, back to sharing your graph database safely. How do you go about doing that?

We use grapheneDB.com as our DaaS over neo4j graph database, and they provide tools that makes sharing a copy of your database safely a cinch. Let's see how.

Let's say you have this graph database in your private access that you wish to share:


You're not going to share your database (you could, but we won't in this walkthrough), instead, we'll make a clone of that database. Here's how.  As you see, you have an [upgrade/clone] option for your database, select that.

Clone Database

By selecting [upgrade/clone] you have two options: clone from running database that involves downtime (that's why I'm doing this on a Sunday, see), or clone database from a backup. 


As you've been making daily backups (link) – right? – you can select the clone from a backup option. This is available at the professional editions. As I have a developer database here, I'll be cloning directly from this currently running database.

That's the top-half of the page, the second half is choosing what the cloned database will look like, which will be usually be the same configuration as your source database. The one field you need to supply is the new database name. Since this is a public access database, I'm prefixing the new name with 'PUBLIC': a little reminder-tag for me.


Once you have the configuration you desire for the new database select [Create database]. You get a nice little warning. Select [Continue].

Then you get the spinny-box as it creates the new database...

la-di-dah! Then you have your new database! YAY!


Configure New/Cloned Database to Read-Only Mode

But you're not done yet! We wish to provide public access to our database, but we don't want our adoring public to be creating THREE BILLION NODES on their own and drive you out of business.

Not that they would do that, ever, but still.

So, let's make this public-facing clone safe for access by making it read-only. Go to the Configure-tab on your new PUBLIC database. There you see that the read-only mode is "DISABLED":


Let's change that. Select [Edit configuration], and then select the "Enable"-link under Read only mode. Once you do that, select [Apply and restart].


You get a warning-dialog, so, again, select the red [Apply and restart] in this dialog:


You again get a 'restarting database'-spinny:


Then a confirmation at the top of your browser that your database has been restarted with the new configuration:


So that now, when you select the Overview-tab, you are reinforced with the confirmation that your database-clone is now in read-only mode:


Confirmed Read-Only

Let's confirm this by trying to create a node in the neo4j browser. Select [Launch] in your Overview-tab. Since this is the first time for this brand-new (cloned) database, you get the standard disclaimer-dialog:


Select [Launch browser], then, create some J-Random node named 'Foo' or whatevs. You, thankfully, get back the 'Could not create token'-message. You've verified your database is in read-only mode.


So, now you can share your database, as it's a clone of your original database (I leave data-masking for you to figure out), and it's in read-only mode.

Share Cloned Read-Only Database

But how do you share your database?

Go to the Connection-tab for your database and there it contains the connection information, including username and password as well as the connection URI or the REST URL for accessing your database.


BOOM-BAM, BABY! You now have provided a public-access read-only copy of your database! And, as it's provided by grapheneDB.com DaaS, either by AWS or Azure (your choice; grapheneDB allows either), it is demoable anywhere you have internet access.

You are in business! It's up to you how you wish to present the data (transformed, masked, or straight up) or to scale the data (a part of your database or all of it) as your public-access database.


Now: go to! Go to!