Pegex uses the type of grammars called Parsing Expression Grammars (PEG), which is an unambiguous form of writing a grammar. Each parsed string will in effect have a single valid parse tree. Since Pegex converts the rules of the grammar to regular expressions, it is a greedy parser.
In this blog post we demonstrate how to easily use Pegex to parse an /etc/hosts file on Linux and convert the result into Perl objects automatically without having to manually create any object.
For more details check out the original blog post by me here.
]]>This is more a problem with copy-paste style coding and bad testing of MITM attacks.
]]>I finally found time to learn PDL and to learn to use it to perform Technical Analysis on data such as stock quotes. My aim is to learn how to use PDL efficiently and write a technical analysis library that mirrors what may already be available for C/C++ using say TA-Lib and other custom libraries that may be written in-house.
With this in mind I started writing PDL::Finance::TA which I shall expand as time progresses to contain all possible technical analysis functions and more. Hopefully, this project will enable me to learn PDL, and provide other Perl users tools to quickly use PDL to perform financial modelling and maybe make some money.
As of today, 4th January 2014, PDL::Finance::TA
has only one function movavg
which is the moving average over a single dimension of data. In other words, it is a simple smoothing filter. Simple Moving Averages are a very common technical analysis tool that are used in conjunction with other tools which I will get to in the future write-ups.
Here is a quick way to use the movavg
function:
use PDL;
use PDL::Finance::TA 'movavg';
my $p = sequence(50);
my $ma13 = $p->movavg(13);
Another example is provided in movavg.pl which downloads end-of-day quotes from Yahoo! Finance and plots the 5, 13 and 21 day moving averages on the close prices for 1 year. Below is a screenshot of what that looks like using PDL::Finance::TA
and PDL::Graphics::PGPLOT
.
As time progresses, more functions and examples shall be added demonstrating the use of PDL in performing financial research.
]]>However, if this is a pet project to just build software that might already exist then that is your choice.
]]>