Skip to content

Latest commit

 

History

History
240 lines (136 loc) · 6.76 KB

超短期动量突破交易策略SSL-Channel-Breakout-Strategy-with-Trailing-Stop-Loss.md

File metadata and controls

240 lines (136 loc) · 6.76 KB

Name

超短期动量突破交易策略SSL-Channel-Breakout-Strategy-with-Trailing-Stop-Loss

Author

ChaoZhang

Strategy Description

IMG

[trans]

概述

本策略基于SSL通道指标,结合突破信号进行超短期动量交易。当价格突破SSL上轨时,做多;当价格突破SSL下轨时,做空。同时设置移动止损和跟踪止损来控制风险。

策略原理

  1. 计算长度为N的高价SMA和低价SMA作为SSL通道的上轨和下轨

  2. 当收盘价大于上轨时,设置买入信号;当收盘价小于下轨时,设置卖出信号

  3. 入场后设置固定止损位于SSL通道另一端,以控制风险

  4. 入场后设置跟踪止损,根据价格波动来锁定利润

  5. 当价格突破跟踪止损或固定止损位后,平仓离场

优势分析

  1. 基于通道指标判断长短方向,避免假突破

  2. 结合两种止损方式,既可锁定利润,也可控制风险

  3. 交易频率高,适合超短线操作

  4. 参数设置灵活,可调整至自己的交易风格

  5. 自动识别多空,不需要判断方向

风险分析

  1. 短线操作易受突发事件影响,需警惕高波动

  2. 固定止损在突破SSL后触发,可能会止损过大

  3. 跟踪止损设置不当可能过早离场

  4. 通道突破容易形成虚假信号,需组合其他指标过滤

  5. 仅适合有经验的短线交易者,不适合长线投资者

解决方法:

  1. 合理设置固定止损比例,控制单次止损

  2. 跟踪止损设置合理幅度,避免过早离场

  3. 结合量能指标等过滤器,识别真正趋势突破

  4. 做好资金管理,分批建仓,控制风险敞口

优化方向

  1. 优化SMA周期参数,调整到最佳长度

  2. 尝试其他通道指标,如BB,KD等

  3. 增加量能指标判断突破可信度

  4. 考虑换手率,避免低换手率假突破

  5. 测试不同持仓时间,找到最佳出场时机

  6. 测试固定止损和移动止损设置

  7. 调整仓位管理策略,优化资金使用效率

总结

本策略整合SSL通道指标判断趋势方向,以突破为信号入场,并使用双止损管理风险。优点是反应敏捷,易于掌握趋势,适合高频交易。需要注意防范假突破,完善止损机制,并控制好仓位。有潜力成为超短线交易的有效策略,值得进一步测试优化。

||

Overview

This strategy uses the SSL channel indicator to identify trend direction and trade breakouts with momentum. It goes long when price breaks above the SSL upper band and goes short when price breaks below the SSL lower band. Moving stop loss and trailing stop loss are used to control risks.

Strategy Logic

  1. Calculate upper and lower bands of SSL channel using SMA of high and low prices with N periods.

  2. Generate long signal when close is above upper band, and short signal when close is below lower band.

  3. Set fixed stop loss at the opposite band after entry, to limit losses.

  4. Set trailing stop loss that follows price movement, to lock in profits.

  5. Exit when price hits either fixed stop loss or trailing stop loss.

Advantages

  1. Use channel indicator to determine trend direction, avoid false breakouts.

  2. Dual stop loss combines profit taking and risk control.

  3. High trading frequency fits ultra short-term trading.

  4. Flexible parameters adaptable to personal trading style.

  5. Auto detect long/short, no directional judgement needed.

Risks

  1. Short-term trading prone to news shocks and high volatility.

  2. Fixed stop loss may trigger oversized loss after breakout.

  3. Improper trailing stop loss may lead to premature exit.

  4. Channel breakouts susceptible to false signals.

  5. Only suitable for experienced short-term traders.

Solutions:

  1. Set reasonable fixed stop loss to limit loss per trade.

  2. Optimize trailing stop loss levels to avoid early exit.

  3. Add volume filter to confirm true breakout.

  4. Manage position sizing, scale in to control risk exposure.

Optimization

  1. Optimize SMA periods to find best length.

  2. Try other channel indicators like BB, KD etc.

  3. Add volume indicator to confirm breakout credibility.

  4. Consider turnover rate to avoid low volume false breakout.

  5. Test different holding periods to find optimal exit timing.

  6. Test fixed and trailing stop loss parameters.

  7. Adjust position sizing strategy to maximize capital efficiency.

Summary

This strategy combines SSL channel directional bias and breakout signals, with dual stop loss management. It reacts fast to capture trends, suitable for high frequency trading. Beware of false breakouts, refine stop loss mechanisms, and control position sizing. With further optimization, it has the potential to be an effective ultrashort-term trading strategy.

[/trans]

Strategy Arguments

Argument Default Description
v_input_1 10 Period
v_input_2 10 Length
v_input_3 10 Trailing Stop Size (in Points)

Source (PineScript)

/*backtest
start: 2023-09-24 00:00:00
end: 2023-10-24 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
strategy("SSL Channel Cross with Trailing Stop and Stop Loss", overlay=true)

period = input(title="Period", defval=10)
len = input(title="Length", defval=10)
smaHigh = sma(high, len)
smaLow = sma(low, len)

Hlv = 0
Hlv := close > smaHigh ? 1 : close < smaLow ? -1 : Hlv[1]

sslDown = Hlv < 0 ? smaHigh : smaLow
sslUp = Hlv < 0 ? smaLow : smaHigh

plot(sslDown, linewidth=2, color=color.red)
plot(sslUp, linewidth=2, color=color.lime)

longCondition = crossover(sslUp, sslDown)
shortCondition = crossunder(sslUp, sslDown)

// Define el tamaño del trailing stop en puntos (ajusta según tu preferencia)
trailingStopSize = input(title="Trailing Stop Size (in Points)", defval=10)

var float trailingStopPrice = na
var float stopLossPrice = na

if (longCondition)
    // Si se cumple la condición de compra, configura la posición larga, el trailing stop y el stop loss
    strategy.entry("Long", strategy.long)
    trailingStopPrice := low - trailingStopSize
    stopLossPrice := sslDown

if (shortCondition)
    // Si se cumple la condición de venta corta, configura la posición corta, el trailing stop y el stop loss
    strategy.entry("Short", strategy.short)
    trailingStopPrice := high + trailingStopSize
    stopLossPrice := sslUp

// Calcula el trailing stop
if (strategy.position_size > 0)
    trailingStopPrice := max(trailingStopPrice, stopLossPrice)
    if (close < trailingStopPrice)
        strategy.close("ExitLong", comment="Trailing Stop Long")

if (strategy.position_size < 0)
    trailingStopPrice := min(trailingStopPrice, stopLossPrice)
    if (close > trailingStopPrice)
        strategy.close("ExitShort", comment="Trailing Stop Short")

Detail

https://www.fmz.com/strategy/430171

Last Modified

2023-10-25 17:40:37