Trend Friendly RSITrend Friendly RSI
Unlike the standard RSI, "Trend Friendly RSI" adapts to the trend. RSI and other momentum-based oscillators cannot give a buy signal in uptrends and a sell signal in downtrends because they do not take into account the momentum of the trend and behave as if the price is in a constant sideways trend. "Trend Friendly RSI", on the other hand, takes into account the momentum of the trend of your chosen length and subtracts it from the current momentum, thus giving more realistic buy and sell signals.
use it to identify your long-term investments and trading entry points for hodl. It would be wise to use this indicator for assets that you have done fundamental analysis and are sure of the trend direction. it doesn't know what the price will do, it just shows the points that are suitable for you.
remember this indicator will fail in horizontal trends.
Buyandhold
HODL LINE [AstrideUnicorn]This indicator determines periods of bull market when a buy-and-hold investor can hold the asset, and bear market periods when they should avoid holding it. Though it was designed primarily with cryptocurrencies in mind, it can be successfully used for any market.
Technically, the indicator is an asymmetric trend filter aimed to account for the fact that market sell-offs tend to be sharper than up-trends. The algorithm has two regimes – with and without price smoothing.
HOW TO USE
The step-like line is the main trend filter. It is colored green in an uptrend and red in a downtrend. When the smoothing is on, in addition to the trend filter, the indicator plots a purple line. It is a Hull Moving Average (HMA) of the price. In this case, the indicator uses this line instead of the price to find crossings with the trend filter.
When the price or the smoothed line crosses the trend filter above, it is an uptrend signal. The indicator marks such crossings with green circles. It also colors the chart background green in an uptrend. The price or the purple line crossing the trend filter below means a downtrend signal. Downtrend signals show as red circles. The chart background in a downtrend turns red.
SETTINGS
Sensitivity – a dropdown list that allows the user to choose an averaging period of the indicator. Users can select a value for sensitivity from a predetermined set that better suits their investment horizon.
Use Smoothing – turns on and off smoothing of the price with HMA. With the smoothing turned on, the indicator responds slower to price changes, but at the same time produces less amount of false signals.
PnL and Buy & Hold TrackerIn this script I use a simple, not necessarily profitable, strategy of a cross of MAs to teach how to calculate and plot the PnL of each trade made by the indicator. I also show how to calculate the cumulative PnL of all trades and the Buy and Hold of the same period.
These calculations which are natively available in any strategy script, require a bit of resourcefulness to work in an indicator script.
It can be very useful to optimize parameters for the best performance of an indicator-based strategy.
I use variables to store the price of the asset at each buy signal to calculate the PnL with the closing price of that particular trade and another variable to store the price value of the first trade, which calculates the Buy and Hold percentage with the current price of the asset.
I plot the values of the trades in labels and the accumulated values in a table.
I also show how to calculate and plot the unrealized PnL of open trades.
Up & Down Trend following trading strategy for BTC/USDT 3hThis strategy is based on multi time frame technical indicators such as;
1. RSI (10,50,100)
2. MFI (10,50,100)
3. RVI (10,50,100)
4. BOP (10,50,100)
5. Super Trend
6. SAR indicator
7. Higher highs and lower lows
8. SMA (9,500)
9. EMA (9,200)
After evaluating different parameters provided by those indicators, script is in a possition to determine optimul positions to enter in to market as well as exit from the market. In some cases stratergy will exit fully or partially depends on the situation. Other than that, this strategy is in a possition to calculate and specify the quantity you need to buy or sell depending on market situation. You can specify amount available for investment and how many times you are going to average (if downtrend). Parameters are optimised to BTC/USDT, 3h standerd candlestic chart.
goodluck
Simple way to BEAT the market [STRATEGY]This script has been created to demonstrate the effectiveness of using market regime filters in your trading strategy, and how they can improve your returns and lower your drawdowns
This strategy adds a simple filter (A historical volatility percentile filter, an implementation of which can be found on my trading profile) to a traditional buy and hold strategy of the index SPY.
Note, There are other filters that could also be added including a long-term moving average/percentile rank filter/ADX filter etc, to improve the returns further.
The filter closes our long position during periods of volatility that exceed the 95th percentile (or in the top 5% of volatile days) and buys back when the volatility is below 95% rank of the past 100 days
Have included the backtest results since 1993 which is 28 years of data at the time of writing. Comparison of traditional buy and hold with this modified strategy can be found below:
Traditional buy and hold:
Return per year: 7.95 % (ex Dividends)
Total return: 851.1 %
Max drawdown: 50.79 %
'Modified' buy and hold (this script):
Return per year: 9.92 % (ex Dividends)
Total return: 1412.2 %
Max drawdown: 31.57 %
Feel free to use some of the market filters in my trading profile to improve and refine your strategies further, or make a copy and play around with the code yourself. This is just a simple example for demo purposes.
Buy-and-hold strategy statsWhen you develop your own strategy you should compare its performance to the "buy-and-hold" strategy (you buy the financial instrument and you hold it long term). Ideally your strategy should perform better than the buy-and-hold strategy. While the net profit % of the buy-and-hold strategy is available under the "Performance Summary" tab of the "Strategy Tester" there are other factors that should be considered though. This is where this strategy comes in. It mimics the buy-and-hold strategy and gives you all the stats that are available for any strategy. For example, one such criteria that should be considered is the max. drawdown. Even if you strategy performs worse than the buy-and-hold strategy in terms of net profit, if the max. drawdown of your strategy is considerably lower than that of the buy-and-hold it may overall be a better strategy than the buy-and-hold as, in this scenario, it likely exposes the investor to significantly less risk.
Buy and hold calculatorThis is a simple buy and hold calculator.
You have an initial date and once that dated it passed it will sell the product that was bought initially.
This strategy buys and sell 100% of the initial volume.
Strategy VS Buy & HoldSUMMARY:
A strategy wrapper that makes a detailed and visual comparison between a given strategy and the buy & hold returns of the traded security.
DESCRIPTION:
TradingView has a "Buy & Hold Return" metric in the strategy tester that is often enough to assess how our strategy compares to a simple buy hold. However, one may want more information on how and when your strategy beats or is beaten by a simple buy & hold strategy. This script aims to show such detail by providing a more comprehensive metrics and charting the profit/loss of the given strategy against buy & hold.
As seen in the script, it plots/draws 4 elements:
1) Strategy P/L: strategy net profit + strategy open profit
2) Buy & Hold P/L: unrealized return
3) Difference: Strategy P/L - Buy & Hold P/L
4) Strategy vs Buy Hold Stats
> Percent of bars strategy P/L is above Buy & Hold
> Percent of bars strategy P/L is below Buy & Hold
> All Time Average Difference
ADJUSTABLE PARAMETERS:
All labels/panels can be disabled by unchecking these two options:
>bnh_info_panel = input(true, title='Enable Info Panel')
>bnh_indicator_panel = input(true, title='Enable Indicator Panel')
Comparison Date Range can be changed to better isolate specific areas:
>From Year, From Month, From Day
default: 1970 01 01
>To Year, To Month, To Day
default: 2050 12 31
Default settings basically covers all historical data.
HOW TO USE:
The default script contains a simple 50-200 SMA cross strategy, just delete and replace it. Those are everything between these lines:
/////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////STRATEGY SCRIPT START//////////////////////////////////
(STRATEGY SCRIPT GOES HERE)
//////////////////////////////STRATEGY SCRIPT END////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
Removing all plots and drawings from your strategy is advisable.
If you are going to use the Comparison Date Range, apply "bnh_timeCond" to your strategy to align the dates. A sample on how it’s applied can be seen on the Placeholder MA cross strategy.
Note: bnh_timeCond returns a boolean series