HPotter

Strategy RSI Backtest

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.
Remove from Favorite Scripts Add to Favorite Scripts

Comments

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
Reply
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!
Reply
HPotter oliverpablo123
@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.
Reply
@HPotter, Awsome, thanks. Can you turn this strategy into a script to create alerts when a entry is signalled?
Reply
HPotter oliverpablo123
@oliverpablo123, Add this lines before barcolor....

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

and it should make alerts
Reply
@HPotter, Thanks! I added those lines but it still doesn't give the option for alerts...
Reply
HPotter oliverpablo123
@oliverpablo123, It will send an alert when it will. When signal will change. Do you save script without errors?
Reply
@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")
Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Referred friends Coins My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out