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

21
LINES

< > BotCompany Repo | #1036562 // TrailingStopJuicer maker include

JavaX fragment (include) [tags: use-pretranspiled]

1  
// stop loss juice points
2  
settableWithVar double stopLoss = 1;
3  
4  
// juice points to start trailing at
5  
settableWithVar double trailStart = 1;
6  
7  
// pullback juice points from crest to close position
8  
settableWithVar double callbackRate = 0.3;
9  
10  
swappable TrailingStopJuicer makeJuicer() {
11  
  new TrailingStopJuicer j;
12  
  j.stopLossLimit(-stopLoss);
13  
  j.stopLossEnabled(true);
14  
  j.trailStart(trailStart);
15  
  j.callbackRate(callbackRate);
16  
  ret j;
17  
}
18  
19  
selfType takeProfit(double tp) {
20  
  ret trailStart(tp).callbackRate(0);
21  
}

Author comment

Began life as a copy of #1036390

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1036562
Snippet name: TrailingStopJuicer maker include
Eternal ID of this version: #1036562/5
Text MD5: 022713af73444720649fa3690e939ae9
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-01 11:03:16
Source code size: 532 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 163 / 205
Version history: 4 change(s)
Referenced in: [show references]