
이 전략은 여러 기술 지표의 통합 신호를 계산하여 현재 시간 프레임 내의 트렌드 방향을 판단한다. 상승 추세로 판단될 때, 높은 지점에서 추적 중지 라인을 설정한다. 하향 추세로 판단될 때, 낮은 지점에서 추적 중지 라인을 설정한다. 전략은 다양한 품종과 다른 시간 프레임에 적응할 수 있으며, 스톱 라인을 동적으로 조정하여 위험을 제어한다.
이 전략은 평균선, ATR, KD, 변화율과 같은 여러 지표를 결합하여 현재 시간 프레임 내의 전반적인 추세 방향을 판단합니다. 구체적으로, 다음과 같은 몇 가지 하위 신호의 합성 값을 계산합니다.
위의 각 하위 신호는 평형 처리되고, 구매/판매 판단에 다른 마이너스를 설정한다. 각 하위 신호에 무게를 더하여, 현재 시간 프레임의 전체 신호를 계산한다. 신호가 0보다 크면 상승 추세로 판단되며, 신호가 0보다 작으면 하락 추세로 판단된다.
상승 추세로 판단될 때, 전략은 이전보다 높은 지점 근처에 추적 스톱 라인을 설정한다. 하향 추세로 판단될 때, 전략은 이전보다 낮은 지점 근처에 추적 스톱 라인을 설정한다. 따라서 실제 가격 움직임에 따라 스톱 라인을 동적으로 조정하여 위험 통제의 목적을 달성 할 수 있다.
이 전략은 여러 지표들을 통합하여 현재 트렌드 방향을 판단하여 판단의 정확도를 높인다. 또한, 전략은 다양한 품종과 시간 프레임에 적응할 수 있으며, 강한 적응력을 가지고 있다.
무엇보다도, 이 전략은 스톱 라인을 동적으로 조정할 수 있고, 실제 흐름에 따라 리스크 제어 수준을 조정할 수 있으며, 이를 통해 시스템적 위험을 헤퍼하는 것이 가장 큰 장점이다.
이 전략은 트렌드 신호의 질을 판단하는 데 있어 스톱 라인을 설정하는 데 직접적인 영향을 미치며, 판단에 오류가 발생하면 스톱 라인이 너무 느슨하거나 너무 엄격하게 설정될 수 있다. 또한, 스톱 라인이 시장 변동을 완전히 회피할 수 없는 위험도 있다.
이 전략은 또한 수익수준과 중단 거리를 균형 잡아야 합니다. 중단 거리가 너무 가까워지면 중단이 너무 자주 발생할 수 있습니다. 중단 거리가 너무 길다면 위험을 효과적으로 제어 할 수 없습니다. 이것은 다른 품종에 따라 다른 주기에 따라 파라미터를 최적화해야합니다.
기계 학습 알고리즘을 도입하여 트렌드 방향을 판단하는 모델을 역사 데이터로 훈련시키는 것이 고려될 수 있으며, 이는 판단의 정확성을 향상시킬 수 있습니다.
다양한 변수 조합을 테스트하여 스톱 라인의 거리를 최적화할 수 있다. 예를 들어, ATR 주기 변수를 시장의 변동성에 맞게 동적으로 조정한다.
또한 거래량 에너지 지표와 결합하여 실제 트렌드를 판단할 수 있으며, 수량 가격의 이탈으로 인한 신호 오류를 방지할 수 있다.
이 전략은 여러 기술 지표를 통합하여 현재 트렌드 방향을 판단하고 이에 따라 동적으로 조정하여 스톱 라인을 추적하여 스톱의 실효성을 높이고 거래 위험을 제어하는 것을 목표로합니다. 이 전략의 개념은 고급이며 추가로 최적화하고 검증할 가치가 있으며 참조 가능한 다중 시간 프레임으로 리스크 제어 전략에 적응합니다.
/*backtest
start: 2022-11-14 00:00:00
end: 2023-11-20 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © jigneshjc
//@version=5
strategy("Jigga - Survival Level", shorttitle='Jigga - Survival Level', overlay=true)
doBackTesting = input(true, 'Run Back Testing')
entryCondition = false
exitCondition = false
ab21 = 14, gh41 = ab21
gh42 = ab21, ju51 = 14
ki61 = ju51
lkolkp = true ,ab22 = 58
cd31 = 5 , ab23 = 42
aa12 = 29, cd32 = 26
op71 = 5, aa11 = 12
aa13 = 9, op72 = 2.0
movnwx = false
kahachale(byju, h, l) =>
mika = ta.change(h)
awer = -ta.change(l)
uikmhDM = na(mika) ? na : mika > awer and mika > 0 ? mika : 0
wrtdfcDM = na(awer) ? na : awer > mika and awer > 0 ? awer : 0
bbct = ta.rma(ta.tr, byju)
uikmh = fixnan(100 * ta.rma(uikmhDM, byju) / bbct)
wrtdfc = fixnan(100 * ta.rma(wrtdfcDM, byju) / bbct)
[uikmh, wrtdfc]
trial(gh42, gh41, h, l) =>
[uikmh, wrtdfc] = kahachale(gh42, h, l)
uuolop = uikmh + wrtdfc
trial = 100 * ta.rma(math.abs(uikmh - wrtdfc) / (uuolop == 0 ? 1 : uuolop), gh41)
trial
_pr(src, byjugth) =>
max = ta.highest(byjugth)
min = ta.lowest(byjugth)
100 * (src - max) / (max - min)
kyukarna(khulmkhula, mikaarwala, nichewala, bandhwala, partiwala) =>
sig = trial(gh42, gh41, mikaarwala, nichewala)
trialIncreasing = sig > ta.ema(sig, 5) ? lkolkp : movnwx
rolkmn = ta.ema(bandhwala, aa11)
psolkmn = ta.ema(bandhwala, aa12)
ujghd = rolkmn - psolkmn
wrtycv = ta.ema(ujghd, aa13)
kimnjg = ujghd - wrtycv
mikalilo = ta.rma(math.max(ta.change(bandhwala), 0), ab21)
awerlilo = ta.rma(-math.min(ta.change(bandhwala), 0), ab21)
lilo = awerlilo == 0 ? 100 : mikalilo == 0 ? 0 : 100 - 100 / (1 + mikalilo / awerlilo)
juylknlilo = ta.ema(lilo, 3)
rjuylkn = ta.ema(bandhwala, cd31)
psjuylkn = ta.ema(bandhwala, cd32)
percentR = _pr(bandhwala, ju51)
juylknpercentR = ta.ema(percentR, 3)
ad = bandhwala == mikaarwala and bandhwala == nichewala or mikaarwala == nichewala ? 0 : (2 * bandhwala - nichewala - mikaarwala) / (mikaarwala - nichewala) * partiwala
kiloValue = math.sum(ad, ki61) / math.sum(partiwala, ki61)
liiopn = ta.atr(op71)
mikaliiopn = (mikaarwala + nichewala) / 2 - op72 * liiopn
mika1liiopn = nz(mikaliiopn[1], mikaliiopn)
mikaliiopn := bandhwala[1] > mika1liiopn ? math.max(mikaliiopn, mika1liiopn) : mikaliiopn
dnliiopn = (mikaarwala + nichewala) / 2 + op72 * liiopn
dn1liiopn = nz(dnliiopn[1], dnliiopn)
dnliiopn := bandhwala[1] < dn1liiopn ? math.min(dnliiopn, dn1liiopn) : dnliiopn
omnerliiopn = 1
omnerliiopn := nz(omnerliiopn[1], omnerliiopn)
omnerliiopn := omnerliiopn == -1 and bandhwala > dn1liiopn ? 1 : omnerliiopn == 1 and bandhwala < mika1liiopn ? -1 : omnerliiopn
fitur = ujghd > 0 ? ujghd > wrtycv ? 1 : 0 : ujghd > wrtycv ? 0 : -1
mitur = kimnjg >= 0 ? kimnjg > kimnjg[1] ? 1 : 0 : kimnjg > kimnjg[1] ? 0 : -1
ritur = juylknlilo > ab22 ? 1 : juylknlilo < ab23 ? -1 : 0
circuits = rjuylkn > psjuylkn ? 1 : -1
trialPoints = trialIncreasing ? close > ta.ema(close, 3) ? 1 : -1 : 0
virar = juylknpercentR > -ab23 ? 1 : juylknpercentR < -ab22 ? -1 : 0
chikar = kiloValue > 0.1 ? 1 : kiloValue < -0.1 ? -1 : 0
sitar = omnerliiopn
p = fitur + mitur + ritur + circuits + trialPoints + virar + chikar + sitar
p
currentP = kyukarna(open, high, low, close, volume)
currentPNew = currentP >= 0 and currentP[1] <= 0 ? 0 : currentP <= 0 and currentP[1] >= 0 ? 0 : currentP
colorPNew = currentPNew == 0 ? color.black : currentPNew >= 0 ? color.green : color.red
//plot(currentPNew, color=colorPNew, title='CurrentTimeFrame')
LTN = 0.0
LTN := nz(LTN) ? 0.0 : (currentPNew[1] < 0 and currentPNew >= 0) ? high * 1.005 : (currentPNew[1] > 0 and currentPNew <= 0) ? low * 0.995 : LTN[1]
LClr = color.green
LClr := (currentPNew[1] < 0 and currentPNew >= 0) ? color.green : (currentPNew[1] > 0 and currentPNew <= 0) ? color.red : LClr[1]
plot(LTN,color=LClr,title="Level", style=plot.style_circles)
entryCondition:= high > LTN and LClr == color.green ? lkolkp : movnwx
exitCondition:= low < LTN and LClr == color.red ? lkolkp : movnwx
tradeRunning = movnwx
tradeRunning := nz(tradeRunning) ? movnwx : (not tradeRunning[1]) and entryCondition ? lkolkp : tradeRunning[1] and exitCondition ? movnwx : tradeRunning[1]
plotshape(tradeRunning and (not tradeRunning[1]) and (not doBackTesting), style=shape.labelup, location=location.belowbar, color=color.new(#00FF00, 50), size=size.tiny, title='Buy wrtycv', text='➹', textcolor=color.new(color.black,0))
plotshape((not tradeRunning) and tradeRunning[1] and (not doBackTesting), style=shape.labeldown, location=location.abovebar, color=color.new(#FF0000, 50), size=size.tiny, title='Sell wrtycv', text='➷', textcolor=color.new(color.white, 0))
if entryCondition and doBackTesting
strategy.entry(id="Buy",direction=strategy.long)
if exitCondition and doBackTesting
strategy.close(id="Buy")