Primary logic of RSI crossover remains as the older version. Buy when RSI breaks out above the buy level and sell when RSI breaks out below the sell level. Major changes in this version is as follows.
1. Added compounding logic. One can choose to compound the capital by adding profit into intial_capital and trade. You may choose compounding type as yearly/monthly/continuous/profit factor level. You can limit the amount of money you want to compound to optimize the drawdowns. This is very important in terms of strategy back testing for any trader.
2. In NSE FnO segment is not available. If you are trading as per FnO margin then you can provide the FnO lotsize and margin so that you can get the actual profitability factor. Also if someone is trading with custom lot sizes you can make use of it.
3. Given options for RSI smoothing to reduce noise.
4. Added risk management module with variety of risk management options needed for a trend follower. Percentage based, trail SL based, delayed trail stop activation, ATR based trail SL activation, Ride profits till end and cut the losers through initial stop loss. All are self explanatory.
5. Added intraday entry exit options if timeframe is less than 15 mins.
6. Background color changes as per the position. Bullish - Green. Bearish - Red.
7. Converted to pine version 4.