iron_warbler 2.0.7.4 → 2.0.7.6

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: f2b30096d80bf9a313e727c174b2d7f1255954e7eb4ab4cc158a80395ae13af5
4
- data.tar.gz: 7dbc3734a72d4669fb1daa9a400ce4b6e1409dae04eaf9d37de189fd5706fd2e
3
+ metadata.gz: 22ae37cea1efb7bfb149dcf88ed26fc777ec0f0f63fbd0d1a46b6e94b6e24fae
4
+ data.tar.gz: e48a88e2717722d04de5acb67d7ad9fcb1cdcd09e711811c8c0cccaab0a267c3
5
5
  SHA512:
6
- metadata.gz: 1c0a7e7f057d4c065b6976b4ff0bf236a6ce5e43ab0ca6943878e4567b6fbef7aa420a16b28ad7142accb1c0f359f873e4ef05a028c62b1530a417b24afe384b
7
- data.tar.gz: 444a6658828e564757d82133822defa0964497c4a4e7c63d188a33024b4f8c4f0a54960a915be8d9de7da5ffa7006cff7f8ba0bda082766e4b9e9856e03ce802
6
+ metadata.gz: 00d04ff69762f25603c60c768b08eddafc5e0b549ed88d4f75b43afc1140e2565ae9a2e667e4245c842a5742c37a8a1a0f9bffc71c29bde8ca788576e52d90c5
7
+ data.tar.gz: 7d5117e6349a34c6a303c3a60b5108820625123bb23bd27b409e2cb2ce1f09eaf38824d7519c5c92f142eab02cd5427b2a4ea73f2b13175f9a318fdb39cde42f
@@ -2,6 +2,7 @@
2
2
  class Iro::Alert < Iro::ApplicationRecord
3
3
  self.table_name = 'iro_alerts'
4
4
 
5
+ SLEEP_TIME_SECONDS = Rails.env.production? ? 60 : 15
5
6
 
6
7
  DIRECTION_ABOVE = 'ABOVE'
7
8
  DIRECTION_BELOW = 'BELOW'
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron_warbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.7.4
4
+ version: 2.0.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: 6.0.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: exception_notification
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 4.5.0
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 4.5.0
111
125
  description: A stocks and Options Trading Bot.
112
126
  email: victor@wasya.co
113
127
  executables: []