line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finance::Robinhood::Forex::Halt; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=encoding utf-8 |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=for stopwords watchlist watchlists untradable urls |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Finance::Robinhood::Forex::Halt - Represents a Single Forex/Crypto Trade Halt |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 SYNOPSIS |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use Finance::Robinhood; |
14
|
|
|
|
|
|
|
my $rh = Finance::Robinhood->new; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# TODO |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=cut |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our $VERSION = '0.92_001'; |
21
|
1
|
|
|
1
|
|
4178
|
use Mojo::Base-base, -signatures; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
22
|
1
|
|
|
1
|
|
245
|
use Mojo::URL; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
23
|
1
|
|
|
1
|
|
26
|
use Time::Moment; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
144
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub _test__init { |
26
|
1
|
|
|
1
|
|
8027
|
my $rh = t::Utility::rh_instance(1); |
27
|
0
|
|
|
|
|
0
|
my $halt = $rh->forex_halts->current; |
28
|
0
|
|
|
|
|
0
|
isa_ok( $halt, __PACKAGE__ ); |
29
|
0
|
|
|
|
|
0
|
t::Utility::stash( 'HALT', $halt ); # Store it for later |
30
|
|
|
|
|
|
|
} |
31
|
1
|
|
|
1
|
|
9
|
use overload '""' => sub ( $s, @ ) { $s->{id} }, fallback => 1; |
|
1
|
|
|
0
|
|
2
|
|
|
1
|
|
|
|
|
12
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub _test_stringify { |
34
|
1
|
|
50
|
1
|
|
1835
|
t::Utility::stash('HALT') // skip_all(); |
35
|
0
|
|
|
|
|
0
|
like( |
36
|
|
|
|
|
|
|
+t::Utility::stash('HALT'), |
37
|
|
|
|
|
|
|
qr'^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$'i |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
# |
41
|
|
|
|
|
|
|
has _rh => undef => weak => 1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 METHODS |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head2 C |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Returns a boolean value which indicates whether or not this halt is currently |
48
|
|
|
|
|
|
|
active. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 C |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head2 C |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Returns a Time::Moment object if defined. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 C |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Returns a UUID. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 C |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
If defined, this returns a text string suited for display. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head2 C |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
One of the following: C, C, or C. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head2 C |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Returns a Time::Moment object. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head2 C |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
One of the following: C, C, C, and C. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=cut |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
has [ 'active', 'pair_id', 'id', 'reason', 'reason_code', 'state' ]; |
80
|
|
|
|
|
|
|
|
81
|
0
|
|
|
0
|
1
|
0
|
sub start_at ($s) { |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
82
|
0
|
|
|
|
|
0
|
Time::Moment->from_string( $s->{start_at} ); |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub _test_start_at { |
86
|
1
|
|
50
|
1
|
|
1799
|
t::Utility::stash('HALT') // skip_all(); |
87
|
0
|
|
|
|
|
0
|
isa_ok( t::Utility::stash('HALT')->start_at, 'Time::Moment' ); |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
0
|
|
|
0
|
1
|
0
|
sub end_at ($s) { |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
91
|
0
|
|
0
|
|
|
0
|
$s->{end_at} // return (); |
92
|
0
|
|
|
|
|
0
|
Time::Moment->from_string( $s->{end_at} ); |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub _test_end_at { |
96
|
1
|
|
50
|
1
|
|
1979
|
t::Utility::stash('HALT') // skip_all(); |
97
|
0
|
|
|
|
|
|
isa_ok( t::Utility::stash('HALT')->end_at, 'Time::Moment' ); |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 LEGAL |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
This is a simple wrapper around the API used in the official apps. The author |
103
|
|
|
|
|
|
|
provides no investment, legal, or tax advice and is not responsible for any |
104
|
|
|
|
|
|
|
damages incurred while using this software. This software is not affiliated |
105
|
|
|
|
|
|
|
with Robinhood Financial LLC in any way. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
For Robinhood's terms and disclosures, please see their website at |
108
|
|
|
|
|
|
|
https://robinhood.com/legal/ |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 LICENSE |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Copyright (C) Sanko Robinson. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it under |
115
|
|
|
|
|
|
|
the terms found in the Artistic License 2. Other copyrights, terms, and |
116
|
|
|
|
|
|
|
conditions may apply to data transmitted through this module. Please refer to |
117
|
|
|
|
|
|
|
the L section. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head1 AUTHOR |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
Sanko Robinson Esanko@cpan.orgE |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=cut |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
1; |