iron_warbler 2.0.7.24 → 2.0.7.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/iron_warbler/Card.scss +6 -0
- data/app/assets/stylesheets/iron_warbler/positions.scss +1 -1
- data/app/assets/stylesheets/iron_warbler/positions_gameui.scss +8 -0
- data/app/assets/stylesheets/iron_warbler/purses_gameui.scss +2 -4
- data/app/assets/stylesheets/iron_warbler/purses_summary.scss +31 -19
- data/app/controllers/iro/application_controller.rb +6 -0
- data/app/controllers/iro/positions_controller.rb +186 -137
- data/app/controllers/iro/purses_controller.rb +3 -1
- data/app/controllers/iro/stocks_controller.rb +2 -2
- data/app/models/iro/option.rb +41 -148
- data/app/models/iro/option_black_scholes.rb +149 -0
- data/app/models/iro/position.rb +156 -205
- data/app/models/iro/purse.rb +34 -4
- data/app/models/iro/strategy.rb +49 -47
- data/app/views/iro/_main_header.haml +4 -2
- data/app/views/iro/options/_show_mini.haml +8 -0
- data/app/views/iro/positions/_form.haml +8 -3
- data/app/views/iro/positions/_formpart_4data.haml +41 -38
- data/app/views/iro/positions/_gameui_covered_call.haml +1 -1
- data/app/views/iro/positions/_gameui_long_debit_call_spread.haml +5 -5
- data/app/views/iro/positions/_gameui_long_debit_call_spread.haml-trash +42 -0
- data/app/views/iro/positions/_gameui_short_debit_put_spread.haml +1 -0
- data/app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash +40 -0
- data/app/views/iro/positions/_header.haml +2 -0
- data/app/views/iro/positions/_header_long_debit_call_spread.haml +43 -25
- data/app/views/iro/positions/_prepare_long_debit_call_spread.haml +6 -5
- data/app/views/iro/positions/_prepare_short_debit_put_spread.haml +2 -1
- data/app/views/iro/positions/_table.haml +25 -26
- data/app/views/iro/positions/prepare.haml +6 -4
- data/app/views/iro/positions/prepare2.haml +22 -0
- data/app/views/iro/purses/_form_extra_fields.haml +8 -4
- data/app/views/iro/purses/_header.haml +19 -5
- data/app/views/iro/purses/_summary.haml +69 -62
- data/app/views/iro/purses/show.haml +1 -1
- data/app/views/iro/strategies/_form.haml +26 -19
- data/app/views/iro/strategies/_show.haml +6 -4
- data/config/routes.rb +10 -7
- metadata +8 -2
- data/app/views/iro/positions/_gameui_short_debit_put_spread.haml +0 -40
@@ -17,12 +17,11 @@
|
|
17
17
|
Strategy
|
18
18
|
%th.q Q
|
19
19
|
%th.strikes
|
20
|
-
-# .a outer_strike, inner_strike
|
21
20
|
Strike
|
22
21
|
%th.begin_price
|
23
|
-
.a Begin
|
22
|
+
.a Begin price, delta
|
24
23
|
%th.max-loss Max Loss
|
25
|
-
%th.max-gain Max Gain
|
24
|
+
-# %th.max-gain Max Gain
|
26
25
|
%th
|
27
26
|
.end_price End Price, delta
|
28
27
|
%th
|
@@ -64,9 +63,8 @@
|
|
64
63
|
= link_to '[~]', edit_position_path(position)
|
65
64
|
= link_to '[dup]', duplicate_position_path(position)
|
66
65
|
.d-flex
|
67
|
-
= link_to '[
|
68
|
-
|
69
|
-
= link_to '[roll]', prepare_to_roll_position_path(pos)
|
66
|
+
= link_to '[sync]', sync_position_path(pos)
|
67
|
+
= link_to '[roll]', prepare_to_roll_position_path(pos)
|
70
68
|
|
71
69
|
%td.ticker
|
72
70
|
= position.stock.ticker
|
@@ -88,32 +86,32 @@
|
|
88
86
|
<b>#{position.quantity}</b>
|
89
87
|
%td.strikes
|
90
88
|
.long-or-short-item
|
91
|
-
.outer-strike= pp_amount position.
|
92
|
-
.inner-strike= pp_amount position.
|
89
|
+
.outer-strike= pp_amount position.outer.strike
|
90
|
+
.inner-strike= pp_amount position.inner.strike
|
93
91
|
|
94
92
|
%td.begin_price
|
95
93
|
.long-or-short-item
|
96
94
|
.begin-outer-price
|
97
|
-
= pp_amount position.
|
98
|
-
|
95
|
+
= pp_amount position.outer.begin_price
|
96
|
+
<b>D</b> #{pp_delta position.outer.begin_delta}
|
99
97
|
.begin-inner-price
|
100
|
-
= pp_amount position.
|
101
|
-
|
98
|
+
= pp_amount position.inner.begin_price
|
99
|
+
<b>D</b> #{pp_delta position.inner.begin_delta}
|
102
100
|
%td
|
103
101
|
.max-loss= pp_amount position.max_loss * pos.q * 100, precision: 0
|
104
|
-
%td
|
105
|
-
|
106
|
-
|
107
|
-
|
102
|
+
-# %td
|
103
|
+
-# .max-gain= pp_amount position.max_gain * pos.q * 100, precision: 0
|
104
|
+
-# .max-gainp
|
105
|
+
-# -# = pp_percent( -1 * position.max_gain / position.max_loss ) rescue '-' # undef. for covered calls
|
108
106
|
|
109
|
-
%td.
|
107
|
+
%td.end
|
110
108
|
.long-or-short-item
|
111
109
|
.end-outer-price
|
112
|
-
= pp_amount position.
|
113
|
-
|
110
|
+
= pp_amount position.outer.end_price
|
111
|
+
<b>D</b> #{pp_delta position.outer.end_delta}
|
114
112
|
.end-inner-price
|
115
|
-
= pp_amount position.
|
116
|
-
|
113
|
+
= pp_amount position.inner.end_price
|
114
|
+
<b>D</b> #{pp_delta position.inner.end_delta}
|
117
115
|
%td.net
|
118
116
|
.a= pp_amount position.net_amount * pos.q * 100, precision: 0 rescue '@TODO'
|
119
117
|
.a <i>#{pp_percent position.net_amount / position.max_gain rescue '@TODO'}</i>
|
@@ -128,12 +126,13 @@
|
|
128
126
|
- if position.next_reasons.present?
|
129
127
|
%i.fa.fa-expand.collapse-expand{ id: "pos-reasons-#{position.id}" } reasons
|
130
128
|
= render '/iro/positions/reasons', reasons: position.next_reasons
|
131
|
-
.a= position.
|
132
|
-
.a= position.next_delta
|
129
|
+
.a= position.autonxt
|
133
130
|
.a
|
134
|
-
|
135
|
-
|
136
|
-
|
131
|
+
- if pos.autonxt
|
132
|
+
= link_to '[autonxt]', prepare2_position_path(pos.autonxt)
|
133
|
+
= pp_amount pos.autonxt.prev_gain_loss_amount
|
134
|
+
-# \=>
|
135
|
+
-# = pp_amount position.next_outcome * 100 * position.quantity rescue nil
|
137
136
|
|
138
137
|
|
139
138
|
|
@@ -14,10 +14,12 @@
|
|
14
14
|
|
15
15
|
= render "/iro/positions/gameui_#{pos.strategy.kind}", position: pos
|
16
16
|
|
17
|
-
|
18
|
-
.
|
19
|
-
|
20
|
-
|
17
|
+
%div{ class: pos.long_or_short }
|
18
|
+
.long-or-short-item{ style: "border-left: 0" }
|
19
|
+
- @positions.each_with_index do |pos, idx|
|
20
|
+
.reviewing
|
21
|
+
= render "/iro/positions/header_#{pos.strategy.kind}", pos: pos, collapse_key: 'roll'
|
22
|
+
= render "/iro/positions/prepare_#{pos.strategy.kind}", pos: pos
|
21
23
|
|
22
24
|
|
23
25
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
- pos = @position
|
3
|
+
|
4
|
+
-## long call spread
|
5
|
+
%ul
|
6
|
+
%li
|
7
|
+
buy to close
|
8
|
+
= pos.autoprev.inner
|
9
|
+
%li
|
10
|
+
sell to close
|
11
|
+
= pos.autoprev.outer
|
12
|
+
%li
|
13
|
+
buy to open
|
14
|
+
= pos.outer
|
15
|
+
%li
|
16
|
+
sell to open
|
17
|
+
= pos.inner
|
18
|
+
%li
|
19
|
+
Query
|
20
|
+
%pre= JSON.pretty_generate( @query )
|
21
|
+
|
22
|
+
= button_to 'Place Order', prepare3_position_path(@position), data: { confirm: 'Are you sure?' }
|
@@ -4,12 +4,18 @@
|
|
4
4
|
= f.number_field :unit
|
5
5
|
px/usd
|
6
6
|
|
7
|
-
|
8
7
|
%label height
|
9
8
|
= f.number_field :height
|
10
|
-
px
|
9
|
+
px/q
|
10
|
+
|
11
|
+
|
12
|
+
%label summary_unit
|
13
|
+
= f.number_field :summary_unit, step: 0.000001, style: "width: 120px"
|
14
|
+
px/usd
|
11
15
|
|
12
16
|
|
17
|
+
|
18
|
+
|
13
19
|
%label mark_every_n_usd
|
14
20
|
= f.number_field :mark_every_n_usd, step: 0.01
|
15
21
|
|
@@ -18,8 +24,6 @@
|
|
18
24
|
= f.number_field :n_next_positions
|
19
25
|
|
20
26
|
|
21
|
-
%label summary_scale
|
22
|
-
= f.number_field :summary_scale, step: 0.0001, style: "width: 120px"
|
23
27
|
|
24
28
|
|
25
29
|
|
@@ -5,13 +5,27 @@
|
|
5
5
|
%h5.title
|
6
6
|
Purse `#{purse.slug}`
|
7
7
|
= link_to '[~]', edit_purse_path(purse)
|
8
|
-
= link_to '[
|
9
|
-
= link_to '[gameUI]',
|
8
|
+
= link_to '[table]', purse_path(purse)
|
9
|
+
= link_to '[gameUI]', purse_gameui_path(purse)
|
10
10
|
(#{purse.positions.length})
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
.d-flex
|
13
|
+
|
14
|
+
.Card.d-flex
|
15
|
+
= form_for Iro::Position.new(strategy: Iro::Strategy.new), url: new_position_path, method: :get do |f|
|
16
|
+
.a +Position
|
17
|
+
= hidden_field_tag 'position[purse_id]', purse.id
|
18
|
+
.field
|
19
|
+
= f.select :strategy_id, options_for_select(@strategies_list)
|
20
|
+
-# .field
|
21
|
+
-# = f.radio_button :long_or_short, :long
|
22
|
+
-# %label long
|
23
|
+
-# = f.radio_button :long_or_short, :short
|
24
|
+
-# %label short
|
25
|
+
= f.submit 'Go'
|
26
|
+
-# = link_to '[+position]', new_position_path({ purse_id: purse.id })
|
27
|
+
-# = link_to '[+short]', new_position_path({ purse_id: purse.id, long_or_short: Iro::Strategy::SHORT })
|
28
|
+
|
15
29
|
|
16
30
|
- if true || params[:template] == 'gameui'
|
17
31
|
.mini-inputs
|
@@ -1,69 +1,76 @@
|
|
1
1
|
|
2
2
|
- u = @purse.unit
|
3
|
-
-
|
3
|
+
- summary_unit = @purse.summary_unit
|
4
4
|
- collapse_key ||= nil
|
5
5
|
|
6
|
-
|
7
|
-
.
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
.
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
%
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
6
|
+
- if @purse.positions.present?
|
7
|
+
%i.fa.fa-expand.collapse-expand{ id: "pursesSummary_#{collapse_key}", style: "margin-left: -1em;" } Summary
|
8
|
+
.PurseSummaryW
|
9
|
+
.PurseSummary
|
10
|
+
|
11
|
+
.summary-amount
|
12
|
+
.max-gl.long.loss{ style: "height: #{@max_loss_long *-1*summary_unit*u}px" }
|
13
|
+
%label Long Loss
|
14
|
+
.delta
|
15
|
+
.begin.long{ style: "height: #{@purse.delta_to_plot_p( :begin, :long, :inner )}" }
|
16
|
+
.end.long{ style: "height: #{@purse.delta_to_plot_p( :end, :long, :inner )}" }
|
17
|
+
|
18
|
+
.max-gl.short.loss{ style: "height: #{@max_loss_short *-1*summary_unit*u}px" }
|
19
|
+
%label Short Loss
|
20
|
+
.delta
|
21
|
+
.begin.short{ style: "height: #{@purse.delta_to_plot_p( :begin, :short, :inner )}" }
|
22
|
+
.end.short{ style: "height: #{@purse.delta_to_plot_p( :end, :short, :inner )}" }
|
23
|
+
|
24
|
+
- if @loss_long
|
25
|
+
.net-gl.loss.long.loss-long{ style: "height: #{@loss_long *-1*summary_unit*u}px" }
|
26
|
+
- if @loss_short
|
27
|
+
.net-gl.loss.short.loss-short{ style: "height: #{@loss_short *-1*summary_unit*u}px" }
|
28
|
+
|
29
|
+
-# %label Gain
|
30
|
+
.summary-amount
|
31
|
+
.max-gl.long.gain{ style: "height: #{@max_gain_long *summary_unit*u}px" }
|
32
|
+
.max-gl.short.gain{ style: "height: #{@max_gain_short *summary_unit*u}px" }
|
33
|
+
- if @gain_long
|
34
|
+
.net-gl.gain.long.gain-long{ style: "height: #{@gain_long *summary_unit*u}px" }
|
35
|
+
- if @gain_short
|
36
|
+
.net-gl.gain.short.gain-short{ style: "height: #{@gain_short *summary_unit*u}px" }
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
.legendW
|
44
|
+
.legend
|
45
|
+
%ul
|
46
|
+
%li
|
47
|
+
<b>exposure long:</b> #{pp_amount @max_loss_long *-1}
|
48
|
+
<b>short:</b> #{pp_amount @max_loss_short *-1}
|
49
|
+
%li
|
50
|
+
<b>max loss long:</b> #{pp_amount [ @max_loss_long + @max_gain_short, 0].min }
|
51
|
+
<b>short:</b> #{pp_amount [ @max_loss_short + @max_gain_long, 0].min }
|
52
|
+
%li.gray
|
53
|
+
<b>max gain long:</b> #{pp_amount @max_gain_long}
|
54
|
+
<b>short:</b> #{pp_amount @max_gain_short}
|
55
|
+
|
56
|
+
%li
|
57
|
+
%hr
|
58
|
+
<b>gain long:</b> #{pp_amount @gain_long}
|
59
|
+
<b>short:</b> #{pp_amount @gain_short}
|
60
|
+
%li
|
61
|
+
<b>loss long:</b> #{pp_amount @loss_long}
|
62
|
+
<b>short:</b> #{pp_amount @loss_short}
|
63
|
+
|
64
|
+
%li
|
65
|
+
%hr
|
66
|
+
<b>Delta long begin:</b> #{pp_delta @purse.delta_wt_avg( :begin, :long, :inner )}
|
67
|
+
<b>end:</b> #{pp_delta @purse.delta_wt_avg( :end, :long, :inner )}
|
68
|
+
%li
|
69
|
+
<b>Delta short begin:</b> #{pp_delta @purse.delta_wt_avg( :begin, :short, :inner )}
|
70
|
+
<b>end:</b> #{pp_delta @purse.delta_wt_avg( :end, :short, :inner )}
|
59
71
|
|
60
|
-
%li
|
61
72
|
%hr
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
%li
|
66
|
-
<b>end D long:</b> #{pp_delta @end_delta_long}
|
67
|
-
<b>short:</b> #{pp_delta @end_delta_short}
|
68
|
-
<b>net:</b> #{pp_delta @end_delta_long - @end_delta_short}
|
73
|
+
%li
|
74
|
+
<b>Available amount:</b> #{@purse.available_amount}
|
75
|
+
|
69
76
|
|
@@ -4,45 +4,52 @@
|
|
4
4
|
.actions
|
5
5
|
= f.submit
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
7
|
+
.row
|
8
|
+
.col-md-6
|
9
|
+
.field
|
10
|
+
%label Kind
|
11
|
+
= f.select :kind, options_for_select( Iro::Strategy::KINDS, selected: strategy.kind )
|
12
|
+
.field
|
13
|
+
%label long or short?
|
14
|
+
= f.select :long_or_short, options_for_select([nil, Iro::Strategy::LONG, Iro::Strategy::SHORT], selected: strategy.long_or_short)
|
15
|
+
.field
|
16
|
+
%label stock
|
17
|
+
= f.select :stock_id, options_for_select(@stocks_list, selected: strategy.stock_id), class: 'select2'
|
18
|
+
|
19
|
+
.col-md-6
|
20
|
+
.field
|
21
|
+
%label slug
|
22
|
+
= f.text_field :slug
|
23
|
+
%hr
|
20
24
|
|
21
25
|
|
22
26
|
.field
|
23
27
|
= f.label :buffer_above_water
|
24
28
|
= f.number_field :buffer_above_water, placeholder: "0.49", step: 0.01
|
29
|
+
.field
|
30
|
+
= f.label :min_dte
|
31
|
+
= f.number_field :min_dte, placeholder: "0"
|
25
32
|
-# .field
|
26
33
|
-# = f.label :next_max_outer_delta
|
27
34
|
-# = f.number_field :next_max_outer_delta, placeholder: "0.25", step: 0.01
|
28
35
|
.field
|
29
36
|
= f.label :next_inner_delta
|
30
|
-
= f.number_field :next_inner_delta, placeholder: "0.25", step: 0.
|
37
|
+
= f.number_field :next_inner_delta, placeholder: "0.25", step: 0.001
|
31
38
|
.field
|
32
39
|
= f.label :next_inner_strike
|
33
40
|
= f.number_field :next_inner_strike, placeholder: "20.0", step: 0.01
|
34
41
|
.field
|
35
42
|
= f.label :next_spread_amount
|
36
43
|
= f.number_field :next_spread_amount, placeholder: "20", step: 0.1
|
44
|
+
.field
|
45
|
+
= f.label :next_buffer_above_water
|
46
|
+
= f.number_field :next_buffer_above_water, placeholder: "80", step: 0.01
|
37
47
|
.field
|
38
48
|
= f.label :threshold_delta
|
39
|
-
= f.number_field :threshold_delta, placeholder: "0.14", step: 0.
|
49
|
+
= f.number_field :threshold_delta, placeholder: "0.14", step: 0.001
|
40
50
|
.field
|
41
51
|
= f.label :threshold_netp
|
42
|
-
= f.number_field :threshold_netp, placeholder: "0.69", step: 0.
|
43
|
-
-# .field
|
44
|
-
-# = f.label :current_underlying_strike
|
45
|
-
-# = f.number_field :current_underlying_strike, placeholder: "16.66", step: 0.01
|
52
|
+
= f.number_field :threshold_netp, placeholder: "0.69", step: 0.001
|
46
53
|
|
47
54
|
.actions
|
48
55
|
= f.submit
|
@@ -6,14 +6,16 @@
|
|
6
6
|
= strategy
|
7
7
|
%ul
|
8
8
|
-# %li <b>ticker:</b> #{strategy.ticker}
|
9
|
-
%li <b>slug:</b> #{strategy.slug}
|
9
|
+
-# %li <b>slug:</b> #{strategy.slug}
|
10
10
|
|
11
11
|
%li <b>buffer_above_water:</b> #{strategy.buffer_above_water}
|
12
|
+
%li <b>threshold_delta:</b> #{strategy.threshold_delta}
|
13
|
+
%li <b>threshold_netp:</b> #{strategy.threshold_netp}
|
14
|
+
|
15
|
+
%hr
|
12
16
|
|
13
17
|
%li <b>next_inner_delta:</b> #{strategy.next_inner_delta}
|
14
18
|
-# %li <b>next_outer_delta:</b> #{strategy.next_max_outer_delta}
|
15
19
|
%li <b>next_inner_strike:</b> #{strategy.next_inner_strike}
|
16
|
-
|
17
|
-
%li <b>threshold_delta:</b> #{strategy.threshold_delta}
|
18
|
-
%li <b>threshold_netp:</b> #{strategy.threshold_netp}
|
20
|
+
%li <b>next_spread_amount:</b> #{strategy.next_spread_amount}
|
19
21
|
|
data/config/routes.rb
CHANGED
@@ -9,19 +9,22 @@ Iro::Engine.routes.draw do
|
|
9
9
|
|
10
10
|
resources :option_watches
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
match 'positions/:id/close', to: 'positions#close', as: :close_position, via: [ :get, :post ]
|
13
|
+
get 'positions/duplicate/:id', to: 'positions#new', as: :duplicate_position
|
14
|
+
post 'positions/propose', to: 'positions#propose', as: :propose_position
|
15
|
+
get 'positions/:id/prepare', to: 'positions#prepare', as: :prepare_to_roll_position, defaults: { template: 'gameui' }
|
16
|
+
match 'positions/:id/prepare2', to: 'positions#prepare2', as: :prepare2_position, defaults: { template: 'gameui' }, via: [ :get, :post ]
|
17
|
+
match 'positions/:id/prepare3', to: 'positions#prepare3', as: :prepare3_position, defaults: { template: 'gameui' }, via: [ :get, :post ]
|
18
|
+
post 'positions/:id/roll', to: 'positions#do_roll', as: :roll_position
|
19
|
+
get 'positions/:id/sync', to: 'positions#sync', as: :sync_position
|
17
20
|
resources :positions
|
18
21
|
resources :profiles
|
19
22
|
|
20
|
-
get 'purses/:id/gameui', to: 'purses#show', as: :
|
23
|
+
get 'purses/:id/gameui', to: 'purses#show', as: :purse_gameui, defaults: { template: 'gameui' }
|
21
24
|
get 'purses/:id', to: 'purses#show', as: :purse, defaults: { template: 'show' }
|
22
25
|
resources :purses
|
23
26
|
|
24
|
-
get 'stocks/
|
27
|
+
get 'stocks/sync', to: 'stocks#sync', as: :sync_stocks
|
25
28
|
resources :stocks
|
26
29
|
|
27
30
|
resources :strategies
|
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.26
|
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-
|
11
|
+
date: 2024-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: business_time
|
@@ -217,6 +217,7 @@ files:
|
|
217
217
|
- app/assets/config/iron_warbler_manifest.js
|
218
218
|
- app/assets/javascript/iron_warbler/application.js
|
219
219
|
- app/assets/javascript/iron_warbler/gameui.js
|
220
|
+
- app/assets/stylesheets/iron_warbler/Card.scss
|
220
221
|
- app/assets/stylesheets/iron_warbler/application.css
|
221
222
|
- app/assets/stylesheets/iron_warbler/positions.scss
|
222
223
|
- app/assets/stylesheets/iron_warbler/positions_gameui.scss
|
@@ -242,6 +243,7 @@ files:
|
|
242
243
|
- app/models/iro/datapoint.rb
|
243
244
|
- app/models/iro/date.rb
|
244
245
|
- app/models/iro/option.rb
|
246
|
+
- app/models/iro/option_black_scholes.rb
|
245
247
|
- app/models/iro/position.rb
|
246
248
|
- app/models/iro/price_item.rb
|
247
249
|
- app/models/iro/purse.rb
|
@@ -256,12 +258,15 @@ files:
|
|
256
258
|
- app/views/iro/alerts/index.haml
|
257
259
|
- app/views/iro/api/stocks/show.jbuilder
|
258
260
|
- app/views/iro/application/home.haml
|
261
|
+
- app/views/iro/options/_show_mini.haml
|
259
262
|
- app/views/iro/positions/_form.haml
|
260
263
|
- app/views/iro/positions/_formpart_4data.haml
|
261
264
|
- app/views/iro/positions/_gameui_covered_call.haml
|
262
265
|
- app/views/iro/positions/_gameui_covered_call.haml-bk
|
263
266
|
- app/views/iro/positions/_gameui_long_debit_call_spread.haml
|
267
|
+
- app/views/iro/positions/_gameui_long_debit_call_spread.haml-trash
|
264
268
|
- app/views/iro/positions/_gameui_short_debit_put_spread.haml
|
269
|
+
- app/views/iro/positions/_gameui_short_debit_put_spread.haml-trash
|
265
270
|
- app/views/iro/positions/_header.haml
|
266
271
|
- app/views/iro/positions/_header_covered_call.haml
|
267
272
|
- app/views/iro/positions/_header_long_debit_call_spread.haml
|
@@ -274,6 +279,7 @@ files:
|
|
274
279
|
- app/views/iro/positions/edit.haml
|
275
280
|
- app/views/iro/positions/new.haml
|
276
281
|
- app/views/iro/positions/prepare.haml
|
282
|
+
- app/views/iro/positions/prepare2.haml
|
277
283
|
- app/views/iro/positions/roll-cc.haml-bk
|
278
284
|
- app/views/iro/positions/roll.haml-trash
|
279
285
|
- app/views/iro/purses/_form.haml
|
@@ -1,40 +0,0 @@
|
|
1
|
-
|
2
|
-
- pos = position
|
3
|
-
- stock = pos.stock
|
4
|
-
- nearest_strike = stock.last.round
|
5
|
-
- u = pos.purse.unit # pixels per dollar
|
6
|
-
|
7
|
-
|
8
|
-
.collapse-expand.d-flex{ id: "gameui-pos-#{pos.id}" }
|
9
|
-
[<>]
|
10
|
-
.maxwidth= render "/iro/positions/header", pos: pos
|
11
|
-
.a
|
12
|
-
= render "/iro/positions/header_#{pos.strategy.kind}", pos: pos
|
13
|
-
.StockCoordinatesW
|
14
|
-
.StockCoordinates{ style: "height: #{pos.q() *u}px " }
|
15
|
-
.grid= render "/iro/stocks/grid_#{pos.strategy.long_or_short}", stock: stock, position: pos
|
16
|
-
|
17
|
-
.Origin{ style: "left: #{ ( nearest_strike - stock.last )* u}px" }
|
18
|
-
.label Last: #{pp_amount stock.last}
|
19
|
-
.c
|
20
|
-
|
21
|
-
-## these are different
|
22
|
-
- left = "#{ ( stock.last - pos.outer_strike ) * u}px"
|
23
|
-
- width = "#{ ( pos.outer_strike - pos.inner_strike ) * u}px"
|
24
|
-
.PositionW{ class: pos.strategy.kind, style: "left: #{left}; width: #{width}; " }
|
25
|
-
.Position
|
26
|
-
.MaxGain{ style: "width: #{pos.max_gain * u}px" }
|
27
|
-
.RollGuide
|
28
|
-
|
29
|
-
- if pos.net_amount >= 0
|
30
|
-
.Net.NetPositive{ style: "width: #{ (pos.net_amount / 100) * u }px; right: 0" }
|
31
|
-
.label
|
32
|
-
net
|
33
|
-
= pp_amount pos.net_amount
|
34
|
-
- else
|
35
|
-
.Net.NetNegative{ style: "width: #{ (-1 * pos.net_amount / 100) * u }px; left: 100%" }
|
36
|
-
.label
|
37
|
-
net
|
38
|
-
= pp_amount pos.net_amount
|
39
|
-
.c
|
40
|
-
|