Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

24
LINES

< > BotCompany Repo | #1036390 // MultiPullbackJuicer maker include

JavaX fragment (include)

1  
// pullback levels for different profits
2  
3  
settableWithVar double profitLevel1 = 0.1;
4  
settableWithVar double keepPercentage1 = 50;
5  
settableWithVar double profitLevel2;
6  
settableWithVar double keepPercentage2;
7  
settableWithVar double profitLevel3;
8  
settableWithVar double keepPercentage3;
9  
10  
// max loss before leverage
11  
settableWithVar double maxLoss = 0.5;
12  
13  
swappable MultiPullbackJuicer makeJuicer() {
14  
  new MultiPullbackJuicer j;
15  
  j.stopLossLimit(-maxLoss);
16  
  j.stopLossEnabled(true);
17  
  for (int i = 1; i <= 3; i++) {
18  
    double profitLevel = toDouble(get(this, "profitLevel" + i));
19  
    double keepPercentage = toDouble(get(this, "keepPercentage" + i));
20  
    if (profitLevel != 0 || keepPercentage != 0)
21  
      j.addLevel(profitLevel, keepPercentage);
22  
  }
23  
  ret j;
24  
}

Author comment

Began life as a copy of #1036358

download  show line numbers  debug dex  old transpilations   

Travelled to 1 computer(s): mqqgnosmbjvj

No comments. add comment

Snippet ID: #1036390
Snippet name: MultiPullbackJuicer maker include
Eternal ID of this version: #1036390/4
Text MD5: 94bd191d6dc0313f9d4a8670deb84616
Author: stefan
Category: javax / gazelle 22
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-12-18 03:09:47
Source code size: 784 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 152 / 202
Version history: 3 change(s)
Referenced in: [show references]