iron_warbler 2.0.7.26 → 2.0.7.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/iron_warbler/purses.scss +31 -0
  3. data/app/assets/stylesheets/iron_warbler/utils.scss +28 -3
  4. data/app/controllers/iro/api/stocks_controller.rb +7 -4
  5. data/app/controllers/iro/positions_controller.rb +27 -21
  6. data/app/controllers/iro/stocks_controller.rb +20 -0
  7. data/app/models/iro/datapoint.rb +1 -1
  8. data/app/models/iro/option.rb +23 -11
  9. data/app/models/iro/position.rb +51 -53
  10. data/app/models/iro/{price_item.rb → priceitem.rb} +5 -1
  11. data/app/models/iro/purse.rb +9 -2
  12. data/app/models/iro/stock.rb +2 -0
  13. data/app/models/iro/strategy.rb +87 -50
  14. data/app/models/tda/option.rb +10 -4
  15. data/app/models/tda/stock.rb +13 -7
  16. data/app/views/iro/_main_header.haml +4 -3
  17. data/app/views/iro/api/stocks/index.json.jbuilder +5 -0
  18. data/app/views/iro/api/stocks/show.json.jbuilder +11 -0
  19. data/app/views/iro/api/stocks/show.json.jbuilder-bk +12 -0
  20. data/app/views/iro/positions/_form.haml +4 -2
  21. data/app/views/iro/positions/_gameui_short_credit_call_spread.haml +38 -0
  22. data/app/views/iro/positions/_header_short_credit_call_spread.haml +50 -0
  23. data/app/views/iro/positions/_new.haml +23 -0
  24. data/app/views/iro/positions/_prepare_short_credit_call_spread.haml +1 -0
  25. data/app/views/iro/purses/_form_extra_fields.haml +18 -22
  26. data/app/views/iro/purses/_header.haml +8 -17
  27. data/app/views/iro/purses/show.haml +3 -2
  28. data/app/views/iro/stocks/_form.haml +4 -3
  29. data/app/views/iro/stocks/edit.haml +4 -0
  30. data/app/views/iro/stocks/index.haml +21 -6
  31. data/app/views/iro/stocks/show.haml +5 -0
  32. data/app/views/iro/strategies/_form.haml +14 -11
  33. data/app/views/iro/strategies/_show.haml +1 -1
  34. data/config/routes.rb +2 -1
  35. data/lib/iro/engine.rb +1 -0
  36. data/lib/iron_warbler.rb +0 -2
  37. data/lib/tasks/iro_tasks.rake +2 -2
  38. metadata +13 -4
  39. data/app/views/iro/api/stocks/show.jbuilder +0 -11
@@ -24,14 +24,23 @@
24
24
 
25
25
 
26
26
  .field
27
- = f.label :buffer_above_water
28
- = f.number_field :buffer_above_water, placeholder: "0.49", step: 0.01
27
+ %label Threshold Buffer dollars above water
28
+ = f.number_field :threshold_buffer_above_water, placeholder: "0.49", step: 0.01
29
29
  .field
30
- = f.label :min_dte
31
- = f.number_field :min_dte, placeholder: "0"
30
+ = f.label :threshold_dte
31
+ = f.number_field :threshold_dte, placeholder: "1"
32
32
  -# .field
33
33
  -# = f.label :next_max_outer_delta
34
34
  -# = f.number_field :next_max_outer_delta, placeholder: "0.25", step: 0.01
35
+ .field
36
+ = f.label :threshold_delta
37
+ = f.number_field :threshold_delta, placeholder: "0.14", step: 0.001
38
+ .field
39
+ = f.label :threshold_netp
40
+ = f.number_field :threshold_netp, placeholder: "0.69", step: 0.001
41
+
42
+ %hr
43
+
35
44
  .field
36
45
  = f.label :next_inner_delta
37
46
  = f.number_field :next_inner_delta, placeholder: "0.25", step: 0.001
@@ -42,14 +51,8 @@
42
51
  = f.label :next_spread_amount
43
52
  = f.number_field :next_spread_amount, placeholder: "20", step: 0.1
44
53
  .field
45
- = f.label :next_buffer_above_water
54
+ %label next buffer dollars above water
46
55
  = f.number_field :next_buffer_above_water, placeholder: "80", step: 0.01
47
- .field
48
- = f.label :threshold_delta
49
- = f.number_field :threshold_delta, placeholder: "0.14", step: 0.001
50
- .field
51
- = f.label :threshold_netp
52
- = f.number_field :threshold_netp, placeholder: "0.69", step: 0.001
53
56
 
54
57
  .actions
55
58
  = f.submit
@@ -8,7 +8,7 @@
8
8
  -# %li <b>ticker:</b> #{strategy.ticker}
9
9
  -# %li <b>slug:</b> #{strategy.slug}
10
10
 
11
- %li <b>buffer_above_water:</b> #{strategy.buffer_above_water}
11
+ %li <b>threshold_buffer_above_water:</b> #{strategy.threshold_buffer_above_water}
12
12
  %li <b>threshold_delta:</b> #{strategy.threshold_delta}
13
13
  %li <b>threshold_netp:</b> #{strategy.threshold_netp}
14
14
 
data/config/routes.rb CHANGED
@@ -30,7 +30,8 @@ Iro::Engine.routes.draw do
30
30
  resources :strategies
31
31
 
32
32
  namespace :api do
33
- # resources :stocks
33
+ get 'stocks', to: 'stocks#index'
34
+ get 'stocks/:ticker', to: 'stocks#show'
34
35
  get 'stocks/:ticker/period/:period', to: 'stocks#show'
