RSI calculated for timeperiod=10

Course Name: Trading with Machine Learning: Classification and SVM, Section No: 5, Unit No: 3, Unit type: Notebook

Hi! 

RSI is typically calculated for timeperiod = 14, any reason in this code RSI is calculated for n=10?

n=10

# Create a column by name, RSI and assign the calculation of RSI to it
Df['RSI'] = ta.RSI(np.array(Df['Close'].shift(1)), timeperiod=n)

 

 

Hello Amit, 



That's a good question!!

By default, the timeperiod = 14 for calculating RSI. However, for intraday, traders generally prefer a timeperiod from 8-11. In the notebook you pointed out, the strategy was for intraday, so n=10. However, you can try with other timeperiods as well.



Hope this helps!