| 1 | package Finance::Robinhood::Equity::Fundamentals; | ||||||||||||||||||
| 2 | |||||||||||||||||||
| 3 | =encoding utf-8 | ||||||||||||||||||
| 4 | |||||||||||||||||||
| 5 | =for stopwords watchlist watchlists untradable urls | ||||||||||||||||||
| 6 | |||||||||||||||||||
| 7 | =head1 NAME | ||||||||||||||||||
| 8 | |||||||||||||||||||
| 9 | Finance::Robinhood::Equity::Fundamentals - Equity Instrument's Fundamental Data | ||||||||||||||||||
| 10 | |||||||||||||||||||
| 11 | =head1 SYNOPSIS | ||||||||||||||||||
| 12 | |||||||||||||||||||
| 13 | use Finance::Robinhood; | ||||||||||||||||||
| 14 | my $rh = Finance::Robinhood->new; | ||||||||||||||||||
| 15 | my $instruments = $rh->instruments(); | ||||||||||||||||||
| 16 | |||||||||||||||||||
| 17 | for my $instrument ($instruments->all) { | ||||||||||||||||||
| 18 | my $fundamentals = $instrument->fundamentals; | ||||||||||||||||||
| 19 | CORE::say $instrument->symbol; | ||||||||||||||||||
| 20 | CORE::say $fundamentals->description; | ||||||||||||||||||
| 21 | } | ||||||||||||||||||
| 22 | |||||||||||||||||||
| 23 | =cut | ||||||||||||||||||
| 24 | |||||||||||||||||||
| 25 | 1 | our $VERSION = '0.92_003'; | |||||||||||||||||
| 26 | 1 | ▶ | use Mojo::Base-base, -signatures; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 27 | 1 | ▶ | use Finance::Robinhood::Equity::Instrument; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 28 | |||||||||||||||||||
| 29 | 1 | ▶ | sub _test__init { | ||||||||||||||||
|
Subroutine
_test__init: called CC=1 SCAR=3.5
| |||||||||||||||||||
| 30 | 1 | my $rh = t::Utility::rh_instance(1); | |||||||||||||||||
| 31 | 0 | my $tsla = $rh->equity_instrument_by_symbol('TSLA')->fundamentals(); | |||||||||||||||||
| 32 | 0 | isa_ok($tsla, __PACKAGE__); | |||||||||||||||||
| 33 | 0 | t::Utility::stash('TSLA', $tsla); # Store it for later | |||||||||||||||||
| 34 | } | ||||||||||||||||||
| 35 | # | ||||||||||||||||||
| 36 | 1 | has _rh => undef => weak => 1; | |||||||||||||||||
| 37 | |||||||||||||||||||
| 38 | =head1 METHODS | ||||||||||||||||||
| 39 | |||||||||||||||||||
| 40 | |||||||||||||||||||
| 41 | |||||||||||||||||||
| 42 | =head2 C<average_volume( )> | ||||||||||||||||||
| 43 | |||||||||||||||||||
| 44 | |||||||||||||||||||
| 45 | |||||||||||||||||||
| 46 | =head2 C<average_volume_2_weeks( )> | ||||||||||||||||||
| 47 | |||||||||||||||||||
| 48 | |||||||||||||||||||
| 49 | |||||||||||||||||||
| 50 | =head2 C<ceo( )> | ||||||||||||||||||
| 51 | |||||||||||||||||||
| 52 | If applicable, the name of the chief executive(s) related to this instrument. | ||||||||||||||||||
| 53 | |||||||||||||||||||
| 54 | =head2 C<description( )> | ||||||||||||||||||
| 55 | |||||||||||||||||||
| 56 | Plain text description suited for display. | ||||||||||||||||||
| 57 | |||||||||||||||||||
| 58 | =head2 C<dividend_yield( )> | ||||||||||||||||||
| 59 | |||||||||||||||||||
| 60 | |||||||||||||||||||
| 61 | |||||||||||||||||||
| 62 | =head2 C<headquarters_city( )> | ||||||||||||||||||
| 63 | |||||||||||||||||||
| 64 | If applicable, the city where the main headquarters are located. | ||||||||||||||||||
| 65 | |||||||||||||||||||
| 66 | =head2 C<headquarters_state( )> | ||||||||||||||||||
| 67 | |||||||||||||||||||
| 68 | If applicable, the US state where the main headquarters are located. | ||||||||||||||||||
| 69 | |||||||||||||||||||
| 70 | =head2 C<high( )> | ||||||||||||||||||
| 71 | |||||||||||||||||||
| 72 | Trading day high. | ||||||||||||||||||
| 73 | |||||||||||||||||||
| 74 | =head2 C<high_52_weeks( )> | ||||||||||||||||||
| 75 | |||||||||||||||||||
| 76 | 52-week high. | ||||||||||||||||||
| 77 | |||||||||||||||||||
| 78 | =head2 C<industry( )> | ||||||||||||||||||
| 79 | |||||||||||||||||||
| 80 | |||||||||||||||||||
| 81 | |||||||||||||||||||
| 82 | =head2 C<low( )> | ||||||||||||||||||
| 83 | |||||||||||||||||||
| 84 | Trading day low. | ||||||||||||||||||
| 85 | |||||||||||||||||||
| 86 | =head2 C<low_52_weeks( )> | ||||||||||||||||||
| 87 | |||||||||||||||||||
| 88 | 52-week low. | ||||||||||||||||||
| 89 | |||||||||||||||||||
| 90 | =head2 C<market_cap( )> | ||||||||||||||||||
| 91 | |||||||||||||||||||
| 92 | |||||||||||||||||||
| 93 | |||||||||||||||||||
| 94 | =head2 C<num_employees( )> | ||||||||||||||||||
| 95 | |||||||||||||||||||
| 96 | If applicable, the number of employees as reported by the company. | ||||||||||||||||||
| 97 | |||||||||||||||||||
| 98 | =head2 C<open( )> | ||||||||||||||||||
| 99 | |||||||||||||||||||
| 100 | |||||||||||||||||||
| 101 | |||||||||||||||||||
| 102 | =head2 C<pe_ratio( )> | ||||||||||||||||||
| 103 | |||||||||||||||||||
| 104 | |||||||||||||||||||
| 105 | |||||||||||||||||||
| 106 | =head2 C<sector( )> | ||||||||||||||||||
| 107 | |||||||||||||||||||
| 108 | |||||||||||||||||||
| 109 | |||||||||||||||||||
| 110 | =head2 C<shares_outstanding( )> | ||||||||||||||||||
| 111 | |||||||||||||||||||
| 112 | Number of shares outstanding according to the SEC. | ||||||||||||||||||
| 113 | |||||||||||||||||||
| 114 | =head2 C<volume( )> | ||||||||||||||||||
| 115 | |||||||||||||||||||
| 116 | |||||||||||||||||||
| 117 | |||||||||||||||||||
| 118 | =head2 C<year_founded( )> | ||||||||||||||||||
| 119 | |||||||||||||||||||
| 120 | The year the company was founded, if applicable. | ||||||||||||||||||
| 121 | |||||||||||||||||||
| 122 | =cut | ||||||||||||||||||
| 123 | |||||||||||||||||||
| 124 | 1 | has ['average_volume', 'average_volume_2_weeks', | |||||||||||||||||
| 125 | 'ceo', 'description', | ||||||||||||||||||
| 126 | 'dividend_yield', 'headquarters_city', | ||||||||||||||||||
| 127 | 'headquarters_state', 'high', | ||||||||||||||||||
| 128 | 'high_52_weeks', 'industry', | ||||||||||||||||||
| 129 | 'low', 'low_52_weeks', | ||||||||||||||||||
| 130 | 'market_cap', 'num_employees', | ||||||||||||||||||
| 131 | 'open', 'pe_ratio', | ||||||||||||||||||
| 132 | 'sector', 'shares_outstanding', | ||||||||||||||||||
| 133 | 'volume', 'year_founded', | ||||||||||||||||||
| 134 | ]; | ||||||||||||||||||
| 135 | |||||||||||||||||||
| 136 | =head2 C<instrument( )> | ||||||||||||||||||
| 137 | |||||||||||||||||||
| 138 | Loop back to the equity instrument. | ||||||||||||||||||
| 139 | |||||||||||||||||||
| 140 | =cut | ||||||||||||||||||
| 141 | |||||||||||||||||||
| 142 | 0 | ▶ | sub instrument($s) { | ||||||||||||||||
|
Subroutine
instrument: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||
| 143 | 0 | my $res = $s->_rh->_get($s->{instrument}); | |||||||||||||||||
| 144 | $res->is_success | ||||||||||||||||||
| 145 | ? Finance::Robinhood::Equity::Instrument->new(_rh => $s->_rh, | ||||||||||||||||||
| 146 | 0 | ▶ | %{$res->json}) | ||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||
| 147 | : Finance::Robinhood::Error->new( | ||||||||||||||||||
| 148 | $res->is_server_error ? (details => $res->message) : $res->json); | ||||||||||||||||||
| 149 | } | ||||||||||||||||||
| 150 | |||||||||||||||||||
| 151 | 1 | ▶ | sub _test_instrument { | ||||||||||||||||
|
Subroutine
_test_instrument: called CC=2 SCAR=9.2
| |||||||||||||||||||
| 152 | 1 | ▶ | t::Utility::stash('TSLA') // skip_all(); | ||||||||||||||||
|
Condition50%1/2
t::Utility::stash("TSLA") // skip_all()
MC/DC0%0/2
t::Utility::stash("TSLA") // skip_all()
t::Utility::stash("TSLA")
skip_all()
Truth table33%1/3
A // B
A= t::Utility::stash("TSLA")B= skip_all()
| |||||||||||||||||||
| 153 | 0 | isa_ok(t::Utility::stash('TSLA')->instrument, | |||||||||||||||||
| 154 | 'Finance::Robinhood::Equity::Instrument'); | ||||||||||||||||||
| 155 | } | ||||||||||||||||||
| 156 | |||||||||||||||||||
| 157 | =head1 LEGAL | ||||||||||||||||||
| 158 | |||||||||||||||||||
| 159 | This is a simple wrapper around the API used in the official apps. The author | ||||||||||||||||||
| 160 | provides no investment, legal, or tax advice and is not responsible for any | ||||||||||||||||||
| 161 | damages incurred while using this software. This software is not affiliated | ||||||||||||||||||
| 162 | with Robinhood Financial LLC in any way. | ||||||||||||||||||
| 163 | |||||||||||||||||||
| 164 | For Robinhood's terms and disclosures, please see their website at | ||||||||||||||||||
| 165 | https://robinhood.com/legal/ | ||||||||||||||||||
| 166 | |||||||||||||||||||
| 167 | =head1 LICENSE | ||||||||||||||||||
| 168 | |||||||||||||||||||
| 169 | Copyright (C) Sanko Robinson. | ||||||||||||||||||
| 170 | |||||||||||||||||||
| 171 | This library is free software; you can redistribute it and/or modify it under | ||||||||||||||||||
| 172 | the terms found in the Artistic License 2. Other copyrights, terms, and | ||||||||||||||||||
| 173 | conditions may apply to data transmitted through this module. Please refer to | ||||||||||||||||||
| 174 | the L<LEGAL> section. | ||||||||||||||||||
| 175 | |||||||||||||||||||
| 176 | =head1 AUTHOR | ||||||||||||||||||
| 177 | |||||||||||||||||||
| 178 | Sanko Robinson E<lt>sanko@cpan.orgE<gt> | ||||||||||||||||||
| 179 | |||||||||||||||||||
| 180 | =cut | ||||||||||||||||||
| 181 | |||||||||||||||||||
| 182 | 1 | 1; | |||||||||||||||||