Finance::Shares::is_rising - Indicate direction of trades
Two examples of how to specify a rising line, one showing the minimum required and the other illustrating all the possible fields.
use Finance::Shares::Model; use Finance::Shares::is_rising; my @spec = ( ... lines => [ ... minimal => { function => 'is_rising', }, full = { function => 'is_rising', key => 'on balance volume', style => { ... }, shown => 1, order => -99, }, ... ], ... samples => [ ... one => { lines => ['full', 'minimal'], ... } ], ); my $fsm = new Finance::Shares::Model( @spec ); $fsm->build();
This line attempts to interpret the volume of trades as an ebb and flow. It is assumed that when the closing price is higher than the previous day, the volume was buying, and that selling is happening if the price is falling.
Although a gross simplification, it is still a useful approximation.
The results are normally displayed on an 'analysis' graph as the changes may be positive or negative values. WARNING: if you specify a graph for the rising line, it will NOT relate to the Y axis. '0' will probably be around the middle (vertically) of the rising line, while for the Y axis, '0' may well be below the bottom of the page.
To be any use, there must be a Finance::Shares::Model specification lines entry that has a function field declaring the module's name. Then the entry's tag must be used by a sample in some way. This may be either directly in a line field, or by referring to it within a test.
There are no significant options.
Required. Must be is_rising.
is_rising
Most functions generate suitable (if lengthy) entries. This provides the opportunity to identify the line in the Key panel, next to the style.
The entries on the graph are sorted according to this value, which defaults to the order required for calculation. A large integer will bring the line to the front and a negative number will put it behind all the rest.
Examples
The line goes behind the data.
In front of the data, but only just.
Probably the top line.
1 for the line to be shown, 0 hides it. (Default: 1)
This is normally a hash ref defining the data's appearance. See PostScript::Graph::Style for full details, or "Lines" in Finance::Shares::Model for an example.
Please let me know when you suspect something isn't right. A short script working from a CSV file demonstrating the problem would be very helpful.
Chris Willmot, chris@willmot.org.uk
Copyright (c) 2002-2003 Christopher P Willmot
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. A copy can be found at http://www.gnu.org/copyleft/gpl.html
Finance::Shares::Overview provides an introduction to the suite, and fsmodel is the principal script.
Modules involved in processing the model include Finance::Shares::Model, Finance::Shares::MySQL, Finance::Shares::Chart. Chart and file details may be found in PostScript::File, PostScript::Graph::Paper, PostScript::Graph::Key, PostScript::Graph::Style.
All functions are invoked from their own modules, all with lower-case names such as Finance::Shares::moving_average. The nitty-gritty on how to write each line specification are found there.
The quote data is stored in a Finance::Shares::data object. For information on writing additional line functions see Finance::Share::Function and Finance::Share::Line. Also, Finance::Share::test covers writing your own tests.
1 POD Error
The following errors were encountered while parsing the POD:
Expected text after =item, not a number
To install Finance::Shares::Line, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Finance::Shares::Line
CPAN shell
perl -MCPAN -e shell install Finance::Shares::Line
For more information on module installation, please visit the detailed CPAN module installation guide.