Libraryless. Click here for Pure Java version (15020L/88K).
1 | persistable abstract sclass AbstractJuicer extends MetaWithChangeListeners { |
2 | // what we are monitoring & closing (a position or a strategy) |
3 | settableWithVar Juiceable juiceable; |
4 | |
5 | settableWithVar double juiceValue; |
6 | |
7 | settableWithVar bool closingAllowed = true; |
8 | |
9 | // last calculated signals |
10 | settableWithVar L<SignalWithStrength> currentSignals; |
11 | |
12 | settableWithVar L<SignalWithStrength> suppressedSignals; |
13 | |
14 | event calculatingCloseSignals(L<SignalWithStrength> outList); |
15 | |
16 | // must return a new list |
17 | swappable L<SignalWithStrength> calculateCloseSignals() { |
18 | grabJuiceValue(); |
19 | new L<SignalWithStrength> signals; |
20 | calculatingCloseSignals(signals); |
21 | if (closingAllowed) { |
22 | suppressedSignals(emptyList()); |
23 | currentSignals(signals); |
24 | } else { |
25 | suppressedSignals(signals); |
26 | currentSignals(emptyList()); |
27 | } |
28 | ret currentSignals; |
29 | } |
30 | |
31 | void grabJuiceValue { |
32 | juiceValue(juiceable.juiceValue()); |
33 | } |
34 | |
35 | selfType configClone() { |
36 | ret restructure(this); |
37 | } |
38 | |
39 | void copyTransientValuesFrom(AbstractJuicer juicer) {} |
40 | } |
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1036353 |
Snippet name: | AbstractJuicer |
Eternal ID of this version: | #1036353/20 |
Text MD5: | b60bf0510387cd5c497ff5c786400263 |
Transpilation MD5: | f5375a6011d4b404aefde62fa54bef70 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-12-18 04:35:36 |
Source code size: | 1122 bytes / 40 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 233 / 339 |
Version history: | 19 change(s) |
Referenced in: | [show references] |