둥근 번호 추적 전략

저자:차오장, 날짜: 2023-09-21 15:24:53
태그:

전반적인 설명

이 전략은 Stop Loss 및 Take Profit 레벨이 종종 원형 숫자 또는 핵심 가격 수준에 배치되며, 이는 지원 및 저항으로 작용한다는 아이디어에 기반합니다. 전략은 이러한 주요 가격 수준을 식별하고 가격이 접근 할 때 거래를합니다.

전략 논리

이 전략의 주요 규칙은 다음과 같습니다.

  1. 클로즈 가격이 핵심 가격 수준을 넘어서고 지난 10 바에서 그 수준에 도달하지 않은 경우, 긴 거리를 가십시오.

  2. 20점 단계의 트레일링 스톱을 사용하여 가격이 키 레벨을 돌파한 후 움직임을 따라가십시오.

  3. 판매 신호는 반대입니다. 클로즈가 키 레벨 이하이고 지난 10바에서 닿지 않은 경우, 쇼트합니다.

  4. 주요 레벨은 다음과 같습니다.

    • 근값을 정수로 변환합니다
    • 50로 나눈 나머지 값을 계산합니다 (구성 가능합니다)
    • 잔액이 25보다 많으면 다음 50개의 정수를 키 레벨로 사용해야 합니다
    • 그렇지 않으면 키 레벨 변경되지 않습니다

이 전략은 둥근 수와 핵심 레벨이 종종 황소와 곰의 전투 현장이며, 따라서 효과적인 거래 신호를 제공한다는 심리학에 기반합니다. 후속 정지는 브레이크 이후의 트렌드를 따릅니다.

장점

이 전략의 장점은 다음과 같습니다.

  1. 간단하고 직관적인 거래 신호와 출입 규칙
  2. 기기별 규칙보다는 핵심 가격의 보편적인 패턴을 이용합니다.
  3. 트렌드를 따라가면서 수익을 올릴 수 있습니다.

위험성

고려해야 할 위험은 다음과 같습니다.

  1. 키 레벨은 항상 강력한 지원/저항으로 작용하지 않을 수 있습니다. 가짜 브레이크가 가능합니다.
  2. 고정된 10 바 룩백은 다른 기기에 적합하지 않을 수 있습니다.
  3. 후속 정지 거리는 너무 넓지 않아야 합니다. 그렇지 않으면 조기에 정지할 수 있습니다.

가능한 해결책:

  1. 키 레벨의 강도를 판단하기 위해 더 많은 필터를 추가하십시오. 예를 들어 볼륨.
  2. 다양한 기기에 대한 룩백 기간과 같은 매개 변수를 최적화합니다.
  3. 더 적응력 있게 후속 정지 메커니즘을 최적화해

더 나은 기회

이 전략은 다음과 같이 개선될 수 있습니다.

  1. 키 레벨의 중요성을 확인하고 가짜를 피하기 위해 더 많은 조건을 추가합니다. 예를 들어 볼륨과 결합합니다.

  2. 기기 특성에 따라 키 레벨 범위와 룩백 기간과 같은 매개 변수를 최적화합니다.

  3. 후속 정지 메커니즘을 향상시키는 것, 예를 들어, 고정된 점의 경로 대신 동적 경로를 사용하는 것.

  4. 기계 학습을 통합하여 역사적인 데이터를 사용하여 핵심 레벨의 강도를 판단합니다.

  5. 더 높은 TF 트렌드와 더 낮은 TF 추적을 가진 멀티 타임프레임 시스템으로 확장합니다.

결론

이 전략은 주요 가격 수준과 거래 협약에 기반한 간단하고 직관적인 신호를 제공합니다. 풍부한 기회가 있지만 가짜아웃을 처리하기 위해 추가 최적화가 필요합니다. 매개 변수 조정 및 기계 학습은 안정성을 향상시킬 수 있습니다. 좋은 일 거래 아이디어를 제공하며 멀티 타임프레임 트렌드 추적 시스템으로 확장 할 수 있습니다.


/*backtest
start: 2022-09-14 00:00:00
end: 2023-09-20 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
//Strategy based on the idea that stop loss and take profit are often placed at full price levels or round numbers, whcih acts as resistance and supports levels
//Buy Rules:
//Actual price (close) is above round number.
//Round number level was not touched in previous ten bars (arbitrary value).
//Place a buy and follow the order with a trail step because price can bounce at round number (support) or can go through it.
//Sell Rules are the same of buy rules but inverted.
//
//Need improvement on conditions' logic and round numbers definitions


strategy("dP magnet", overlay=true, pyramiding=0,default_qty_type=strategy.percent_of_equity,default_qty_value=100,currency=currency.USD)

//Round Levels credit to RKchartest

roundLevel50 = input(500, 'Round Level 1, pips')
//roundLevel100 = input(1000, 'Round Level 2, pips')
deviation = input(1000, 'Max distance, pips', minval=0) 

rDelimeter = 1/syminfo.mintick

intRoundLevel = close[1] * rDelimeter

intRemainder = intRoundLevel % roundLevel50 
toRound = (intRemainder >= roundLevel50/2) ? roundLevel50 : 0
roundLevel = (intRoundLevel - intRemainder + toRound) / rDelimeter
plot(roundLevel, title='Round Level 1', color=black, style=line, transp=0, linewidth=1, trackprice=false)

//intRemainder2 = intRoundLevel % roundLevel100
//toRound2 = (intRemainder2 >= roundLevel100/2) ? roundLevel100 : 0
//roundLevel2 = (intRoundLevel - intRemainder2 + toRound2) / rDelimeter
//plot((abs(roundLevel2 - close) * rDelimeter < deviation) ? roundLevel2 : na, title='Round Level 2', color=black, style=circles, transp=0, linewidth=1, trackprice=true)

// end

//Start of strategy

distToFullNumber=(close-roundLevel) //can be positive or negative number

distPips=input(100,'Distance in pips to full level',minval=10) //user defined: this distance defines when to open an order at market price


TrailS=input(20,'Trail Step points',minval=10) //trail step that follows the order

longCondition = iff(distToFullNumber>0 and abs(distToFullNumber)<=distPips and lowest(low,10)>roundLevel,true,false)

if (longCondition)
    strategy.entry("LongMagnet", strategy.long)
    strategy.exit("ExitMagnet","LongMagnet",trail_points=TrailS)

shortCondition = iff(distToFullNumber<0 and abs(distToFullNumber)<=distPips and highest(high,10)<roundLevel,true,false)

if (shortCondition)
    strategy.entry("ShortMagnet", strategy.short)
    strategy.exit("Exit_Magnet","ShortMagnet",trail_points=TrailS)
    

더 많은