Bull trend riding RSI take profit
Could someone help me to work out this code.. ?

// Sell when RSI > 75 - want to change to allow for riding bull trends properly. - watch rsi each candle after 75 and sell when it starts dropping again.
 if (rsi2.result > 75 && advised) {
   this.sell('Take Profit - RSI past 75');

I want to trigger it when the RSI hits 75, to check every candle and see if the RSI is higher or lower than the last candle, if its higher, do nothing, if its lower, sell.

Any one help me work out how to do this? Im pretty new to code..

interesting, I follow.
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 -
this.prevRsi = 0;

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

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

Forum Jump:

Users browsing this thread: