Sie sind auf Seite 1von 3

Very Simple Technical Analysis


* Introduction

I have learnt (actually I am still learning) technical Analysis from

a book called "Technical Analysis of Stock Trends" by Edwards and
Magee. This book emphasizes simplicity. The early editions explain the
types of pencils, erasers, graph paper and reading lamps that should be
used for technical analysis.

Its still possible to do technicals this way, but there are physical
limits to how many charts one can update manually. Also, the eye gets
fatigued after some time. I used to update charts manually and I was
never able to see more than 30 charts at a time. Adjusting for splits
and dividends is another pain. Using a computer is just so much better.

As a Linux enthusiast, I found many packages for charting stocks. I

created vsta because I wanted a stock/future charting application that
used only the most basic utilities, in the spirit of my gurus Edwards
and Magee. I live in India, which did not have acceptable broadband
connectivity until recently. It was important for me to create utilities
that did not use lots of bandwidth.

At the moment I use vsta for technical analysis of futures. It can

be used for stocks too but I haven't created utilities to adjust for
dividends and splits.

* Components

At the moment, there are 2 components of vsta

a. dbms
b. charting

The dbms component of vsta is a set of utilites to update price

information. I use bash, awk, sed, grep, Perl, gnuplot and R. The data
is stored in plain text, space-delimited files.

The charting component of vsta is a set of R and gnuplot scripts.

* Installation

I have installed vsta on Red Hat based Linux distros. Make sure that git,
mlocate, openssl-devel, expat, expat-devel, libxml2, libxml2-devel,
perl-local-lib, R-core, libcurl-devel and R-core-devel and perl-CPAN
packages are installed. On non-Red Hat distros, you will have to determine
the equivalent packages - unless I learn of them from using Ubuntu :)

Once these packages are installed, the user's cpan needs to be configured
to follow and install the dependencies of Perl modules that we need to
install. At the "cpan" prompt, accept all the default config options,
log out of the cpan session, re-invoke cpan and now run these commands
o conf prerequisites_policy follow
o conf commit

The required Perl modules are to be installed thus

for p in Net::SSLeay LWP::Protocol::https XML::TokeParser Test::More Module::Build

Capture::Tiny Sub::Exporter Test::Warn ExtUtils::Constant HTML::Parser
HTML::TokeParser CGI Socket HTTP::Server::Simple::CGI WWW::Mechanize Test::Output
File::ShareDir::Install DateTime::Locale Test::Requires LWP::UserAgent
ExtUtils::MakeMaker CPAN::Meta::Check B::Hooks::EndOfScope namespace::autoclean
Specio::Library::Builtins Specio::Declare DateTime JSON; do cpan install $p ; done

At this stage, the PERL5LIB variable is set to


To install the R packages that I use for charting, please run the
following commands at the R prompt.

install.packages("devtools", repos="")

install.packages(c("base", "Biobase", "blotter", "boot", "class", "cluster",

"codetools", "colorspace", "compiler", "datasets", "dichromat", "digest",
"FinancialInstrument", "foreach", "foreign", "gcookbook", "ggplot2", "graphics",
"grDevices", "grid", "gridExtra", "gtable", "iterators", "KernSmooth", "labeling",
"lattice", "magrittr", "MASS", "Matrix", "methods", "mgcv", "munsell", "nlme",
"nnet", "parallel", "PerformanceAnalytics", "plyr", "quantmod", "quantstrat",
"RColorBrewer", "Rcpp", "reshape2", "rpart", "scales", "spatial", "splines",
"stats", "stats4", "stringi", "stringr", "survival", "tcltk", "tools", "TTR",
"utils", "xts", "zoo", "BiocGenerics", "DynDoc", "tkWidgets", "widgetTools"),
repos="", dependencies=c("Depends", "Imports",
"LinkingTo", "Suggests", "Enhances"))

install_github("braverock/FinancialInstrument", repos="https://cloud.r-")
install_github("braverock/blotter", repos="")
install_github("braverock/quantstrat", repos="")
install_github("braverock/PerformanceAnalytics", repos="https://cloud.r-")

Exit the R prompt with


Now you will see that the R libraries will be installed under $HOME/R/

* Backups

I recommend rsync.

I also recommend that the 'data' directory be backed up separately.

* What about data


Make the appropriate dirs under

The actual data has to be fetched by running the scripts under
$VSTADIR/dbms. I prefer to do this via crontab.

I suggest you
cp $VSTADIR/dbms/vsta-skel/gencron.* /tmp
Now make the appropriate changes to /tmp/ and then run it as

PERL5LIB=$HOME/perl5/lib/perl5 sh /tmp/ | tee -a /tmp/crontab-vsta

Install the /tmp/crontab-vsta to your crontab