This strategy is based on a dynamic trailing stop loss mechanism to set stop loss lines for long and short positions based on the highest and lowest prices of a stock. When the price hits the stop loss line, it will close the current position and open a new position in the opposite direction. The strategy is simple and effective in controlling single transaction risk.
The main steps of this strategy are:
The above is the basic logic of the strategy. As price moves, the stop loss line keeps updating for dynamic tracking. By trailing stop loss, it can effectively control losses per trade.
The main advantages of this strategy:
In summary, by simple trailing stop loss mechanisms, this strategy can effectively manage positions and is a typical Risk Management strategy.
There are also some risks to note:
These risks can be optimized by adjusting the period, reducing slippage reasonably to make more sensible stop loss lines.
The strategy can be upgraded from the following aspects:
The trading strategy realizes dynamic positions management through simple trailing stop loss methods. It is easy to understand and implement, and can effectively control single trade loss. We analyzed the advantages, potential risks and future optimization directions. In conclusion, this is a highly typical and practical Risk Management strategy.
/*backtest start: 2023-12-01 00:00:00 end: 2023-12-31 23:59:59 period: 2h basePeriod: 15m exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //Noro //2019 //@version=4 strategy(title = "Noro's Trailing-Stop Strategy", shorttitle = "Trailing", overlay = true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, pyramiding = 0) //Settings needlong = input(true, defval = true, title = "Long") needshort = input(false, defval = false, title = "Short") length = input(20, minval = 1) shift = input(0.0, minval = 0, title = "Trailing Stop") background = input(false) //Levels max = highest(high, length) min = lowest(low, length) //Trailing size = strategy.position_size longtrailing = 0.0 shorttrailing = 0.0 longtrailing := size <= 0 ? min - ((min / 100) * shift) : max(min - ((min / 100) * shift), longtrailing[1]) shorttrailing := size >= 0 ? max + ((max / 100) * shift) : min(max + ((max / 100) * shift), shorttrailing[1]) trailing = size <= 0 ? shorttrailing : longtrailing col = size == size[1] ? size > 0 ? color.red : color.lime : na plot(trailing, color = col, linewidth = 2, transp = 0) //Background bgcol = background ? size > 0 ? color.lime : color.red : na bgcolor(bgcol, transp = 80) if trailing > 0 and size <= 0 strategy.entry("Long", strategy.long, needlong ? na : 0, stop = trailing) if trailing > 0 and size >= 0 strategy.entry("Short", strategy.short, needshort ? na : 0, stop = trailing)