TradingView
HPotter
Jan 10, 2017 5:23 AM

Strategy RSI Backtest 

E-mini S&P 500 FuturesCME

Description

The RSI is a very popular indicator that follows price activity.
It calculates an average of the positive net changes, and an average
of the negative net changes in the most recent bars, and it determines
the ratio between these averages. The result is expressed as a number
between 0 and 100. Commonly it is said that if the RSI has a low value,
for example 30 or under, the symbol is oversold. And if the RSI has a
high value, 70 for example, the symbol is overbought.

You can change long to short in the Input Settings
Please, use it only for learning or paper trading. Do not for real trading.
Comments
Traderanit
If I want to create only Long strategy where if it crosses above 70 then I will buy and exit when it comes below 70. Please help. Thanks
BigPuma10
What does the yellow candle and blue candle mean? This indicator repaints?
oliverpablo123
I've been loolking at this backtest on ETHUSD pair and the results are impressive. One thing that would make result more accurate is if the entry price was calculated at the closing price of the candle when the signal was generated (rather than the opening price, as now). Is it possible to adjust this? Thanks!
HPotter
@oliverpablo123, If do you mean a backtest logic then I think no. If data for calculate, then you can change line 20 where to change CLOSE on the OPEN.
oliverpablo123
@HPotter, Awsome, thanks. Can you turn this strategy into a script to create alerts when a entry is signalled?
HPotter
@oliverpablo123, Add this lines before barcolor....

alertcondition(possig != possig[1] and possig == 1, title='Signal Buy', message="Buy")
alertcondition(possig != possig[1] and possig == -1, title='Signal Sell', message="Sell")

and it should make alerts
oliverpablo123
@HPotter, Thanks! I added those lines but it still doesn't give the option for alerts...
HPotter
@oliverpablo123, It will send an alert when it will. When signal will change. Do you save script without errors?
oliverpablo123
@HPotter, It saved without errors but even with the added code* it doesn't let me add alerts. When I try to add an alert the 'condition' box is greyed out.


*alertcondition(possig != possig and possig == 1, title='Signal Buy', message="Buy")
alertcondition(possig != possig and possig == -1, title='Signal Sell', message="Sell")
More