本策略是一个利用动量指标与关键支持位结合的突破交易策略。它结合了卡玛拉支撑位、移动平均线以及价格突破来产生交易信号。
策略的核心逻辑是:当价格处于关键的卡玛拉支撑位附近且有效突破该位时,产生买入信号;当价格上涨至关键的卡玛拉阻力位时,产生卖出信号。
具体来说,策略利用卡玛拉支撑位L3作为买入信号的确认位。当价格低于L3且低于L3与L2的中点时会触发买入条件。这表示价格接近关键支撑,有望得到支撑反弹。为过滤假突破,策略还设置了进场条件:收盘价要大于开盘价。
策略的止损方式则是设定了动态止损位。当价格超过卡玛拉阻力位H1与H2的中点时,会触发止损卖出。这个动态止损位能够根据市场波动幅度来 trailing stop loss。
这是一个结合趋势和支持位的可靠策略。它的优势有:
该策略也存在一些风险:
对策是:调整卡玛拉位的参数,使之更符合目前市场波动范围;适当放宽止损幅度,防止过早止损;在趋势下跌时只做空仓,避免做多被套。
该策略还可进一步优化的方向有:
本策略综合运用了趋势、支撑位、突破等多个维度来制定入场和止损规则,是一种较为稳健的突破交易策略。它结合卡玛拉重要位的验证效果与动量指标的趋势判断,旨在在高概率区域捕捉趋势交易机会。同时设置动态止损来控制风险。该策略可为我们的策略库增加一种有效的趋势突破策略。
/*backtest
start: 2023-11-05 00:00:00
end: 2023-11-28 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
//Created by CristianD
strategy(title="CamarillaStrategyVhaouri", shorttitle="CD_Camarilla_StrategyV1", overlay=true)
//sd = input(true, title="Show Daily Pivots?")
EMA = ema(close,8)
hh ="X"
//Camarilla
pivot = (high + low + close ) / 3.0
range = high - low
h5 = (high/low) * close
h4 = close + (high - low) * 1.1 / 2.0
h3 = close + (high - low) * 1.1 / 4.0
h2 = close + (high - low) * 1.1 / 6.0
h1 = close + (high - low) * 1.1 / 12.0
l1 = close - (high - low) * 1.1 / 12.0
l2 = close - (high - low) * 1.1 / 6.0
l3 = close - (high - low) * 1.1 / 4.0
l4 = close - (high - low) * 1.1 / 2.0
h6 = h5 + 1.168 * (h5 - h4)
l5 = close - (h5 - close)
l6 = close - (h6 - close)
// Daily line breaks
//sopen = request.security(syminfo.tickerid, "D", open [1])
//shigh = request.security(syminfo.tickerid, "D", high [1])
//slow = request.security(syminfo.tickerid, "D", low [1])
//sclose = request.security(syminfo.tickerid, "D", close [1])
//
// Color
//dcolor=sopen != sopen[1] ? na : black
//dcolor1=sopen != sopen[1] ? na : red
//dcolor2=sopen != sopen[1] ? na : green
//Daily Pivots
dtime_pivot = request.security(syminfo.tickerid, 'W', pivot[1])
dtime_h6 = request.security(syminfo.tickerid, 'W', h6[1])
dtime_h5 = request.security(syminfo.tickerid, 'W', h5[1])
dtime_h4 = request.security(syminfo.tickerid, 'W', h4[1])
dtime_h3 = request.security(syminfo.tickerid, 'W', h3[1])
dtime_h2 = request.security(syminfo.tickerid, 'W', h2[1])
dtime_h1 = request.security(syminfo.tickerid, 'W', h1[1])
dtime_l1 = request.security(syminfo.tickerid, 'W', l1[1])
dtime_l2 = request.security(syminfo.tickerid, 'W', l2[1])
dtime_l3 = request.security(syminfo.tickerid, 'W', l3[1])
dtime_l4 = request.security(syminfo.tickerid, 'W', l4[1])
dtime_l5 = request.security(syminfo.tickerid, 'W', l5[1])
dtime_l6 = request.security(syminfo.tickerid, 'W', l6[1])
men = (dtime_l1-dtime_l2)/7
//plot(sd and dtime_l5 ? dtime_l5 : na, title="Daily L5",color=dcolor2, linewidth=2)
//plot(sd and dtime_l6 ? dtime_l6 : na, title="Daily L6",color=dcolor2, linewidth=2)
longCondition = close <=dtime_l3 and close <= (dtime_l3-men)//close >dtime_h4 and open < dtime_h4 and EMA < close
if (longCondition)
strategy.entry("Long12", strategy.long)
strategy.exit ("Exit Long","Longl2")
if (high >= (dtime_h1-men))
strategy.entry("Short", strategy.short)
strategy.exit ("Exit Short","Short")