line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finance::Nadex::Contract; |
2
|
|
|
|
|
|
|
|
3
|
14
|
|
|
14
|
|
163
|
use 5.006; |
|
14
|
|
|
|
|
27
|
|
4
|
14
|
|
|
14
|
|
41
|
use strict; |
|
14
|
|
|
|
|
15
|
|
|
14
|
|
|
|
|
221
|
|
5
|
14
|
|
|
14
|
|
34
|
use warnings FATAL => 'all'; |
|
14
|
|
|
|
|
12
|
|
|
14
|
|
|
|
|
4472
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub bid { |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
10
|
|
|
|
|
|
|
|
11
|
1
|
50
|
|
|
|
3
|
if ( exists $self->{bid} ) { |
12
|
1
|
|
|
|
|
4
|
return $self->{bid}; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
0
|
return; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub bidsize { |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
21
|
|
|
|
|
|
|
|
22
|
0
|
0
|
|
|
|
0
|
if ( exists $self->{bidsize} ) { |
23
|
0
|
|
|
|
|
0
|
return $self->{bidsize}; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
0
|
return; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub contract { |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
32
|
|
|
|
|
|
|
|
33
|
0
|
0
|
|
|
|
0
|
if ( exists $self->{contract} ) { |
34
|
0
|
|
|
|
|
0
|
return $self->{contract}; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
0
|
return; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub epic { |
41
|
|
|
|
|
|
|
|
42
|
2
|
|
|
2
|
1
|
3
|
my $self = shift; |
43
|
|
|
|
|
|
|
|
44
|
2
|
50
|
|
|
|
12
|
if ( exists $self->{epic} ) { |
45
|
2
|
|
|
|
|
6
|
return $self->{epic}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
0
|
return; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub expirydate { |
52
|
|
|
|
|
|
|
|
53
|
1
|
|
|
1
|
1
|
1
|
my $self = shift; |
54
|
|
|
|
|
|
|
|
55
|
1
|
50
|
|
|
|
4
|
if ( exists $self->{expirydate} ) { |
56
|
1
|
|
|
|
|
3
|
return $self->{expirydate}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
0
|
return; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub offer { |
63
|
|
|
|
|
|
|
|
64
|
1
|
|
|
1
|
1
|
7
|
my $self = shift; |
65
|
|
|
|
|
|
|
|
66
|
1
|
50
|
|
|
|
4
|
if ( exists $self->{offer} ) { |
67
|
1
|
|
|
|
|
3
|
return $self->{offer}; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
0
|
|
|
|
|
0
|
return; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub offersize { |
74
|
|
|
|
|
|
|
|
75
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
76
|
|
|
|
|
|
|
|
77
|
0
|
0
|
|
|
|
0
|
if ( exists $self->{offersize} ) { |
78
|
0
|
|
|
|
|
0
|
return $self->{offersize}; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
0
|
|
|
|
|
0
|
return; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub type { |
85
|
|
|
|
|
|
|
|
86
|
12
|
|
|
12
|
1
|
11
|
my $self = shift; |
87
|
|
|
|
|
|
|
|
88
|
12
|
50
|
|
|
|
24
|
if ( exists $self->{type} ) { |
89
|
12
|
|
|
|
|
55
|
return $self->{type}; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
0
|
|
|
|
|
0
|
return; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub _new { |
96
|
|
|
|
|
|
|
|
97
|
9
|
|
|
9
|
|
8
|
my $hashref = shift; |
98
|
|
|
|
|
|
|
|
99
|
9
|
|
|
|
|
14
|
my $self = {}; |
100
|
|
|
|
|
|
|
|
101
|
9
|
|
50
|
|
|
24
|
$self->{offer} = $hashref->{displayOffer} || 'NoOffer'; |
102
|
9
|
|
50
|
|
|
20
|
$self->{bid} = $hashref->{displayBid} || 'NoBid'; |
103
|
9
|
|
50
|
|
|
17
|
$self->{contract} = $hashref->{instrumentName} || undef; |
104
|
9
|
|
50
|
|
|
16
|
$self->{epic} = $hashref->{epic} || undef; |
105
|
9
|
|
50
|
|
|
21
|
$self->{type} = lc( $hashref->{instrumentType} ) || undef; |
106
|
9
|
|
50
|
|
|
22
|
$self->{expirydate} = $hashref->{displayPeriod} || undef; |
107
|
9
|
|
50
|
|
|
32
|
$self->{bidsize} = $hashref->{displayBidSize} || undef; |
108
|
9
|
|
50
|
|
|
31
|
$self->{offersize} = $hashref->{displayOfferSize} || undef; |
109
|
|
|
|
|
|
|
|
110
|
9
|
|
|
|
|
45
|
return bless $self, __PACKAGE__; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 NAME |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
Finance::Nadex::Contract - Provides information about a contract available for trading on the North American Derivatives Exchange |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head1 VERSION |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
Version 0.01 |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=cut |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=head1 SYNOPSIS |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
Container for information about contracts; used by L; not meant to be instantiated |
128
|
|
|
|
|
|
|
directly in client code; certain methods in L return an instance or list of |
129
|
|
|
|
|
|
|
Finance::Nadex::Contract objects; the accessor methods below can be used to retrieve information |
130
|
|
|
|
|
|
|
from the object instances; see L for information about methods which retrieve positions |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head1 ACCESSORS |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head2 bid |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
Retrieves the current highest bid for the contract (example: "30.00") |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=head2 bidsize |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
Retrieves the number of contracts bid at the current highest bid |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=head2 contract |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
Retrieves the name of the contract (example: "GBP/USD >1.5120 (3PM)") |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=head2 epic |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
Retrieves the unique identifier for the contract as created by the exchange (example: "NB.D.OPT-GBP-USD.1-1-15Jan15") |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head2 expirydate |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
Retrieves the date on which the contract will expire (example: "20-JAN-15") |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=head2 offer |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
Retrieves the current lowest offer for the contract (example: "20.50") |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=head2 offersize |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
Retrieves the number of contracts offered at the current lowest offer |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=head2 type |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
Retrieves the type of contract: one of 'binary', 'spread', or 'event' |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=head1 AUTHOR |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
mhandisi, C<< >> |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=head1 BUGS |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
174
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
175
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=head1 SUPPORT |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
perldoc Finance::Nadex::Contract |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
You can also look for information at: |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
=over 4 |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker (report bugs here) |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
L |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
L |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=item * CPAN Ratings |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
L |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
=item * Search CPAN |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
L |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
=back |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
Copyright 2015 mhandisi. |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
218
|
|
|
|
|
|
|
under the terms of the the Artistic License (2.0). You may obtain a |
219
|
|
|
|
|
|
|
copy of the full license at: |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
L |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
Any use, modification, and distribution of the Standard or Modified |
224
|
|
|
|
|
|
|
Versions is governed by this Artistic License. By using, modifying or |
225
|
|
|
|
|
|
|
distributing the Package, you accept this license. Do not use, modify, |
226
|
|
|
|
|
|
|
or distribute the Package, if you do not accept this license. |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
If your Modified Version has been derived from a Modified Version made |
229
|
|
|
|
|
|
|
by someone other than you, you are nevertheless required to ensure that |
230
|
|
|
|
|
|
|
your Modified Version complies with the requirements of this license. |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
This license does not grant you the right to use any trademark, service |
233
|
|
|
|
|
|
|
mark, tradename, or logo of the Copyright Holder. |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
This license includes the non-exclusive, worldwide, free-of-charge |
236
|
|
|
|
|
|
|
patent license to make, have made, use, offer to sell, sell, import and |
237
|
|
|
|
|
|
|
otherwise transfer the Package with respect to any patent claims |
238
|
|
|
|
|
|
|
licensable by the Copyright Holder that are necessarily infringed by the |
239
|
|
|
|
|
|
|
Package. If you institute patent litigation (including a cross-claim or |
240
|
|
|
|
|
|
|
counterclaim) against any party alleging that the Package constitutes |
241
|
|
|
|
|
|
|
direct or contributory patent infringement, then this Artistic License |
242
|
|
|
|
|
|
|
to you shall terminate on the date that such litigation is filed. |
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER |
245
|
|
|
|
|
|
|
AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. |
246
|
|
|
|
|
|
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
247
|
|
|
|
|
|
|
PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY |
248
|
|
|
|
|
|
|
YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR |
249
|
|
|
|
|
|
|
CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR |
250
|
|
|
|
|
|
|
CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, |
251
|
|
|
|
|
|
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
=cut |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
42; # End of Finance::Nadex::Contract |