iron_warbler 2.0.7.48 → 2.0.7.50

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.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/iron_warbler/application.css +0 -9
  3. data/app/assets/stylesheets/iron_warbler/positions.scss +4 -0
  4. data/app/assets/stylesheets/iron_warbler/positions_gameui.scss +2 -2
  5. data/app/assets/stylesheets/iron_warbler/purses.scss +2 -1
  6. data/app/assets/stylesheets/iron_warbler/purses_gameui.scss +63 -21
  7. data/app/assets/stylesheets/iron_warbler/purses_summary.scss +113 -79
  8. data/app/assets/stylesheets/iron_warbler/utils.scss +5 -4
  9. data/app/controllers/iro/application_controller.rb +0 -2
  10. data/app/controllers/iro/positions_controller.rb +88 -24
  11. data/app/controllers/iro/purses_controller.rb +53 -53
  12. data/app/controllers/iro/stocks_controller.rb +1 -1
  13. data/app/views/iro/_main_header.haml +8 -9
  14. data/app/views/iro/positions/_form_spread.haml +5 -3
  15. data/app/views/iro/positions/_gameui_long_credit_put_spread.haml +10 -7
  16. data/app/views/iro/positions/_gameui_short_credit_call_spread.haml +10 -6
  17. data/app/views/iro/positions/_header.haml +1 -0
  18. data/app/views/iro/positions/_header_long_credit_put_spread.haml +11 -7
  19. data/app/views/iro/positions/_header_short_credit_call_spread.haml +10 -8
  20. data/app/views/iro/positions/_new.haml +2 -2
  21. data/app/views/iro/positions/_prepare_header_short_credit_call_spread.haml +4 -3
  22. data/app/views/iro/positions/_prepare_long_credit_put_spread.haml +4 -2
  23. data/app/views/iro/positions/_prepare_short_credit_call_spread.haml +4 -2
  24. data/app/views/iro/positions/_reasons.haml +1 -1
  25. data/app/views/iro/positions/_table_tr_covered_call.haml +1 -1
  26. data/app/views/iro/positions/_table_tr_long_credit_put_spread.haml +17 -11
  27. data/app/views/iro/positions/index.haml +5 -0
  28. data/app/views/iro/positions/place2.haml +27 -0
  29. data/app/views/iro/positions/prepare.haml +1 -1
  30. data/app/views/iro/positions/prepare2.haml +24 -18
  31. data/app/views/iro/purses/_form_extra_fields.haml +21 -16
  32. data/app/views/iro/purses/_header.haml +49 -36
  33. data/app/views/iro/purses/_summary.haml +60 -27
  34. data/app/views/iro/purses/_summary2.haml +77 -0
  35. data/app/views/iro/purses/gameui.haml +4 -7
  36. data/app/views/iro/purses/show.haml +1 -7
  37. data/app/views/iro/stocks/_form.haml +3 -0
  38. data/app/views/iro/stocks/index.haml +1 -1
  39. data/app/views/iro/strategies/_form_spread.haml +12 -11
  40. data/app/views/iro/strategies/_list.haml +4 -0
  41. data/app/views/iro/strategies/_show.haml +4 -3
  42. data/app/views/iro/strategies/_table.haml +8 -4
  43. data/app/views/iro/strategies/edit.haml +2 -0
  44. data/app/views/layouts/iro/application.haml +1 -2
  45. data/config/routes.rb +6 -1
  46. metadata +6 -4
  47. data/app/views/iro/strategies/_form.haml-bk +0 -72
  48. /data/app/views/iro/positions/{_gameui_spread.haml → _gameui_spread.haml-bk} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3df374cfa080a6f1eeb4ed4644184e739cc398264e09412ecaf43d6e516bfb2
4
- data.tar.gz: 8e29f3320d558a274b17f9f79902197e81441eeba1c97d495f416e53bafcf82e
3
+ metadata.gz: 34e2545b7c9088e737b36b2436c475bd820e1e0f00c507f84166eca1c616421e
4
+ data.tar.gz: 1e0bb92359a9ebc0c3a0e9cd4dc252e48da5097096f94855a88c2a0dfd41fd10
5
5
  SHA512:
