sensei_eod_utils 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea26561d67e521bc75b55f27be097e3a791d417dc3a8c614aae98b917b47d65d
4
- data.tar.gz: 5d23b3d96ac7731d23e9917adef1794fba80de035cbb6c9a7bd7f434ac8fb692
3
+ metadata.gz: 17a22745553fa35cf8d2d51a5c1c2a3ed136e00275bf41c365803eec0e7c3366
4
+ data.tar.gz: e29d0796eaca43d49cbd5cad46366e6b1bebc68796da6852356c7930c10d668d
5
5
  SHA512:
6
- metadata.gz: 679f697866fb8e7f52966c93f45a35febd432d6759123b15f68c8f5dbdee55da8c922d5ab966fd2db23fd12acfa604ccb20450fa68e88e88889d0a13459b778e
7
- data.tar.gz: 7e82ff85d7c63b35aa51319706cc49ba30d5274947ced435392e4ce4bcd78e2ae52f4ac9f9a01a65cf64d53cc3cde2c69661abed1501e43fd0e3a6a7af636b66
6
+ metadata.gz: 0c397fca52a55ae30239ceb0fc68a2ad7455f9ff9c827be8289762b98a9adc5d4b9c84c40609700ec7aecfed3b06c58287fa4e68da097d4b44e00576b4454900
7
+ data.tar.gz: b34cb639cba648c7b4aa3d675931ce3758401a5464d362b4fdf97f0db4c0a4a35b38d5d5ccf3781fec24ac163b6a05f8bb13cda07f464fa5ed09bf89db3b0834
@@ -8,6 +8,7 @@ module EodFacade
8
8
  def call(symbol)
9
9
  underlying = EodServices::Contract.underlying_symbol(symbol)
10
10
  expiry = EodServices::Contract.contract_expiry(symbol)
11
+ option_type = contract_type(symbol)
11
12
 
12
13
  unless expiry
13
14
  raise ArgumentError, "Invalid expiration date for option #{symbol}"
@@ -54,6 +55,19 @@ module EodFacade
54
55
 
55
56
  contract.merge('expirationDate' => expiration_date)
56
57
  end
58
+
59
+ def contract_type(symbol)
60
+ option_type = Trade::Option::ContractService.contract_type(symbol)
61
+ case option_type
62
+ when OptionType::CALL
63
+ 'CALL'
64
+ when OptionType::PUT
65
+ 'PUT'
66
+ else
67
+ raise ArgumentError,
68
+ "Invalid option_type #{option_type} for symbol #{symbol}"
69
+ end
70
+ end
57
71
  end
58
72
  end
59
73
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'sensei_eod_utils'
5
- s.version = '0.0.14'
5
+ s.version = '0.0.15'
6
6
  s.date = '2019-12-20'
7
7
  s.summary = 'Sensei trader utility functions and Eod api facade'
8
8
  s.authors = ['Nishant Shah']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensei_eod_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nishant Shah