Optimized RSI and MA Strategy

Eric Park
Coinrule
Published in
12 min readJul 14, 2023

Hello, everyone! Welcome to Coinrule’s 16th Strategy of the Week video. Again, this week, we’re streaming across a variety of platforms simultaneously. So, you might be watching this on Twitter, LinkedIn, or a variety of other platforms. Again, remember, the recording of this live stream will be uploaded on YouTube afterward, sorry. So, if you’re watching the recording on YouTube, be sure to join our Discord community. So, you know, when the next live stream is, I’ll include an invite link in the description of the video. And this will essentially grant you the opportunity to ask any questions you have on the strategy in real time and allow me to answer them. So, it’s really the best for both of us, and you can join live. So, if you have any questions throughout the duration of this live stream, just pop them in the chat and I’ll get to them.

I obviously know that it’s not possible for everyone to join live due to work commitments, differences in time zones, and so on. So, if that’s the case, just watch the recording on YouTube. Also, please remember that there are a range of other Strategies of the Week videos on our YouTube channel. So, if the strategy isn’t for you, you can check out some of our other strategies there. Cool. So, let’s get started.

This week’s strategy is centered around the RSI and some simple moving averages. And this will essentially be used to find appropriate entries for long positions. To exit the strategy, we’ll utilize trailing take profit and stop loss conditions a bit different from last week, this strategy will not require TradingView signals. This means that the strategy will take advantage of Commonwealth any coin scanner, which will essentially scan the market for coins that meet our entry conditions and then subsequently enter trades on them. And the strategy is also available as a template on Coinrule. I mean, they’ll be extremely easy to set up and start running. And we do also have the associated script for the strategy available on TradingView. So, if you want to back test it, you’ll be able to do that. I’ll show you how to do that later.

Okay, so I think the first to getting started, we should probably have a look at the broader macro picture. So here we have the Bitcoin daily chart, you can see that since Bitcoin has lost that kind of 30k range, it’s proved quite difficult to reclaim it. And we’ve tested it twice here to see a year and I’ve since struggled to reclaim it. And in order for the next leg up to start, we’ll first need to reclaim 30k.

If you’ve watched our last Strategy of the Week video as well, you’ll remember that I mentioned that MA9 and MA50 were beginning to converge with a potential crossing imminent. If you’ll see here that we actually just got backcrossing just now. I remember that fast Moving Average, i.e., a shorter duration one such as MA9, and this red line here, crossing below a slower-moving average e.g., MA50 this green line here is a bearish signal, which provides support to the idea that the market might see an increase in bearish momentum following this crossing.

Another important indicator to take a look at is the MACD which is down here. You can see here that has remained relatively neutral in the past week or so although the MACD line, which is the blue line here, let me just increase the size of this. So, you can see a lot easier to see has been below a signal line, which is the orange line here, you can see that the spread between them has been quite small in recent days, which is represented by the short bars in the histogram here.

However, we can see that the two lines are beginning to diverge, you can see the gap between them is increasing, which is represented by these histogram bars are starting to get a bit larger.

We can see there are a lot of various scenarios. Essentially, we can see the last time that this happened, we lost 30k. You can see let me just shrink this down a bit. So, you can see when the histogram started to get a bit larger here, we lost 30k and fell towards about 27k. So, all in all, the technical indicators aren’t always accurate in predicting market direction. And they’re currently pointing towards an increase in bearish momentum across the crypto market. And we also have the ongoing US regional banking crisis going on. The Crypto markets held up to this pretty well so far. And but we get the announcement of another bank collapse that will likely cause a large increase in volatility. So, something to certainly keep an eye on. US CPI data is also released tomorrow. So that’s also an important date. Soft CPI, i.e., inflation coming in lower than expected will be bullish for risk assets such as crypto while simultaneously putting downward pressure on the dollar and yields. Cool so let’s discuss the indicators that we’re using. And most of you are probably rather familiar with simple moving averages and the RSI but I’ll run through them quickly regardless. So, moving averages are essentially these lines here. This red one on the screen one screen one’s MA50 and this red one is MA9. These essentially calculate the average of a selected range of prices, usually closing prices, and by the number of periods in that range. So, for example, MA9 calculates the average price of the last nine candles, whereas MA50 calculates the average of the last 50 candles.

