wco_models 3.1.0.267 → 3.1.0.268

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1f54c396bd801b8243d24de86159a104d390d1b74ce79bd12c3bde3bda2d682
4
- data.tar.gz: 137492819d59dc6cffb3a220f74f4352970dd69a3d8a01a585e3f17c7260dd1c
3
+ metadata.gz: 85a68fabb586fada92d893f953866bd0e5a1600988ad67c12770b89fa2fa625a
4
+ data.tar.gz: d4cfcef90359a44a3472ce03b3162c1480d304ae1b9af8cd08e9242d76e4e421
5
5
  SHA512:
6
- metadata.gz: b8b9b3d27b172ad9094d5231865e2864881696718bb014a4ae7c73405a5e58eb4df313ef1340a14bbc6109293b1656e060493d0127eb00988bb9f8400ac92d7f
7
- data.tar.gz: cc019d6173c28f78dd506300a8bd692086d9d84752e2744dfa547d03d61dc3a47513af1be09653e588200ed444d0528bf5c940294d3c65e2b7e64a8d17a3139e
6
+ metadata.gz: c1fc4ca80b0583b321f9cf4363c9ff3a37bbb42aca43ef7ca25e009cd8d4756da44b9555f7968254a1385a6e6a30b8e471a348fd57e750b1591d34e4518e0f2b
7
+ data.tar.gz: '039c8aa93e7a5c659bac9c5d5ad7377df287e93f1de7cf6071ed71491c29946247a43366e27f46648d2ac632821a7434446cbe565e9ef036288ef29bd07ec6b1'
@@ -25,8 +25,6 @@ class Iro::Position
25
25
  return labels[st] || st
26
26
  end
27
27
 
28
- INTENT_CLOSE = 'close.'
29
- INTENTS = [ nil, INTENT_CLOSE ]
30
28
  field :intent
31
29
 
32
30
  belongs_to :purse, class_name: 'Iro::Purse', inverse_of: :positions
@@ -12,6 +12,9 @@ class Iro::Purse
12
12
  validates :slug, presence: true, uniqueness: true
13
13
  index({ slug: -1 }, { unique: true })
14
14
 
15
+ TEMPLATE_GAMEUI = 'gameui'
16
+ TEMPLATE_TABLE = 'show'
17
+
15
18
  has_many :positions, class_name: 'Iro::Position', inverse_of: :purse
16
19
 
17
20
  has_many :strategies, class_name: 'Iro::Strategy', inverse_of: :purse
@@ -198,4 +198,14 @@ class ::Iro::Stock
198
198
  end
199
199
  end
200
200
 
201
+ def self.sync
202
+ tickers = Iro::Stock.all.map { |s| s.ticker }.join(',')
203
+ outs = Tda::Stock.get_quotes tickers
204
+ outs.map do |out|
205
+ Iro::Stock.where( ticker: out[:symbol] ).update_all( last: out[:last] )
206
+ end
207
+ puts "+++ Synced stocks."
208
+ end
209
+
210
+
201
211
  end
@@ -94,6 +94,12 @@ class Iro::Strategy
94
94
  field :next_usd_above_mark, type: :float
95
95
  validates :next_usd_above_mark, presence: true
96
96
 
97
+ INTENT_CLOSE = 'try-close'
98
+ INTENT_ROLL = 'try-roll'
99
+ INTENTS = [ nil, INTENT_CLOSE, INTENT_ROLL ]
100
+ field :intent
101
+
102
+
97
103
  def begin_delta_covered_call p
98
104
  p.inner.begin_delta
99
105
  end
@@ -365,7 +371,7 @@ class Iro::Strategy
365
371
 
366
372
 
367
373
  def to_s
368
- "#{kind} #{stock} #{descr}"
374
+ "#{kind} #{stock} #{next_spread_amount}- #{intent} | #{descr}"
369
375
  end
370
376
  def self.list long_or_short = nil
371
377
  these = long_or_short ? where( long_or_short: long_or_short ) : all
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wco_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.267
4
+ version: 3.1.0.268
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev