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

21
LINES

< > BotCompany Repo | #1036612 // MultiStopLossJuicer maker include

JavaX fragment (include)

// stop loss levels for different profits before leverage

settableWithVar double profitLevel1;
settableWithVar double stopLoss1;
settableWithVar double profitLevel2;
settableWithVar double stopLoss2;
settableWithVar double profitLevel3;
settableWithVar double stopLoss3;
settableWithVar double profitLevel4;
settableWithVar double stopLoss4;

swappable MultiStopLossJuicer makeJuicer() {
  new MultiStopLossJuicer j;
  for (int i = 1; i <= 4; i++) {
    double profitLevel = toDouble(get(this, "profitLevel" + i));
    double stopLoss = toDouble(get(this, "stopLoss" + i));
    if (profitLevel != 0 || stopLoss != 0)
      j.addLevel(profitLevel, stopLoss);
  }
  ret j;
}

Author comment

Began life as a copy of #1036535

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1036612
Snippet name: MultiStopLossJuicer maker include
Eternal ID of this version: #1036612/1
Text MD5: aa183da7761d4d66d17489f724f37921
Author: stefan
Category: javax / gazelle 22
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2023-04-29 00:14:34
Source code size: 693 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 78 / 96
Referenced in: [show references]