Bull trend riding RSI take profit
#3
You need to keep track of the previous candles RSI and compare the latest data to it.

In the init function declare a variable to hold the previous RSI -
Code:
this.prevRsi = 0;

Then in the check function with your trade logic:
Code:
if(RSI >= 75){ //Have you passed your sell threshold?
   if(RSI < prevRsi){ //Is the RSI lower than the previous candles RSI?
       //Sell
   }
}

prevRsi = RSI; //At the end of the check function, make sure you update previous RSI
  Reply


Messages In This Thread
Bull trend riding RSI take profit - by Shrike998 - 02-05-2019, 02:03 AM
RE: Bull trend riding RSI take profit - by Gryphon - 04-25-2019, 07:42 AM

Forum Jump:


Users browsing this thread: