TradingView
Crunchster1
20 de Jul de 2023 15:35

Crunchster's Normalised Trend Strategy 

Bitcoin all time history indexINDEX

Descrição

This is a unique rules-based, systematic trading strategy - in the trend following category.

The strategy is designed for use on the daily timeframe. Specific features of this strategy are outlined below:
1. Uses a transformed price series (which I dub "real price") to generate signals rather than ticker price
2. Uses advanced position sizing and risk management, usually reserved for institutional portfolio management, a proven technique utilised by Commodity Trading Advisors and Managed Futures funds (Algo/Quant funds).

"Real Price" is a transformed price series derived from the sum of volatility adjusted (daily) returns, over the entire price series of an asset. The lookback period of the volatility adjustment is user defined.

A Hull moving average (HMA) is derived from the real price, and used as the main trend determinant. The lookback period of the HMA is user defined. Default lookback of 100 periods (days) ensures a responsive trend indicator, but without leading to over-trading from frequent crossovers (average holding period 14 days on BTC).

The core strategy is very simple, go long when real price crosses over HMA, go short when real price crosses under HMA. New position triggers automatically close open positions in the counter direction.

Position sizing is based on recent price volatility and the user defined annualised risk target. In essence positions are inverse volatility weighted, so larger size is opened during lower volatility and smaller size during increased volatility. Recent volatility is calculated as the standard deviation of returns with 14 period lookback, then extrapolated into an annualised volatility of expected returns. Annualised recent volatility is then referenced to the risk target set by the user to adjust the position size. The default settings are a very conservative 10% annual risk target. Initial capital should be set as the maximum risk capital per trade (ie if $10,000 total capital and 10% risk per trade, initial capital should be $1000). Maximum leverage per position can be set independently, to facilitate hitting risk targets that are greater than the natural volatility of the traded asset, and to accommodate low volatility conditions, whilst maintaining overall risk controls.

Hard stop losses are based on multiples of the average true range of recent price (14 period lookback), user configurable.

Please leave comments regarding further features or refinements. I plan to develop further adding alternative moving average selections and the ability to select/deselect long and short strategies.

3 hours ago
Release Notes:
Added option to compound profits versus using a fixed position capital. Be mindful that compounding will potentially increase profits, but also increase drawdowns and overall risk. Leverage will still cap overall exposure with compounding and therefore provides an additional layer of risk control.
2 hours ago
Release Notes:
Added function to toggle long/short strategy legs on and off.

Notas de Lançamento

Chart appearance improved
Comentários
moonlightcutie
Hello, great script and really innovative. Just one quick question, if the qty on a trade says 0.03, how much of the position do you allocate to it?
Crunchster1
@moonlightcutie, hi, thank you for the positive feedback.
So if the strategy is set up correctly, the trade quantity indicated in the active strategy is the size of position to put on. For example, if you have $1000 dollars to invest in BTC, use that as the initial capital in the settings. The strategy uses volatility adjustment to size your position based off your input in the 'Annualised Volatility Target %' setting (<25% is reasonable), and leverage setting (I suggest keeping at 1-2 to be safe, if you are trading without leverage/with spot, then leverage should be kept at 1). So simply it calculates the recent realised volatility in the asset and references that to your vol target, then ratios your size to that. The equation is:
position size (in coins/shares) = initial capital * (volatility target/realised volatility) / current price
In essence the position size is inverse volatility weighted, so when volatility is high it will allocate smaller position sizes, and when vol is low - larger position sizes.
I hope this helps
Mais