
이 전략은 하루 안의 ?? 리버스 형태와 후속 그린 ?? 의 결합을 이용하여 잠재적인 상승 기회를 찾는다. ?? 리버스 형태가 발생하고 다음 ?? 이 그린 ?? 으로 상승할 때, 전략 오픈 포지션을 더 한다. ?? 리버스의 낮은 지점에 스톱 손실 위치가 설정되고, 스톱 포지션은 오픈 포지션 가격의 1.5배로 설정된다.
모양은 일반적인 기술 형태이며, 종종 하향 트렌드의 끝에서 나타나며, 트렌드 반전의 출현을 예고한다. 전형적인 모양은 다음과 같은 특징이 있다:
의 형태가 확인된 후, 다음 이 녹색으로 상승하고, 하위점이 의 하위점보다 높으면, 부리 신호가 형성되며, 이 때 입장은 더 한다. 위험을 제어하기 위해 의 하위점으로 스톱 손실을 설정하고, 잠재적인 이익을 얻기 위해 오프 스톱을 1.5 배로 설정한다.
일일 반전 형태 다단 전략은 ?? 형태 반전의 특성을 최대한 활용하여, 후속 녹색의 확인과 결합하여, 2개의 연속적인 K선 형태에 기초하여, 시선 신호를 형성한다. 동시에, 전략은 고정된 중지 손실 비율을 채택하여, 위험 노출 수준을 제어하고, 또한 ?? 손실 비율을 높은 수준으로 유지한다. 그러나, 이 전략은 형태의 정의에 대해 비교적 간단하며, 다른 기술 지표의 검증이 부족하여, 실제 응용에서 신호의 실패율이 높을 수 있다. 또한, 손실 위치 설정이 비교적 가깝기 때문에, 전략은 또한 단일 손실의 문제가 있다.
/*backtest
start: 2023-03-09 00:00:00
end: 2024-03-14 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Hammer Pattern and Follow-Up Green Candle Strategy", overlay=true)
// Detecting a Hammer candle
isHammer() =>
bodySize = math.abs(close[1] - open[1])
lowerWickSize = open[1] - low[1]
upperWickSize = high[1] - open[1] // For a red candle, the upper wick is from the open to the high
bodyIsSmall = bodySize <= (high[1] - low[1]) * 0.3 // Body is less than 30% of the entire candle range
lowerWickIsLong = lowerWickSize >= bodySize * 2 // Lower wick is at least twice the body length
noUpperWick = upperWickSize == 0 or high[1] <= open[1] * 1.01 // No upper wick or very small
close[1] < open[1] and bodyIsSmall and lowerWickIsLong and noUpperWick
// Check if the current candle is green with no or small tail
isGreenWithNoSmallTail() =>
close > open
// Entry condition
entryCondition = isHammer() and isGreenWithNoSmallTail() and low >low[1]
// Calculate stop loss and take profit levels
stopLossLevel = low[1]
profitTargetLevel = close * 1.5
//Calculate position bodySize
positionSize = 50000 / close
// Execute strategy
if (entryCondition)
strategy.entry("Hammer Buy", strategy.long,qty=positionSize)
strategy.exit("Take Profit / Stop Loss", "Hammer Buy", stop=stopLossLevel, limit=profitTargetLevel)