iron_warbler 2.0.7.18 → 2.0.7.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/iro/alert.rb +2 -1
- data/app/models/tda/stock.rb +3 -0
- 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: 3323961dddbc46a423f2f913a487c0944d1a39c88ace9517f42b02eb7e4951a9
|
4
|
+
data.tar.gz: 2f28158b88fe50b7d190c5151da808819c816de9abf773c70063e39b8ed6a8da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 509add67004fa9cda9757fc71bd3319db109acb0cb981a4ac265dc5777f39680bbcfb265a0685f357b0b073604087df756c084b98d333f0c21616d535d205a62
|
7
|
+
data.tar.gz: f1b24ce8505853cbc1723b5117ff3a3c79f85bf793f2f8aa00f7bdd4d57ae47e2a9014f0739920609595c16376b2b7c2e0b4a1c13822f4477455fec68aa55d74
|
data/app/models/iro/alert.rb
CHANGED
@@ -35,7 +35,8 @@ class Iro::Alert
|
|
35
35
|
def do_run
|
36
36
|
alert = self
|
37
37
|
begin
|
38
|
-
price = Tda::Stock.get_quote( alert.symbol )
|
38
|
+
price = Tda::Stock.get_quote( alert.symbol )&.last
|
39
|
+
return if !price
|
39
40
|
|
40
41
|
if ( alert.direction == alert.class::DIRECTION_ABOVE && price >= alert.strike ) ||
|
41
42
|
( alert.direction == alert.class::DIRECTION_BELOW && price <= alert.strike )
|
data/app/models/tda/stock.rb
CHANGED
@@ -16,6 +16,9 @@ class Tda::Stock
|
|
16
16
|
path = "/v1/marketdata/quotes"
|
17
17
|
inns = self.get path, { query: { apikey: ::TD_AMERITRADE[:apiKey], symbol: tickers } }
|
18
18
|
inns = inns.parsed_response
|
19
|
+
if [ NilClass, String ].include?( inns.class )
|
20
|
+
return []
|
21
|
+
end
|
19
22
|
inns.each do |k, v|
|
20
23
|
inns[k] = v.deep_symbolize_keys
|
21
24
|
end
|
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.19
|
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-02-
|
11
|
+
date: 2024-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: business_time
|