[SHARE] Simple RSI BULL/BEAR strategy
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);

        }

    }
  Reply


Messages In This Thread
Werkkrew Stoploss - by susitronix - 02-02-2018, 09:39 PM
Removed post - by susitronix - 02-03-2018, 06:49 PM
@Gryphon Confirmation - by mvangoor - 03-22-2019, 11:59 PM
for 3 months - by ankasem - 02-18-2018, 05:30 PM
RE: [SHARE] Simple RSI BULL/BEAR strategy - by Fab1j0 - 03-04-2018, 07:20 PM

Forum Jump:


Users browsing this thread: