
하라미 역전 (Haramie Reversal) 전략은 상표에 있는 하라미 역전 (Haramie Reversal) 형태를 식별하여 자동 거래를 구현한다. 하라미 역전 (Haramie Reversal) 형태를 식별할 때, 이 전략은 상장 포지션에 들어간다.
이 전략의 핵심 식별 지표는: 앞의 K 라인은 장양 라인이고, 두 번째 K 라인은 종결 가격이 앞의 K 라인 엔티티에 포함되어 있으며, 음선이라면, 수요가 반전 할라미 형태를 형성할 수 있다. 이 형태에 부합하면, 전략은 상거래 위치에 들어갈 것이다.
이 논리는 다음과 같습니다.
이 전략은 다음과 같은 장점을 가지고 있습니다.
이 전략에는 몇 가지 위험도 있습니다.
이 전략은 다음과 같은 부분에서 최적화될 수 있습니다.
상가 반전 하라미 역측정 전략의 전체 논리는 명확하고, 이해하기 쉽고, 최적화되며, 역측정 결과는 좋다. 위험은 통제 가능하며, 실장 조정 공간이 있다. 전체적으로 볼 때, 이 전략으로 형성된 거래 신호는 신뢰성이 높으며, 추가 실장 검증과 최적화를 할 가치가 있다.
/*backtest
start: 2023-11-15 00:00:00
end: 2023-11-19 23:00:00
period: 15m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 16/01/2019
// This is a bearish reversal pattern formed by two candlesticks in which a short
// real body is contained within the prior session's long real body. Usually the
// second real body is the opposite color of the first real body. The Harami pattern
// is the reverse of the Engulfing pattern.
//
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
strategy(title = "Bearish Harami Backtest", overlay = true)
input_takeprofit = input(20, title="Take Profit pip")
input_stoploss = input(10, title="Stop Loss pip")
input_minsizebody = input(3, title="Min. Size Body pip")
barcolor(abs(close- open) >= input_minsizebody ? close[1] > open[1] ? open > close ? open <= close[1] ? open[1] <= close ? open - close < close[1] - open[1] ? yellow :na :na : na : na : na : na)
pos = 0.0
barcolor(nz(pos[1], 0) == -1 ? red: nz(pos[1], 0) == 1 ? green : blue )
posprice = 0.0
posprice := abs( close - open) >= input_minsizebody? close[1] > open[1] ? open > close ? open <= close[1] ? open[1] <= close ? open - close < close[1] - open[1] ? close :nz(posprice[1], 0) :nz(posprice[1], 0) : nz(posprice[1], 0) : nz(posprice[1], 0) : nz(posprice[1], 0): nz(posprice[1], 0)
pos := iff(posprice > 0, -1, 0)
if (pos == 0)
strategy.close_all()
if (pos == -1)
strategy.entry("Short", strategy.short)
posprice := iff(low <= posprice - input_takeprofit and posprice > 0, 0 , nz(posprice, 0))
posprice := iff(high >= posprice + input_stoploss and posprice > 0, 0 , nz(posprice, 0))