35
36
  get 'stocks/:ticker/from/:begin_on', to: 'stocks#show'
36
37
  get 'stocks/:ticker/begin_on/:begin_on', to: 'stocks#show'
data/lib/iro/engine.rb CHANGED
@@ -1,5 +1,6 @@
1
1
 
2
2
  module Iro; end
3
+ module Tda; end
3
4
 
4
5
  class Iro::Engine < ::Rails::Engine
5
6
  isolate_namespace Iro
data/lib/iron_warbler.rb CHANGED
@@ -1,8 +1,6 @@
1
1
 
2
2
  require 'business_time'
3
-
4
3
  require 'haml'
5
-
6
4
  require 'mongoid'
7
5
 
8
6
  require "iro/engine"
@@ -55,14 +55,14 @@ namespace :iro do
55
55
 
56
56
  begin
57
57
  Timeout::timeout( 10 ) do
58
- TDA::Api.get_quotes Iro::Stock.active.map(&:ticker).join(",")
58
+ outs = Tda::Stock.get_quotes Iro::Stock.active.map(&:ticker).join(",")
59
59
  end
60
60
  rescue Exception => e
61
61
  puts! e, 'Error in iro:watch_stocks'
62
62
  # Wco::Exceptionist.notify(e, 'Error in iro:watch_stocks')
63
63
  end
64
64
 
65
- sleep Iro::Stock::SLEEP_TIME_SECONDS
65
+ sleep 15*60 # 15 min
66
66
  end
67
67
  end
68
68
 
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.26
4
+ version: 2.0.7.28
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-03-26 00:00:00.000000000 Z
11
+ date: 2024-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: business_time
@@ -221,6 +221,7 @@ files:
221
221
  - app/assets/stylesheets/iron_warbler/application.css
222
222
  - app/assets/stylesheets/iron_warbler/positions.scss
223
223
  - app/assets/stylesheets/iron_warbler/positions_gameui.scss
224
+ - app/assets/stylesheets/iron_warbler/purses.scss
224
225
  - app/assets/stylesheets/iron_warbler/purses_gameui.scss
225
226
  - app/assets/stylesheets/iron_warbler/purses_gameui.scss-bk
226
227
  - app/assets/stylesheets/iron_warbler/purses_summary.scss
@@ -245,7 +246,7 @@ files:
245
246
  - app/models/iro/option.rb
246
247
  - app/models/iro/option_black_scholes.rb
247
248
  - app/models/iro/position.rb
248
- - app/models/iro/price_item.rb
249
+ - app/models/iro/priceitem.rb
249
250
  - app/models/iro/purse.rb
250
251
  - app/models/iro/stock.rb
251
252
  - app/models/iro/strategy.rb
@@ -256,7 +257,9 @@ files:
256
257
  - app/views/iro/alert_mailer/stock_alert.haml
257
258
  - app/views/iro/alerts/_form.haml
258
259
  - app/views/iro/alerts/index.haml
259
- - app/views/iro/api/stocks/show.jbuilder
260
+ - app/views/iro/api/stocks/index.json.jbuilder
261
+ - app/views/iro/api/stocks/show.json.jbuilder
262
+ - app/views/iro/api/stocks/show.json.jbuilder-bk
260
263
  - app/views/iro/application/home.haml
261
264
  - app/views/iro/options/_show_mini.haml
262
265
  - app/views/iro/positions/_form.haml
@@ -265,14 +268,18 @@ files:
265
268
  - app/views/iro/positions/_gameui_covered_call.haml-bk
266
269
  - app/views/iro/positions/_gameui_long_debit_call_spread.haml
267
270
  - app/views/iro/positions/_gameui_long_debit_call_spread.haml-trash
271
+ - app/views/iro/positions/_gameui_short_credit_call_spread.haml
268
272
  - app/views/iro/positions/_gameui_short_debit_put_spread.haml
269
273
  - app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash
270
274
  - app/views/iro/positions/_header.haml
271
275
  - app/views/iro/positions/_header_covered_call.haml
272
276
  - app/views/iro/positions/_header_long_debit_call_spread.haml
277
+ - app/views/iro/positions/_header_short_credit_call_spread.haml
273
278
  - app/views/iro/positions/_header_short_debit_put_spread.haml
279
+ - app/views/iro/positions/_new.haml
274
280
  - app/views/iro/positions/_prepare_covered_call.haml
275
281
  - app/views/iro/positions/_prepare_long_debit_call_spread.haml
282
+ - app/views/iro/positions/_prepare_short_credit_call_spread.haml
276
283
  - app/views/iro/positions/_prepare_short_debit_put_spread.haml
277
284
  - app/views/iro/positions/_reasons.haml
278
285
  - app/views/iro/positions/_table.haml
@@ -295,7 +302,9 @@ files:
295
302
  - app/views/iro/stocks/_form.haml
296
303
  - app/views/iro/stocks/_grid_is_long.haml
297
304
  - app/views/iro/stocks/_grid_is_short.haml
305
+ - app/views/iro/stocks/edit.haml
298
306
  - app/views/iro/stocks/index.haml
307
+ - app/views/iro/stocks/show.haml
299
308
  - app/views/iro/strategies/_form.haml
300
309
  - app/views/iro/strategies/_header.haml
301
310
  - app/views/iro/strategies/_show.haml
@@ -1,11 +0,0 @@
1
-
2
- json.array! @datapoints do |p|
3
- json.date p[:quote_at].in_time_zone('UTC').to_date
4
- json.quote_at p[:quote_at]
5
- json.open p[:open]
6
- json.high p[:high]
7
- json.low p[:low]
8
- json.close p[:value]
9
- json.volume p[:volume]
10
- end
11
-