디마크 설정 표시기

저자:차오장, 날짜: 2022-05-31 19:29:50
태그:상승성추락

세트업 지표는 톰 데마르크에 의해 만들어졌으며 이것은 나중에 발표 할 그의 순차 지표의 많은 단계 중 하나입니다. 여러분 모두 제 데마르크 역전 포인트 스크립트를 정말 좋아해 보였습니다. 이 지표는 그것과 매우 비슷합니다. 이 지표는 소규모 트렌드 역전을 위해 설계되었으며 예제 차트에서 볼 수 있듯이 많은 구매 및 판매 신호를 제공합니다. 물론 모든 것이 완벽하지는 않지만 전체적으로 소규모 가격 역전을 식별하는 데 꽤 좋은 일을합니다. 이 지표는 가격 역전 포인트를 결정하기 위해 일정 기간 동안 존재하는 하락 추세 또는 상승 추세를 찾습니다.

만약 당신이 이것을 좋아한다면, 나에게 알려주세요. 그리고 나는 더 많은 데마크 지표 또는 적어도 나의 버전을 계속 출판할 것입니다.

백테스트

img


/*backtest
start: 2022-04-30 00:00:00
end: 2022-05-29 23:59:00
period: 30m
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
// Copyright (c) 2019-present, Franklin Moormann (cheatcountry)
// Demark Setup Indicator [CC] script may be freely distributed under the MIT license.
study("Demark Setup Indicator [CC]", overlay=true)

inp = input(title="Source", type=input.source, defval=close)
res = input(title="Resolution", type=input.resolution, defval="")
rep = input(title="Allow Repainting?", type=input.bool, defval=false)
bar = input(title="Allow Bar Color Change?", type=input.bool, defval=true)
src = security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length = input(title="Length", type=input.integer, defval=4, minval=1)

uCount = 0, dCount = 0
for i = 0 to length - 1
    uCount := uCount + (nz(src[i]) > nz(src[i + length]) ? 1 : 0)
    dCount := dCount + (nz(src[i]) < nz(src[i + length]) ? 1 : 0)
    
dsi = dCount == length ? 1 : uCount == length ? -1 : 0

sig = dsi > 0 or uCount > dCount ? 1 : dsi < 0 or dCount > uCount ? -1 : 0
dsiColor = sig > 0 ? color.green : sig < 0 ? color.red : color.black
alertcondition(crossover(dsi, 0), "Buy Signal", "Bullish Change Detected")
alertcondition(crossunder(dsi, 0), "Sell Signal", "Bearish Change Detected")
barcolor(bar ? dsiColor : na)
plotshape(crossover(dsi, 0), "Buy", shape.labelup, location.belowbar, color.green, text="Buy", textcolor=color.white)
plotshape(crossunder(dsi, 0), "Sell", shape.labeldown, location.abovebar, color=color.red, text="Sell", textcolor=color.white)


if crossover(dsi, 0)
    strategy.entry("Enter Long", strategy.long)
else if crossunder(dsi, 0)
    strategy.entry("Enter Short", strategy.short)

관련

더 많은