lib/Finance/Robinhood/Options/Chain/Ticks.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 90.0% 27 / 30 CC 2 SCAR 2.7
CC
2
Cov
95%
_test_stringify
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« lib/Finance/Robinhood/Utilities.pm ↑ Summary lib/Finance/Robinhood/Equity/Earnings/EPS.pm »
1 package Finance::Robinhood::Options::Chain::Ticks;
2  
3 =encoding utf-8
4  
5 =for stopwords watchlist watchlists untradable urls
6  
7 =head1 NAME
8  
9 Finance::Robinhood::Options::Chain::Ticks - Represents Pricing Ticks for an
10 Options Chain
11  
12 =head1 SYNOPSIS
13  
14 use Text::Wrap qw[wrap];
15 use Finance::Robinhood;
16 my $rh = Finance::Robinhood->new;
17  
18 # TODO
19  
20 =head1 METHODS
21  
22 =cut
23  
24 1 our $VERSION = '0.92_003';
25 1 ▶use Mojo::Base-base, -signatures;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 ▶use Mojo::URL;
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 1 ▶sub _test__init {
Subroutine _test__init: called CC=1 SCAR=0.0
29 1 my $rh = t::Utility::rh_instance(0);
30 1 my $ticks = $rh->options_chains->current->min_ticks;
31 1 isa_ok($ticks, __PACKAGE__);
32 1 t::Utility::stash('TICKS', $ticks); # Store it for later
33 }
34 1 ▶use overload '""' => sub ($s, @) { $s->{below_tick} }, fallback => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
35  
36 1 ▶sub _test_stringify {
Subroutine _test_stringify: called CC=2 SCAR=7.2
37 1 ▶ t::Utility::stash('TICKS') // skip_all();
Condition50%1/2
t::Utility::stash("TICKS") // skip_all()
l!l
10
MC/DC0%0/2
t::Utility::stash("TICKS") // skip_all()
t::Utility::stash("TICKS") skip_all()
Truth table33%1/3
A // B
A= t::Utility::stash("TICKS")B= skip_all()
ABresult
1X1
011
000
38 1 like(+t::Utility::stash('TICKS'), qr[^\d+\.\d+$],);
39 }
40 #
41 1 has _rh => undef => weak => 1;
42  
43 =head2 C<above_tick( )>
44  
45 Value to 'round up' to.
46  
47 =head2 C<below_tick( )>
48  
49 Value to 'round down' to.
50  
51 =head2 C<cutoff_price( )>
52  
53 Below this, use the C<above_tick( )> and C<below_tick( )> values. Otherwise,
54 ignore them.
55  
56 =cut
57  
58 1 has ['above_tick', 'below_tick', 'cutoff_price'];
59  
60 =head1 LEGAL
61  
62 This is a simple wrapper around the API used in the official apps. The author
63 provides no investment, legal, or tax advice and is not responsible for any
64 damages incurred while using this software. This software is not affiliated
65 with Robinhood Financial LLC in any way.
66  
67 For Robinhood's terms and disclosures, please see their website at
68 https://robinhood.com/legal/
69  
70 =head1 LICENSE
71  
72 Copyright (C) Sanko Robinson.
73  
74 This library is free software; you can redistribute it and/or modify it under
75 the terms found in the Artistic License 2. Other copyrights, terms, and
76 conditions may apply to data transmitted through this module. Please refer to
77 the L<LEGAL> section.
78  
79 =head1 AUTHOR
80  
81 Sanko Robinson E<lt>sanko@cpan.orgE<gt>
82  
83 =cut
84  
85 1 1;
« lib/Finance/Robinhood/Utilities.pm ↑ Summary lib/Finance/Robinhood/Equity/Earnings/EPS.pm »