6
- metadata.gz: de25201bd6197b74a46baba0d4aa07a4712a840e2d6e657acdbada383d646de6395bef04d27eb8529873bd6cf2ab749ffe9c64fa315a12392e8b30971b4dd778
7
- data.tar.gz: 2ac509fba9351eeaeb5e406f253a66e24eb13353ef58207c82f7d0942140ef5ceb82d61c59c21838b34ac8be7dc0c1e117568d5514cf9a5b01c585ce29e06d18
6
+ metadata.gz: 3e0ea3ed8e276d87f870f295c61cf5c2119fe9b375d7f12f8b2090a1f161300883361f530d4855949cb2677f4a26d5a43f419efb52bf517d221d6182be2c2f0a
7
+ data.tar.gz: 5236754132aeee57af308c4c86e73fdb4a39de56770a47a0c125444fcc7f437ca544a525fabc0158c064690eb2b4cb478d8167a627f68298015534ae62f96c78
@@ -24,18 +24,9 @@ html {
24
24
  --iro-color-bg2: #fefefe;
25
25
  }
26
26
 
27
- /* body {
28
- color: red !important;
29
- } */
30
-
31
27
  .iro--main-header {
32
28
  li {
33
29
  margin-bottom: 0.2em;
34
-
35
- a {
36
- background: white;
37
- padding: 0 0.2em;
38
- }
39
30
  }
40
31
  }
41
32
 
@@ -2,6 +2,10 @@
2
2
  .positions--header {
3
3
  position: relative;
4
4
  z-index: 1;
5
+ ul {
6
+ margin: 0;
7
+ padding: 0;
8
+ }
5
9
  }
6
10
 
7
11
  .begin-inner-price,
@@ -1,7 +1,7 @@
1
1
 