When a fast-period Moving Average such as MA9 crosses above a slow-Moving Average it acts as a bullish signal, which can be a good point to enter a trade. When a fast-period moving average crosses below a slow-Moving Average, the opposite is true essentially. So, this would be a bearish signal indicating an entry for a short position or an entry and exit point for a long trade. So, moving averages are really quite simple really, basically used to help smooth out price data by creating a constantly updated average price.

Let’s also take a look at the RSI quickly loaded quickly here. You can see here this is RSI down here.

It’s basically a momentum indicator using technical analysis. It measures the speed and magnitude of a coin’s recent price changes to evaluate overvalued or undervalued conditions and the price of that coin. The RSI can be more than point overbought and oversold assets. It can also indicate securities or assets primed for a trend reversal or corrective pullback in price essentially signals when to buy and sell. Traditionally, an RSI reading of 70 or above indicates an overbought situation. So above here, which could be a good point to enter a short trade or exit a long trade. And an RSI reading of 30 or below indicates an oversold condition. So, you can see here where they are assigned dipped below 30 And we begin to refer to the trend reversed, and we the price began to increase. So, this year would be an appropriate entry for a long position or an exit for a short position. So, the opposite of an overbought scenario.

Cool. So, let’s discuss the entry conditions of our strategy. So, to enter positions, the strategy looks for three conditions to essentially be met the first to rely on the RSI we’re going to require the RSI is greater than 40. So as long as RSI is above this line here, we’re also going to require that increased by three.

The next entry condition relies on MA9 and MA50. And we simply require MA9 to be above MA50. So nice and simple entry conditions, nothing too complicated there.

So, for the exit conditions, these are going to essentially utilize trailing take profits and stop losses. And these essentially take profits and stop losses that adapt to the price trend strength. Just as this example displays as you can see moves with the price.

So, to exit the strategy, we’ll look for a 1% price increase trailing or a 2% price decrease trailing. I’m going to show you how to adjust these later if you fancy backtesting it with some different values.

Great. So now we’ve discussed the entry next conditions. Let’s look at back testing. If you remember earlier, I told you that it’s available on our TradingView Profile. And this is it here. This is the script essentially; you can see there are the entry and exit conditions listed. Again, this is just for your reference, but it’s pretty straightforward.

If you scroll down, you’ll also see that the code for the strategy is open source. So, as I said, I’ll show you how to just sum the values in it later. So, if you want to back test this in its standard form, you just come down here and click “Add to favorite indicators”. And come to the chart that you wish to test on. So, I’m going to test it on either USDT in the 30-minute timeframe. So simple now is added to your favorites, you just come to favorites here and then you can just copy and paste the name. I’m just going to search for it because I have a lot of strategies in here where you probably might not have so many. I click this and you’ll see it added to the chart. You see we’re given some net profit and the number of trades potentially profitable, the max drawdown as well, and some other data.

So, in 501 trades this made 103% net profit on AVA USDT. This is just on one specific coin. If you remember earlier, I said you could run this coin this strategy across a range of coins in the market or using any coin scanner. But with TradingView, you can affect it with backtests one by one and see how it performed the different coins. So, this is obviously some nice performance on either USDT on a 30-minute timeframe, you can see automatically if you just change this, for example, change the timeframe, the backtesting data is automatically updated. So, you can see they performed much better in the 30-minute time frame 103% profit compared to 7.43 in the five-minute time frame. So, this would suggest that it performs better on slightly longer timeframes.

You can also change this to for example Ethereum and to see how we’re performing at a range of different kinds. So, you can see it didn’t perform nearly as well.

Cool. So, if you’re happy with this performance actually I’ll show you how to edit some of the values first. So, say for example you wanted to test this backtest the strategy with a different RSI reading is very simple. You can consider the other courses open source you can just copy it basically come to the chart you wish it to run on come to Python Editor here on trading view, and delete all this. So, I’m in read-only mode but essentially you just paste it here and then you can edit some of the values. For example, the buy condition here you could like for example if you wanted to test outperform buying when the RSI is over 50.

