무작위 운에 기초한 간단한 거래 전략

저자:차오장, 날짜: 2023-09-13 17:48:13
태그:

이 전략은 단순한 거래 전략 (Simple Trading Strategy Based on Random Luck) 이라고 불린다. 이 전략은 많은 양의 반복 테스트를 통해 무작위 거래의 성능을 평가하여 매주 첫 거래일에 긴 또는 짧은 신호를 생성하는 무작위 방법을 사용합니다.

구체적으로, 거래 논리는 매우 간단합니다:

  1. 매주 월요일에 동전을 던지면, 무작위로 헤즈나 꼬리 결과를 만들어냅니다.

  2. 헤이스가 있다면, 그 날 롱, 꼬리가 있다면, 그 날 쇼트

  3. 스톱 로스를 1x ATR로 설정하고, 긴 경우 1x ATR로 수익을 취하고, 짧은 경우 반대로 1: 1 리스크-어워드 비율을 달성합니다.

  4. 주말까지 위치 유지 후 닫습니다.

이점은 무작위 거래의 평균 승률을 평가하기 위해 수년간의 데이터를 백테스트하는 것입니다. 거래 규칙은 매우 간단하며 비교 기준으로 사용될 수 있습니다.

그러나 무작위 거래는 시장 패턴을 활용할 수 없으며 지속적인 이윤을 창출할 가능성이 거의 없습니다. 고정 스톱 손실 및 수익을 취하는 것도 손실을 증가시키는 위험을 초래합니다. 거래자는 라이브 거래가 아닌 실험 전략으로만 사용할 수 있습니다.

결론적으로, 백테스트 결과는 무작위 거래의 결과를 제안 할 수 있지만 실제로 적용 가능한 전략을 대표하지 않습니다. 거래자는 궁극적으로 여전히 재량과 체계적인 거래 기술을 필요로합니다.


/*backtest
start: 2022-09-12 00:00:00
end: 2023-01-12 00:00:00
period: 2d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("CoinFlip", overlay = true)

int result = int(math.random()+0.5)
atr_period = input(defval = 20, title = "ATR Period")
year_to_test = input(defval = 2022, title = "Year to Test")
day_of_week = input(defval = 1, title = "Day of Week")

atr = ta.atr(atr_period)

shouldSell = result == 0 and dayofweek == day_of_week
shouldBuy = result == 1 and dayofweek == day_of_week 

plotshape(result == 0 and dayofmonth == day_of_week, title="sell", location=location.abovebar, color=color.red, transp=0, style=shape.arrowdown)
plotshape(result == 1 and dayofmonth == day_of_week, title="buy", location=location.belowbar, color=color.lime, transp=0, style=shape.arrowup)


strategy.entry("short entry", strategy.short, 1000 / (1*atr), when=shouldSell and year == year_to_test)
strategy.entry("long entry", strategy.long,  1000  / (1*atr), when=shouldBuy and year == year_to_test)

strategy.exit("exit", "long entry", limit = close + 1*atr, stop = close - 1*atr, when = shouldBuy)
strategy.exit("exit", "short entry", limit = close - 1*atr, stop = close + 1*atr, when = shouldSell)



더 많은