2
- .positions--prepare {
2
+ .positions-prepare {
3
3
  .RollGuide {
4
- height: 100vh;
4
+ height: 200vh;
5
5
  border: 1px dashed gray;
6
6
  position: absolute;
7
7
  right: 0;
@@ -2,11 +2,12 @@
2
2
  .purses--form-extra-fields {
3
3
  background: rgba(255,255,255, 0.5);
4
4
  padding: 0.3em 0;
5
- margin-bottom: 0.5em;
5
+ // margin-bottom: 0.5em;
6
6
 
7
7
  line-height: 1.5em;
8
8
  input {
9
9
  height: 1.5em;
10
+ min-width: 90px;
10
11
  }
11
12
 
12
13
  > div {
@@ -8,13 +8,25 @@
8
8
 
9
9
  .purses-gameui {
10
10
 
11
+ .divider-expiry {
12
+ height: 5px;
13
+ width: 100%;
14
+ background: red;
15
+ }
16
+ .divider-ticker {
17
+ height: 2px;
18
+ width: 100%;
19
+ background: red;
20
+ margin-bottom: 20px;
21
+ }
22
+
11
23
  .Origin::before {
12
24
  position: absolute;
13
25
  top: -1em;
14
26
  content: "";
15
27
  margin-left: -1em;
16
28
  border: 1em solid transparent;
17
- border-top: 1em solid black;
29
+ border-top: 1em solid #666;
18
30
  }
19
31
  .Origin {
20
32
  position: absolute;
@@ -23,13 +35,18 @@
23
35
  height: 100%;
24
36
  width: 100%;
25
37
 
26
- > .label {
27
- width: 300px;
38
+ > .origin-label {
39
+ // border: 1px solid cyan;
40
+
41
+ width: 200px;
28
42
 
29
43
  position: absolute;
30
44
  top: -1.5em;
31
45
  left: 1.2em;
32
46
  z-index: 2;
47
+
48
+ color: #666;
49
+
33
50
  }
34
51
  }
35
52
  .PositionW.covered_call {
@@ -69,8 +86,8 @@
69
86
  right: 0;
70
87
  bottom: 0;
71
88
  border: 2px dotted green;
72
- background: rgba(0,255,0, 0.5);
73
- height: 0.5em;
89
+ background: rgba(50,55,55, 0.5);
90
+ height: 25%;
74
91
  }
75
92
  .PositionW.is-short .MaxGain {
76
93
  right: auto;
@@ -90,6 +107,7 @@
90
107
 
91
108
  // background: var(--iro-color-bg2);
92
109
  // border: 1px solid red;
110
+ margin-top: 1em;
93
111
  margin-bottom: 2em;
94
112
 
95
113
  position: relative;
@@ -108,40 +126,64 @@
108
126
  .Last {
109
127
  border-left: 2px dotted red;
110
128
  }
111
- .label {
112
- width: 200px;
113
- color: gray;
114
- // border: 1px solid cyan;
115
- }
116
129
 
117
130
  .marker {
118
131
  position: absolute;
119
132
  height: 100%;
120
133
  }
121
134
 
122
- .PositionW.is-short .Net .label {
123
- text-align: right;
124
- position: absolute;
125
- right: 0;
135
+ .PositionW.is-short {
136
+ .NetNegative {
137
+ left: 0;
138
+ }
139
+ .NetPositive {
140
+ right: 0;
141
+ }
142
+ .Net .label {
143
+ text-align: right;
144
+ left: 0;
145
+ .labelC {
146
+ right: 0.5em;
147
+ }
148
+ }
149
+ }
150
+ .PositionW.is-long {
151
+ .NetNegative {
152
+ right: 0;
153
+ }
154
+ .NetPositive {
155
+ left: 100%;
156
+ }
157
+ .Net .label {
158
+ text-align: left;
159
+ right: 0;
160
+ .labelC {
161
+ left: 0.5em;
162
+ }
163
+ }
126
164
  }
127
165
  .Net {
128
166
  position: absolute;
129
- // bottom: 3em;
130
- // z-index: 3;
131
- height: 90%;
167
+ height: 70%;
132
168
 
133
169
  .label {
134
170
  color: white;
135
171
  text-shadow: 1px 1px black;
172
+ width: 0;
173
+ position: absolute;
174
+
175
+ .labelC {
176
+ width: 200px;
177
+ position: absolute;
178
+ }
136
179
  }
137
180
  }
138
- .NetPositive {
139
- border: 2px dashed #339966;
140
- background: rgba(32,64,96, 0.5);
141
- }
142
181
  .NetNegative {
143
182
  background: rgba(255,0,0, 0.75);
144
183
  }
184
+ .NetPositive {
185
+ background: rgba(32,164,96, 0.5);
186
+ }
145
187
 
146
188
  .grid-mark {
147
189
  // border: 1px solid red;
@@ -1,110 +1,144 @@
1
1
 
2
- .PurseSummaryW {
3
- position: relative;
4
- background: rgba(255,255,255, 0.75);
5
- height: 400px;
6
- width: 100%;
7
- z-index: 5;
8
- }
9
- .PurseSummary {
10
- position: absolute;
11
- top: 200px;
12
-
2
+ .summaries {
13
3
  display: flex;
4
+ }
5
+ .purses--summary2 {
6
+ // border: 1px solid yellow;
14
7
 
15
- width: 100%;
16
- height: 0;
17
- border-bottom: 1px dotted black;
8
+ label {
9
+ position: absolute;
10
+ }
18
11
 
19
12
  .legendW {
20
- position: relative;
21
- // margin-top: 50%;
13
+ height: 100px;
14
+ margin-left: 60px;
22
15
 
23
- .legend {
24
- margin-top: -50%;
16
+ display: flex;
17
+ }
25
18
 
26
- // position: absolute;
27
- // top: -200px;
28
- // width: 400px;
29
- // height: 400px;
19
+ .PurseSummaryW {
20
+ margin-left: 1em;
21
+ width: 500px;
22
+ z-index: 11;
23
+ height: 400px;
24
+ position: relative;
25
+ background: rgba(255,255,255, 0.75);
30
26
 
31
- background: white;
32
- padding: 0.5em;
33
- }
27
+ }
28
+ .PurseSummary {
29
+ position: absolute;
30
+ top: 50%;
31
+ width: 100%;
32
+ height: 0;
33
+ border-bottom: 1px solid black;
34
34
  }
35
35
 
36
+ /* shared */
37
+ .summary-long, .summary-short {
38
+ // border: 1px solid blue;
39
+ position: absolute;
36
40
 
37
- /*
38
- * summary amount and delta
39
- **/
40
- .summary-amount {
41
- position: relative;
42
- width: 100px;
43
- margin-right: 2em;
41
+ display: flex;
44
42
 
45
- .net-gl {
46
- width: 100%;
47
- background: rgba(0,0,0, 0.5);
48
- }
43
+ width: 100%;
44
+ // height: 300px;
49
45
 
50
- .delta {
46
+ .deltaW {
47
+ border: 2px solid black;
48
+ height: 0;
49
+ display: flex;
50
+ align-items: center;
51
51
  position: absolute;
52
- left: 100px;
53
- height: 100%;
52
+ top: 50%;
53
+ left: 110px;
54
54
 
55
- > div {
56
- border: 1px dotted yellow;
57
- width: 0.5em;
58
- }
59
- .begin {
60
- width: 1em;
55
+ .delta {
56
+ // border: 2px dashed green;
57
+ width: 20px;
61
58
 
62
- background: black;
63
- }
64
- .end {
65
- width: .5em;
66
- left: .25em;
59
+ display: flex;
60
+ align-items: center;
61
+
62
+ .begin {
63
+ width: 100%;
64
+ background: rgba(0,0,0, 0.25);
65
+ }
66
+ .end {
67
+ width: 50%;
68
+ // background: rgba(0,0,0, 0.75);
69
+ }
67
70
 
68
- background: rgba(255,0,0, 0.5);
69
71
  }
70
72
  }
71
73
 
72
- }
74
+ /* shared */
75
+ .plot {
76
+ background: rgba(255,153,0, 0.5);
73
77
 
78
+ position: relative;
74
79
 
75
- .loss {
76
- }
77
- .gain {
78
- }
79
- .max-gl {
80
- position: absolute;
81
- width: 100%;
80
+ width: 100px;
82
81
 
83
- label {
84
- position: absolute;
82
+ .max-gl {
83
+ width: 100%;
84
+ position: absolute;
85
+ background: rgba(255,255,0, 0.5);
86
+ }
87
+ .net-gl {
88
+ position: absolute;
89
+ width: 90%;
90
+ }
91
+ .gain {
92
+ background: rgba(0,0,0, 0.70);
93
+ }
94
+ .loss {
95
+ background: rgba(255,0,0, 0.5);
96
+ }
85
97
  }
86
-
87
-
88
98
  }
89
- .max-gl.long {
90
- }
91
- .max-gl.short {
92
- display: flex;
93
- flex-direction: column-reverse;
94
- }
95
- .long {
96
- position: absolute;
99
+
100
+ .summary-long {
97
101
  top: 0;
98
102
 
99
- background: rgba(255,0,0, 0.5);
100
- border: 1px solid red;
101
- bottom: 0;
103
+ .legendW {
104
+ flex-direction: column;
105
+ }
106
+ .plot {
107
+ bottom: 0;
108
+ .gain {
109
+ bottom: 0;
110
+ }
111
+ .max-gl {
112
+ bottom: 0;
113
+ }
114
+ }
102
115
  }
103
- .short {
104
- background: rgba(255,153,0, 0.5);
105
- border: 1px solid orange;
106
116
 
107
- position: absolute;
117
+ .summary-short {
108
118
  bottom: 0;
119
+
120
+ display: flex;
121
+ align-items: flex-end;
122
+
123
+ .deltaW {
124
+ left: 140px;
125
+ }
126
+ label {
127
+ bottom: 0;
128
+ }
129
+ .legendW {
130
+ flex-direction: column-reverse;
131
+ }
132
+ .plot {
133
+ background: rgba(255,153,0, 0.5);
134
+ width: 100px;
135
+
136
+ .gain {
137
+ top: 0;
138
+ }
139
+ .loss {
140
+ bottom: 0;
141
+ }
142
+ }
109
143
  }
110
- }
144
+ }
@@ -70,7 +70,7 @@
70
70
  /* M */
71
71
 
72
72
  .mini-inputs {
73
- background: rgba(255,255,255, 0.25);
73
+ // background: rgba(255,255,255, 0.25);
74
74
  }
75
75
 
76
76
  .modal-absolute {
@@ -83,15 +83,16 @@
83
83
  position: absolute;
84
84
 
85
85
  min-width: 200px;
86
- width: 400px;
86
+ // width: 400px;
87
87
 
88
88
  min-height: 200px;
89
- height: 300px;
89
+ // height: 300px;
90
+
90
91
  /* overflow: auto; */
91
92
 
92
93
  background: white;
93
94
 
94
- z-index: 2;
95
+ z-index: 200;
95
96
 
96
97
  }
97
98
 
@@ -31,8 +31,6 @@ class Iro::ApplicationController < Wco::ApplicationController
31
31
 
32
32
  def set_lists
33
33
  @purses = Iro::Purse.all.order_by( slug: :asc )
34
- # @strategies = Iro::Strategy.all
35
- # @strategies_list = Iro::Strategy.list
36
34
  end
37
35
 
38
36
 
@@ -1,26 +1,36 @@
1
1
 
2
2
  class Iro::PositionsController < Iro::ApplicationController
3
- before_action :set_lists
3
+
4
+ def check
5
+ @position = Iro::Position.find params[:id]
6
+ authorize! :check, @position
7
+ outs = Tda::Order.check_status @position.schwab_order_id
8
+ @position.update({ schwab_status: outs[:status] })
9
+ puts! outs, 'outs'
10
+ redirect_to request.referrer
11
+ end
4
12
 
5
13
  def create
6
14
  @position = Iro::Position.new pos_params
7
15
  authorize! :create, @position
8
16
 
9
- @position.inner_strike = params[:inner][:strike]
10
- @position.outer_strike = params[:outer][:strike]
17
+ # @position.inner_strike = params[:inner][:strike]
18
+ # @position.outer_strike = params[:outer][:strike]
11
19
 
12
20
  o_attrs = {
13
21
  expires_on: @position.expires_on,
14
- put_call: @position.put_call, # I need this. _vp_ 2024-04-26
15
- stock_id: @position.stock_id,
22
+ put_call: @position.put_call, # I need this. _vp_ 2024-04-26
23
+ stock_id: @position.stock_id,
16
24
  }
17
- @position.inner = Iro::Option.new params[:inner].permit!.merge( o_attrs )
18
- @position.inner.end_price = @position.inner.begin_price
19
- @position.inner.end_delta = @position.inner.begin_delta
25
+ @position.inner = Iro::Option.create!({ strike: params[:position][:inner_strike] }.merge( o_attrs ))
26
+ @position.inner.sync
27
+ @position.inner.begin_price = @position.inner.end_price
28
+ @position.inner.begin_delta = @position.inner.end_delta
20
29
  if [ Iro::Strategy::KIND_LONG_CREDIT_PUT_SPREAD, Iro::Strategy::KIND_SHORT_CREDIT_CALL_SPREAD ].include?( @position.strategy.kind )
21
- @position.outer = Iro::Option.new params[:outer].permit!.merge( o_attrs )
22
- @position.outer.end_price = @position.outer.begin_price
23
- @position.outer.end_delta = @position.outer.begin_delta
30
+ @position.outer = Iro::Option.create!({ strike: params[:position][:outer_strike] }.merge( o_attrs ))
31
+ @position.outer.sync
32
+ @position.outer.begin_price = @position.outer.end_price
33
+ @position.outer.begin_delta = @position.outer.end_delta
24
34
  end
25
35
 
26
36
  if @position.save
@@ -53,6 +63,7 @@ class Iro::PositionsController < Iro::ApplicationController
53
63
  def edit
54
64
  @position = Iro::Position.find params[:id]
55
65
  authorize! :edit, @position
66
+ set_position_lists
56
67
  end
57
68
 
58
69
  def eval
@@ -64,10 +75,15 @@ class Iro::PositionsController < Iro::ApplicationController
64
75
  @position.calc_nxt
65
76
  end
66
77
 
67
- flash[:notice] = 'Probably eval ed the position.'
78
+ flash[:notice] = 'called position.calc_rollp , maybe position.calc_nxt .'
68
79
  redirect_to request.referrer
69
80
  end
70
81
 
82
+ def index
83
+ authorize! :index, Iro::Position
84
+ @positions = Iro::Position.active
85
+ end
86
+
71
87
  ## only callable from _new.haml, with position partially pre-filled
72
88
  def new
73
89
  authorize! :new, Iro::Position
@@ -81,6 +97,40 @@ class Iro::PositionsController < Iro::ApplicationController
81
97
  # outer: Iro::Option.new,
82
98
  stock_id: strategy.stock_id,
83
99
  }) )
100
+
101
+ set_position_lists
102
+ end
103
+
104
+ ## only credit-spread
105
+ def reprice
106
+ @position = Iro::Position.find params[:id]
107
+ authorize! :roll, @position
108
+ @position.update({ pending_price: params[:pending_price] })
109
+
110
+ Tda::Order.cancel_order!( @position.schwab_order_id )
111
+ outs = Tda::Order.place_order!( Tda::Order.credit_spread_q @position )
112
+
113
+ flag = @position.update({
114
+ schwab_order_id: outs[:schwab_order_id],
115
+ schwab_status: outs[:schwab_status],
116
+ status: Iro::Position::STATUS_PENDING,
117
+ })
118
+
119
+ flash_notice flag
120
+ # redirect_to controller: :purses, action: :show, template: 'show', view_status: 'pending', id: @position.purse_id
121
+ redirect_to request.referrer
122
+ end
123
+
124
+ ## place2 = credit-spread
125
+ def place2
126
+ @position = Iro::Position.find params[:id]
127
+ authorize! :roll, @position
128
+ @position.inner.sync
129
+ @position.inner.update({ begin_price: @position.inner.end_price })
130
+ @position.outer.sync
131
+ @position.outer.update({ begin_price: @position.outer.end_price })
132
+ @position.update({ pending_price: @position.place2_price })
133
+ @query = Tda::Order.credit_spread_q @position
84
134
  end
85
135
 
86
136
  ## 2025-10-14 long_credit_put_spread
@@ -102,9 +152,6 @@ class Iro::PositionsController < Iro::ApplicationController
102
152
  self.send("_prepare_#{@position.strategy.kind}")
103
153
  end
104
154
 
105
- ## 2026-02-26 continue...
106
- ## short credit call spread
107
- ## covered call
108
155
  def prepare2
109
156
  @position = Iro::Position.find params[:id]
110
157
  authorize! :roll, @position
@@ -119,13 +166,14 @@ class Iro::PositionsController < Iro::ApplicationController
119
166
  if @position.autoprev
120
167
  ;
121
168
  else
122
- throw 'I need prev_id'
169
+ throw 'Must pass prev_id here.'
123
170
  end
124
171
  end
125
172
 
126
173
  @query = case @position.strategy.kind
127
- when Iro::Strategy::KIND_SHORT_CREDIT_CALL_SPREAD
128
- Tda::Order.roll_short_credit_call_spread_q @position
174
+ when Iro::Strategy::KIND_LONG_CREDIT_PUT_SPREAD,
175
+ Iro::Strategy::KIND_SHORT_CREDIT_CALL_SPREAD
176
+ Tda::Order.roll_credit_call_spread_q @position
129
177
  when Iro::Strategy::KIND_COVERED_CALL
130
178
  Tda::Order.roll_covered_call_q @position
131
179
  else
@@ -133,15 +181,33 @@ class Iro::PositionsController < Iro::ApplicationController
133
181
  end
134
182
  end
135
183
 
184
+ ## credit-spread
185
+ def place3
186
+ @position = Iro::Position.find params[:id]
187
+ @position.update({ pending_price: params[:pending_price] })
188
+ authorize! :place_order, @position
189
+ outs = Tda::Order.place_order!( Tda::Order.credit_spread_q @position )
190
+
191
+ flag = @position.update({
192
+ schwab_order_id: outs[:schwab_order_id],
193
+ schwab_status: outs[:schwab_status],
194
+ status: Iro::Position::STATUS_PENDING,
195
+ })
196
+
197
+ flash_notice flag
198
+ redirect_to controller: :purses, action: :show, template: 'show', view_status: 'pending', id: @position.purse_id
199
+ end
200
+
136
201
  ## 2026-02-26 continue...
137
202
  ## short credit call spread
138
203
  def prepare3
139
204
  @position = Iro::Position.find params[:id]
140
205
  authorize! :place_order, @position
141
- order_id = Tda::Order.place_order( Tda::Order.roll_short_credit_call_spread_q @position )
206
+ outs = Tda::Order.place_order!( Tda::Order.roll_credit_call_spread_q @position )
142
207
 
143
208
  flag = @position.update({
144
- schwab_order_id: order_id,
209
+ schwab_order_id: outs[:schwab_order_id],
210
+ schwab_status: outs[:schwab_status],
145
211
  status: Iro::Position::STATUS_PENDING,
146
212
  })
147
213
 
@@ -411,11 +477,9 @@ class Iro::PositionsController < Iro::ApplicationController
411
477
  )
412
478
  end
413
479
 
414
- def set_lists
415
- super
416
- @purses_list = Iro::Purse.list
417
- @strategies_list = Iro::Strategy.list(params[:long_or_short])
480
+ def set_position_lists
418
481
  @stocks_list = Iro::Stock.list
482
+ @strategies_list = ( @position.purse.strategies.list + [[ @position.strategy.to_s, @position.strategy.id.to_s ]] ).uniq
419
483
  end
420
484
 
421
485
  end