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]

// stop loss juice points
settableWithVar double stopLoss = 1;

// juice points to start trailing at
settableWithVar double trailStart = 1;

// pullback juice points from crest to close position
settableWithVar double callbackRate = 0.3;

swappable TrailingStopJuicer makeJuicer() {
  new TrailingStopJuicer j;
  j.stopLossLimit(-stopLoss);
  j.stopLossEnabled(true);
  j.trailStart(trailStart);
  j.callbackRate(callbackRate);
  ret j;
}

selfType takeProfit(double tp) {
  ret trailStart(tp).callbackRate(0);
}

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: 162 / 204
Version history: 4 change(s)
Referenced in: #1036561 - G22CandleBasedStrategyWithTrailingStop (can also do simple take profit)