TradingView
kuhoerk
2022年8月22日下午3點11分

Range Strat - MACD/RSI 

Solana Perpetual FuturesFTX

描述

This strategy uses a trend based indicator (MACD) for entry/exit signals with a momentum oscillator (RSI) to act as confirmation. Although relying on a trend based indicator this has been created for range bound crypto markets, which have been in a period of chop since June 2022.

Long/Short signals are generated from MACD with the RSI oscillator thresholds suppressing entries at price extremes. This is not a mean reversion RSI strategy! As the indicators are contrary to each other you will need to be generous with the RSI settings in order for signals to trigger.

Strategy is designed for use on the 4h timeframe, it may work well on higher timeframes, but lower time frames will lead to false signals. Use fixed percentage of equity for order size to capture the compounding effect. As a reversal strategy bear in mind that should market trend strongly in either direction stops will be required.

The RSI thresholds can be tailored to provide higher frequency or safer signals. Similarly tweaking MACD settings will provide earlier/more frequent or safer signals. As this is intended to enter near range high / low you should check the visual cues to ensure a ping-pong effect is observed, so that peaks and troughs are captured. Once an observable range is established the strategy works well across a range of crypto markets,

The script is open source, so feel free to amend as you wish. Using a different momentum oscillator may provide better results. I have prior coding experience, but first time using PineScript was last night, so it's not very tidy. I will update this with some additional customisation and TP/SL in the near future.

Usage: Range bound markets
Markets: Cryptocurrency Alts/BTC/ETH
Timeframe: 4h

發布通知

Tidied up a bit and included some additional options:
Stop loss for long/short positions
EMA/SMA options for MACD lines
Select source drop downs for RSI and MACD

發布通知

No logic changes here. I've got a bit better handle on Pine scripting and have gone through a tidy up process of the variables, so I can use this again later as a template. Quality of life improvements include input settings grouped by category and use of the date picker rather than filling the input screen with date stuff.

發布通知

Knocked back the percentage of equity in trade to just 10% as running at 100% was unrealistically exaggerating performance due to the compounding effect. Also notched down the stop loss to a more reasonable 15%.
評論
kuhoerk
Great to see a few people poking about with this and thanks for the boosts and follows. I thought these were total views initially, so I was delighted when I realised it was upvotes :)

A few thoughts from my own testing:
Signal length/smoothing makes the most difference on different assets followed by the RSI thresholds. The script uses the default values for the underlying indicators (other than RSI sold/bought) for confirmation, so you could tweak a lot to provide better results per asset, but I expect you would get burned by over tuning in forward testing. Probably best to find settings that work OK across a number of coins rather than great on one.
I made the script based around a ranging market like we've experienced since June rather than heavily trending, but haven't tested much on previous timeframes. Some alt coins have just been on a gradual rise over the period and the script doesn't add much over buy and hold for these.
Would like to hear opinions on better options for the confirmation signal. I experimented with Bollinger Bands % but results were inferior.
Also any thoughts on how you might use gratefully received.
afsal_p4a
not working ..pls help
tsvetomir01
Its not working here?
ks1267
Hi, Thank you for the script. Could I ask which coin did you backtest to get that smooth result above? I tried to backtest on btc,eth, sol but the result is not good (in loss) for the past 2 years test.
baklavadealer
Loved the job kuhoerk! Thanks.
更多