iron_warbler 2.0.7.38 → 2.0.7.39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.txt +5 -0
- data/app/controllers/iro/application_controller.rb +6 -4
- data/app/models/iro/priceitem.rb +2 -0
- data/app/models/tda/option.rb +21 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 706bc42f34e116f0071a21611468365ac0a6a2b76fc722c812a9d0158380898b
|
4
|
+
data.tar.gz: 670933ff9f081f0c7d31a32a1a99e4af6b933e4d1b019c51b5923d3efd244395
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e3039883ab46c0a8231500f29fffba931f2ba8fb45529ea139464246c1657940d97279f1b4f61f9d8a563640384874096c87949cb617c0e96aa34c6e978d946
|
7
|
+
data.tar.gz: b0b80caa5be42c0062836150043e89ef719df3caac02b4535887b17ea8e6b7d180073b2585db7195f83b0adec264ab4421f7f3fcc830fcf2394657081d2fde40
|
data/README.txt
CHANGED
@@ -10,3 +10,8 @@ From: https://docs.galpy.org/en/latest/installation.html
|
|
10
10
|
calculator: https://www.omnicalculator.com/finance/black-scholes
|
11
11
|
|
12
12
|
From: https://pythoninoffice.com/calculate-black-scholes-option-price-in-python/
|
13
|
+
|
14
|
+
= schwab =
|
15
|
+
== swagger ==
|
16
|
+
|
17
|
+
* https://developer.schwab.com/products/trader-api--individual
|
@@ -34,7 +34,7 @@ class Iro::ApplicationController < Wco::ApplicationController
|
|
34
34
|
},
|
35
35
|
})
|
36
36
|
out = out.parsed_response
|
37
|
-
puts! out, 'out'
|
37
|
+
# puts! out, 'out'
|
38
38
|
|
39
39
|
attrs = {
|
40
40
|
schwab_access_token: out['access_token'],
|
@@ -43,10 +43,12 @@ class Iro::ApplicationController < Wco::ApplicationController
|
|
43
43
|
}
|
44
44
|
# puts! attrs, 'attrs'
|
45
45
|
|
46
|
-
|
47
|
-
|
46
|
+
if attrs[:schwab_refresh_token]
|
47
|
+
profile.update(attrs)
|
48
|
+
profile.save!
|
49
|
+
end
|
48
50
|
|
49
|
-
render json: {
|
51
|
+
render json: { attrs: attrs, out: out }
|
50
52
|
end
|
51
53
|
|
52
54
|
##
|
data/app/models/iro/priceitem.rb
CHANGED
data/app/models/tda/option.rb
CHANGED
@@ -18,18 +18,30 @@ class Tda::Option
|
|
18
18
|
|
19
19
|
|
20
20
|
##
|
21
|
-
##
|
21
|
+
## Get entire chains for a ticker
|
22
|
+
## params: { ticker, }
|
22
23
|
##
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
## 2024-08-09 :: Continue
|
25
|
+
##
|
26
|
+
def self.get_chains params
|
27
|
+
profile = Wco::Profile.find_by email: 'piousbox@gmail.com'
|
27
28
|
|
28
|
-
|
29
|
-
|
29
|
+
query = { symbol: params[:ticker] } ## use 'GME' as symbol here even though a symbol is eg 'GME_021023P2.5'
|
30
|
+
puts! query, 'query'
|
31
|
+
|
32
|
+
headers = {
|
33
|
+
accept: 'application/json',
|
34
|
+
Authorization: "Bearer #{profile[:schwab_access_token]}",
|
35
|
+
}
|
36
|
+
path = "/chains"
|
37
|
+
out = self.get path, {
|
38
|
+
basic_auth: { username: SCHWAB_DATA[:key], password: SCHWAB_DATA[:secret] },
|
39
|
+
headers: headers,
|
40
|
+
query: query }
|
30
41
|
timestamp = DateTime.parse out.headers['date']
|
31
42
|
out = out.parsed_response.deep_symbolize_keys
|
32
43
|
|
44
|
+
byebug
|
33
45
|
|
34
46
|
outs = []
|
35
47
|
%w| put call |.each do |contractType|
|
@@ -53,8 +65,8 @@ class Tda::Option
|
|
53
65
|
end
|
54
66
|
end
|
55
67
|
|
56
|
-
outs.each do |
|
57
|
-
opi = ::Iro::
|
68
|
+
outs.each do |out|
|
69
|
+
opi = ::Iro::PriceItem.create( out )
|
58
70
|
if !opi.persisted?
|
59
71
|
puts! opi.errors.full_messages, "Cannot create OptionPriceItem"
|
60
72
|
end
|
@@ -125,7 +137,6 @@ class Tda::Option
|
|
125
137
|
}
|
126
138
|
puts! out, 'out'
|
127
139
|
timestamp = DateTime.parse out.headers['date']
|
128
|
-
# out = HTTParty.get "https://api.tdameritrade.com#{path}", { query: query }
|
129
140
|
out = out.parsed_response.deep_symbolize_keys
|
130
141
|
|
131
142
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iron_warbler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.7.
|
4
|
+
version: 2.0.7.39
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Pudeyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: business_time
|