iron_warbler 2.0.7.4 → 2.0.7.5
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 +1 -0
- data/lib/tasks/iro_tasks.rake +9 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9623b43de3ec1bea0d40e439f10c024c16b573b2ec1b0fe57dc4e48f4535a1c
|
4
|
+
data.tar.gz: 2574f8e0c95b1bd7977732d94ff49212baed00a25efcbec363ef6d456bf70ae0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2776f402509e6a1ca51c5f5e804ff03818904b4d980dc786c59af234b2d90b772d5f8d772a942d02eadb2e513d7080f6df0397de8c5295e673fc651b26a8948
|
7
|
+
data.tar.gz: 00b17d296e59c53dca6d07f731608763d7768db7d5841bd2bbc9885135320bc45600a31af9044b9fb10151edb3952b698375abd2557feb6298d43e42e62a9d07
|
data/app/models/iro/alert.rb
CHANGED
data/lib/tasks/iro_tasks.rake
CHANGED
@@ -20,15 +20,24 @@ namespace :iro do
|
|
20
20
|
|
21
21
|
desc 'alerts'
|
22
22
|
task alerts: :environment do
|
23
|
+
print 'iro:alerts'
|
23
24
|
while true
|
24
25
|
Iro::Alert.active.each do |alert|
|
26
|
+
|
25
27
|
# price = Iro::Stock.latest( alert.ticker ).price
|
26
28
|
price = Tda::Api.get_quote( alert.symbol ).last
|
29
|
+
|
27
30
|
if alert.direction == Iro::Alert::DIRECTION_ABOVE && price >= alert.strike ||
|
28
31
|
alert.direction == Iro::Alert::DIRECTION_BELOW && price <= alert.strike
|
32
|
+
|
29
33
|
Iro::AlertMailer.stock_alert( alert ).deliver_later
|
34
|
+
alert.update_attributes({ status: Iro::Alert::STATUS_INACTIVE })
|
35
|
+
print '^'
|
36
|
+
|
30
37
|
end
|
31
38
|
end
|
39
|
+
|
40
|
+
print '.'
|
32
41
|
sleep Iro::Alert::SLEEP_TIME_SECONDS
|
33
42
|
end
|
34
43
|
end
|