wco_models 3.1.0.263 → 3.1.0.264
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 +4 -4
- data/app/assets/stylesheets/wco/main.scss +8 -10
- data/app/models/iro/purse.rb +1 -2
- data/app/models/iro/strategy.rb +8 -9
- data/app/views/wco/profiles/_form.haml +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 06f4f98ee3c36e42af419ef0778c2b1dcef99b45b6950a0b8e0847e4f122ab84
|
|
4
|
+
data.tar.gz: 3156138556995606ce6c338af1fc675b678da32a6c4a2996e3c1c6c6fc8096e8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3fdab086ab82d058301d86f1b85fac771df0fbedac5418ff503218b04d960cd09ca2a73bebee5aaee4a57f9a910b259b0ea046d5224a62790286108370c863ee
|
|
7
|
+
data.tar.gz: 82e604c3c74303c03b7db2a007f1ddb0e6725d77957c86355ca0e749af9b7dadd7d6e6e15d2f2d3528e22d72ddd5f2387e6e9b5a061118801810955613215e2f
|
|
@@ -70,16 +70,14 @@ table.bordered {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
table
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
z-index: 10;
|
|
82
|
-
}
|
|
73
|
+
table.sticky thead,
|
|
74
|
+
table thead.sticky {
|
|
75
|
+
background: #ccc;
|
|
76
|
+
|
|
77
|
+
th {
|
|
78
|
+
position: sticky;
|
|
79
|
+
top: 0;
|
|
80
|
+
z-index: 10;
|
|
83
81
|
}
|
|
84
82
|
}
|
|
85
83
|
|
data/app/models/iro/purse.rb
CHANGED
|
@@ -14,8 +14,7 @@ class Iro::Purse
|
|
|
14
14
|
|
|
15
15
|
has_many :positions, class_name: 'Iro::Position', inverse_of: :purse
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
# belongs_to :stock, class_name: 'Iro::Stock', inverse_of: :strategies
|
|
17
|
+
has_many :strategies, class_name: 'Iro::Strategy', inverse_of: :purse
|
|
19
18
|
|
|
20
19
|
field :unit, type: :integer, default: 10
|
|
21
20
|
## with unit 10, .001
|
data/app/models/iro/strategy.rb
CHANGED
|
@@ -5,7 +5,7 @@ class Iro::Strategy
|
|
|
5
5
|
include Mongoid::Paranoia
|
|
6
6
|
store_in collection: 'iro_strategies'
|
|
7
7
|
|
|
8
|
-
field :
|
|
8
|
+
field :descr
|
|
9
9
|
|
|
10
10
|
LONG = 'long'
|
|
11
11
|
SHORT = 'short'
|
|
@@ -17,11 +17,11 @@ class Iro::Strategy
|
|
|
17
17
|
field :credit_or_debit, type: :string, default: 'credit'
|
|
18
18
|
validates :credit_or_debit, presence: true
|
|
19
19
|
|
|
20
|
-
|
|
21
20
|
has_many :positions, class_name: 'Iro::Position', inverse_of: :strategy, dependent: :destroy
|
|
22
|
-
|
|
21
|
+
## _TODO: makes no sense...
|
|
22
|
+
has_one :next_position, class_name: 'Iro::Position', inverse_of: :next_strategy
|
|
23
23
|
belongs_to :stock, class_name: 'Iro::Stock', inverse_of: :strategies
|
|
24
|
-
|
|
24
|
+
belongs_to :purse, class_name: 'Iro::Purse', inverse_of: :strategies
|
|
25
25
|
|
|
26
26
|
KIND_COVERED_CALL = 'covered_call'
|
|
27
27
|
KIND_IRON_CONDOR = 'iron_condor'
|
|
@@ -87,14 +87,13 @@ class Iro::Strategy
|
|
|
87
87
|
field :threshold_dte, type: :integer, default: 1
|
|
88
88
|
|
|
89
89
|
field :next_inner_delta, type: :float
|
|
90
|
-
field :next_inner_strike, type: :float
|
|
90
|
+
field :next_inner_strike, type: :float ## can be nil, poor design?
|
|
91
91
|
field :next_outer_delta, type: :float
|
|
92
92
|
field :next_outer_strike, type: :float
|
|
93
93
|
field :next_spread_amount, type: :float # e.g. $20 for a $2000 NVDA spread
|
|
94
94
|
|
|
95
|
-
field :
|
|
96
|
-
validates :
|
|
97
|
-
def next_buffer_above_water; next_threshold_usd_above_mark; end
|
|
95
|
+
field :next_usd_above_mark, type: :float
|
|
96
|
+
validates :next_usd_above_mark, presence: true
|
|
98
97
|
|
|
99
98
|
def begin_delta_covered_call p
|
|
100
99
|
p.inner.begin_delta
|
|
@@ -362,7 +361,7 @@ class Iro::Strategy
|
|
|
362
361
|
# "#{kind} #{stock}"
|
|
363
362
|
# end
|
|
364
363
|
def to_s
|
|
365
|
-
"#{kind} #{stock}"
|
|
364
|
+
"#{kind} #{stock} #{descr}"
|
|
366
365
|
end
|
|
367
366
|
def self.list long_or_short = nil
|
|
368
367
|
these = long_or_short ? where( long_or_short: long_or_short ) : all
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
.field
|
|
20
20
|
%label leadset
|
|
21
|
-
= f.select :leadset, options_for_select(Wco::Leadset.list, selected: profile.leadset_id )
|
|
21
|
+
= f.select :leadset, options_for_select(Wco::Leadset.list, selected: profile.leadset_id ), {}, { class: 'select2' }
|
|
22
22
|
|
|
23
23
|
%hr
|
|
24
24
|
.row
|