Hello
Any idea how to add this stop loss to strategy RSI_Bull_Bear_ADX ? I would be very thankfull. Let's say i want max 5% stop loss.
//In the strategy init create the stoploss variable:
this.stop = "";
if(logic that determines a sell || this.stop != "" && price<this.stop){
//if you want to show a stoploss being triggered in the console:
if(this.stop != "" && price<this.stop){
console.log("stoplosss triggered - "+ this.stop);
}
this.direction="short";
if(this.trend == "long"){
this.stop = "";
this.trend = this.direction;
this.advice(this.direction);
}
}else if(logic that determines a buy){
if(this.stop==""){
//sets up the stoploss, you should make the .2 a variable in the strategy config really
this.stop = price-(price*.2);
this.direction="long";
this.trend = this.direction;
this.advice(this.direction);
}
}
Any idea how to add this stop loss to strategy RSI_Bull_Bear_ADX ? I would be very thankfull. Let's say i want max 5% stop loss.
//In the strategy init create the stoploss variable:
this.stop = "";
if(logic that determines a sell || this.stop != "" && price<this.stop){
//if you want to show a stoploss being triggered in the console:
if(this.stop != "" && price<this.stop){
console.log("stoplosss triggered - "+ this.stop);
}
this.direction="short";
if(this.trend == "long"){
this.stop = "";
this.trend = this.direction;
this.advice(this.direction);
}
}else if(logic that determines a buy){
if(this.stop==""){
//sets up the stoploss, you should make the .2 a variable in the strategy config really
this.stop = price-(price*.2);
this.direction="long";
this.trend = this.direction;
this.advice(this.direction);
}
}