He just added this, click Add to chart and then essentially the backtesting data will automatically be increased. SRA automatically be adjusted. You can also adjust your trailing tick profits and stop losses here. And also, the percentage of equity that the strategy trades with in standard forms trades with 70% essentially simulates that for every trade, it will run on 70% of your holdings, you could just list 100% 5% 10%, just essentially anything that suits your strategy. Another important note is that the backtesting data is back-tested from the start of 2022. So, it simulates how it performs in a bear market, you could change these the last six months, you know, the last three years, it doesn’t really matter. Just whatever really suits you. Another important thing to note here is that the back-testing data also includes a 0.1 commission fee, which is aligned to the base fee applied on Binance, which is obviously the largest crypto exchange by volume. So essentially, you’re simulating trading fees as well, when you see this back-testing data here.

Excellent. So, if you’re happy with this performance, I’m going to show you now how to run the strategy on Coinrule, it’s actually very simple, you can just come here. You can just copy and paste the name of the strategy. So, this is obviously Coinrule and we create a rule on Coinrule. As I said, it’s available as a template strategy. Just click and paste it in here.

And you see the strategy is here, you’re given a description of it, select and it’s automatically loaded for you. So, as I said, you can have this one run on any kind any leverage tokens as well, which is a new offering that we have. And if your coins are one of the best-performing coins in the market, there’s really a range of options. And something I often like to do as well as often have it only run on the top kind of coins in the top 10 market cap. So, this is definitely an option a lot of users will choose, but I’m just going to leave on any coins. So, I wanted to run across all kinds of the market. Remember that you can adjust in settings, the minimum market cap, which you run your rules not to buy.

Awesome. So, if you’re happy with this, we can just see these are the entry conditions. Remember, if any coin has RSI greater than 40, in a timeframe of 30 minutes, and that coin has RSI increased by 3% by three sorry, within 30 minutes. And that coin is MA9 greater than MA50 In a timeframe of 30 minutes. Remember, I’m using the 30-minute time frame here because we saw on the backtesting data that it performed well. But you know, if you feel free to change this as well if you want to test out in different timeframes, you find one that works better on a certain coin, you know, this is open to change.

So, if this is the case I went to buy $1,000 of USDT with my USDT wallet as a limit order, then the confirmation monitor price increased by 1%. Trailing or the coin is confirmation minus price decreased by 2%. Trailing and I want to sell 100% of the amount bought of that coin to a USDT wallet as a limit order. You could also add another condition here, for example, I might want this rule to not buy stable coins with the same coin twice. So, I’m going to set this constant rule to not buy fiat currencies and stablecoins. I don’t want to buy the same coin twice until bought sorry, so I’m going to delete this one here. So, I’m just going to also add this sort of condition. But this is again, fully customizable. On Start immediately, and execute 100 times in total, an industrial optimize our assign me strategy, which is, if you remember the name of the strategy, the default name, but you could change this to something that suits you. But I’m going to leave it at the standard form.

Then click Launch. You see we’re given a little preview here, which just runs through the rule. Click Launch demo. I’m running this in the demo exchanges or paper trading mode, but I feel free to run on live as well, of course. So, there we go. Your strategy is now live. Thank you very much for listening to this video and to check if anyone’s got any questions. So, if you do just post them in the chat, I’ll just hang around here for a couple of minutes just to check. Yeah, I’m really excited to be equipped with this. I think it’s a really good strategy. I’ve been testing it out personally and yeah; it’s worked well for me so hopefully you all see similar performance.

Cool, so just hang around for a minute or so. Cool. So yeah, if anyone has any questions after this video or stream. Feel free to reach out to support@coinrule.com and we’ll get back to you on that in due course. And yeah, thanks a lot for listening to this video really appreciate it. Cheers!

Happy trading with Coinrule💫

Watch the video on Youtube⬇️

Learn more about the strategies you can run automatically on Coinrule.

Get started today!

Trade safely

Follow us on Twitter: @CoinRuleHQ or Instagram: @CoinruleHQ

DISCLAIMER

I am not an analyst or investment advisor. Everything that I provide here site is purely for guidance, informational and educational purposes. All information contained in my post should be independently verified and confirmed. I can’t be found accountable for any loss or damage whatsoever caused in reliance upon such information. Please be aware of the risks involved with trading cryptocurrencies.

--

--