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
BCT Buy And Hold w/ Advanced StatisticsThis is a script designed to simulate a buy and hold strategy in the chart that its applied to.
Tradingview backtester is really limited in the statistics it gives you based on equity and information of open trades. For that reason many of the buy and hold scripts suffer from the same problem, a lack of useful statistics about your buy and hold strategy.
This script allows you to filter a specific buy and hold period (or use the whole data available in the tradingivew chart) and get useful statistics based on equity on a bar by bar basis.
Date Range Filtering
This allows you to chose a specific period to test the buy and hold strategy and to visualize the statistics.
We include 3 main tables which offer useful information so you can compare your strategy vs buy and hold strategy.
This 3 tables are:
Draw Downs Table
This table shows the Current P/L, Current Draw Down, Average and Maximum Draw Downs based on the equity of the buy and hold strategy calculated by candle. This can show you how much average and maximum loss or pain you would have to go through in order to stick to the buy and hold strategy.
Custom Statistics Table
This table shows useful advanced statistics to compare the buy and hold strategy to other strategies.
CAGR: Compounded annual growth rate is the industry standard in terms of showing annualized returns for any strategy or investment.
Annualized Return ($)
Trade Duration (Days): Self explanatory, displays how long the buy and hold trade was open or is open counted in days.
Max Stagnation Period (Days): Measures the Maximum time taken between new equity highs.
Average Draw Down : Average value of all draw downs from equity highs over the period (sampled 1 time per candle).
Maximum Draw Down : Largest draw down from equity highs in the whole period.
Return / Avg DrawDown: Advanced Proprietary statistic in which the annualized (non compounding) return is divided by the Average Draw Down (displayed in the Draw Downs Table)
Return / Maximum DrawDown: Advanced statistic in which the annualized (non compounding) return is divided by the Maximum Draw Down (displayed in the Draw Downs Table)
CAGR / Avg DrawDown: Advanced Proprietary statistic in which the CAGR (compounding) is divided by the Average Draw Down (displayed in the Draw Downs Table)
CAGR / Maximum DrawDown: Advanced Proprietary statistic in which the CAGR (compounding) is divided by the Maximum Draw Down (displayed in the Draw Downs Table)
Note: All the advanced statistics show, in slightly different ways, how much a strategy compensates you in relation to the risk taken. In other words you can see this as a way to quantify risk adjusted returns between multiple strategies. We prefer using the CAGR based advanced Statistics as they give a more universal value to compare across multiple strategies and asset classes.
In Sample / Out Of Sample Custom Stats (IS/OOS) Table
This table shows similar statistics as the Custom Statistics Table but is able to break down the backtest period into segments, this is useful when testing strategies as it can be used to test optimization quality. In this Buy and Hold strategy this can be used to visualize the stats of 2 periods at the same time and compare them without need to change settings or use another instance of the script.
All the Stats are the same as in the Custom Statistics Table with the difference of some being removed and the table being constructed in a way that facilitates the comparison of stats between In Sample, Out Of Sample and Full periods
Drawdown VisualisationAn indicator that let's you visualize the current drawdown and maximum drawdown from an All-Time High
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.
Cyatophilum Bands Definitive Edition█ OVERVIEW
A Swing Trade indicator providing backtest and alerts which can be used as a long, short or reversal strategy.
Its main goal is to catch breakouts and huge moves, and to try and beat the Buy & Hold Return.
█ CONCEPTS
The strategy consists of a unique custom indicator that works like this:
A Smoothed Donchian Channel combined with a consolidation check will trigger an entry.
The entry is then guided by a faster channel used as a trailing stop.
█ HOW TO USE
The most effective way to use this indicator is on high timeframes, from 2H to 1D.
The recommended pairs are trending pairs with consolidation areas. Yes, I'm especially looking at crypto.
The first appproach would be to catch long and short breakouts, and ride the trend using the trailing stop.
Adjust the Bands wisely to trigger entries at the right time.
The second approach is to go longs only, and try to beat the Buy & Hold return.
For this, click "Go long" and use an order size of 100% equity. Then adjust the Bands, trailing stop and chart timeframe.
The Buy & Hold comparator will come handy when backtesting.
█ INDICATOR SETTINGS
Strategy Direction
Choose wether to go long only, short only or both directions.
Bands Configuration
The bands lookback, smoothing and consolidation % are used to change the behavior of the bands. More info in the settings tooltips.
Trailing Stop
The "speed" of the trailing stop can be configured, allowing more or less room for the price to move before exiting.
Volume Condition
In addition to the consolidation condition, you can add a volume check to your entry. Is the volume rising or not? Useful in most scenarios.
Exit Alert Type
If you want to receive alerts during bars or prefer to ignore wicks.
Backtest Settings
This is where you choose the backtest period which is also used to calculate the B&H return.
Graphics
The configuration panel with all the indicator settings backtest info.
The buy & Hold Comparator is an additional panel that turns green when the strategy's return is greater than the Buy & Hold return.
Note: The Strategy Return is the strategy netprofit + the strategy openprofit.
█ ALERTS
Configure your alert messages for all events in the indicator settings.
Then click "Add Alert". In the popup window, select the option "alert() function calls only", give the alert a name and you are good to go!
█ BACKTEST RESULTS
The backtest settings used in this snapshot are the following:
Initial Capital: 10 000$
Order size: 100% equity (It indeed compounds and this is intended since the main goal of the strategy is to compare to Buy & Hold return)
Commission: 0.1%
Slippage : 10 ticks
The Indicator settings used for this are shown in the main chart above.
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.
Buy & Sell XRPBTC:BINANCE 2H Trading BotBuy & Sell Alert system for BINANCE:TRXBTC
Goal is to Beat Buy & Hold on the 2H (see backtest below)
Built upon the Supertrend, ADX and Tilson T3 indicators.
A trailing Stop loss in integrated to the script, as well as a Take profit system.
To get the indicator, please use the link below, thanks!
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
[NG] Strategy: CryptoMine - v1 - Low Drawdown - Beats Buy&Hold!So, I created this strategy that works on BTCUSD 0.28% pair along with almost all ALT-BTC pairs, and ALT-USD pairs (i.e. the cryptosphere). Here are some of the considerations I had when creating this script:
- Should work on BTCUSD 0.28% , along with most ALT-BTC and ALT-USD pairs without modifying strategy parameters for individual pairs.
- Should work with several timeframes, esp -0.67% . 15m-4hr timeframes. Better if the parameters are adjusted for these timeframes, automatically.
- Should have a small MaxDrawdown. Arguably <50% for cryptos.
- Should beat buy and hold profits for the pair.
- Should have multiple modes for switching between: Higher Returns vs Lower Drawdowns, multiple Long/Short versions - one which allows me to do margin trading by using the short calls (so, LONG, SHORT and FLAT), and another one where I can use the short calls by exiting out of the market and entering when the short call ends (so, LONG and SHORT only).
- Should have proper risk management built-in. Moreover, TakeProfit and StopLoss will be defined at a fixed 20% each, which is reasonable for crypto markets. Most strategies I see on tradingview fail on this count.
After several weeks of building such a script, and testing it successfully on multiple pairs - here are the results. :)
ETHBTC
=======================================================================================
Mode 1 (LONG and SHORT only)
--------------------------------------
First Trade: 2015-08-10 09:30, Final Profit: 1474649.65%, Drawdown: 66.21%, PF: 2.149, Trades: 1059
--------------------------------------
Mode 2 (LONG, SHORT and FLAT positions)
First Trade: 2015-08-14 05:30, Final Profit: 715274.55%, Drawdown: 36.34%, PF: 2.806, Trades: 589
BTCUSD 0.28%
=======================================================================================
Mode 1 (LONG and SHORT only)
--------------------------------------
First Trade: 2015-01-03 21:30, Final Profit: 28944.04%, Drawdown: 44.87%, PF: 1.353, Trades: 1222
--------------------------------------
Mode 2 (LONG, SHORT and FLAT positions)
First Trade: 2015-01-11 13:30, Final Profit: 22522.28%, Drawdown: 27.77%, PF: 1.877, Trades: 669
NANOBNB
=======================================================================================
Mode 1 (LONG and SHORT only)
--------------------------------------
First Trade: 2018-02-04 23:30, Final Profit: 365.5%, Drawdown: 39.4%, PF: 1.967, Trades: 51
--------------------------------------
Mode 2 (LONG, SHORT and FLAT positions)
First Trade: 2015-01-11 13:30, Final Profit: 236.91%, Drawdown: 25.62%, PF: 3.692, Trades: 25
NOTE: I will not be sharing access to this script, since market saturation is a real thing. Send me an email at menikhguptacom - if you are really interested in this script.
Buy and Entry Signals - Beats Buy and Hold!!Strategy using several indicators and some custom scripts to signal buy and entry zone for cryptocurrencies.
By design (and requirements) - this strategy tries to capture big market moves while most times - it just tries to avoid losing money when the market is moving sideways or even in a downtrend.
You will see a large number of trades that lose - several whipsaws that cant be removed, I think. But, eventually, the strategy works out to keep rising up the capital.
In rare cases, specially in crypto like XRP (that move really really big), this strategy may capture large downward move but still performs better than BnH.
You can request access, and I will try my best to provide that to you.
Let me know if you see any weird behaviour.