[암호화폐 트레이딩] Watchbot's RSI
https://watchbot.co.kr/
RSI
단순 RSI를 이용한 전략을 구성해 보도록 하겠습니다.
추세형 또는 역추세형으로 적용해 볼 수 있습니다.
우선 역추세형입니다.
if rsi(c, a1)<a2 then buy 1 contracts next bar at market;
if rsi(c, a3)>a4 then sell 1 contracts next bar at market;
과매도에 매수하고 과매수에 매도하는 전략입니다.
2017년부터 100회 이상의 거래가 발생하는 결과를 뽑아보면 다음과 같습니다.
첫 번째 결과의 Equity Curve는 다음과 같습니다.
위 결과 중 세 가지를 워치봇에 적용해 보겠습니다.
Multichart와 워치봇을 둘 다 확인해 봐야 하는 이유는 단리 거래와 복리 거래는 그 차이가 매우 크기 때문입니다.
복리 거래에서 수익이 나는 결과는 단리에서 수익이 나지만 단리에서 수익이 나는 거래가 복리에서 수익이 나지 않을 수 있습니다.
(25, 70, 40, 70) "lastBalance": 3855430, "earningsRate": 2.8554, "totalFee": 3132554, "tradeCount": 201, "from": "2017-01-01 10:00", "to": "2018-03-29 10:00",
"lastBalance": 454172, "earningsRate": -0.5458, "totalFee": 49452, "tradeCount": 13, "from": "2018-01-01 10:00", "to": "2018-03-29 10:00",
(15, 70, 15, 80) "lastBalance": 4286451, "earningsRate": 3.2865, "totalFee": 3819456, "tradeCount": 211, "from": "2017-01-01 10:00", "to": "2018-03-29 10:00",
"lastBalance": 427028, "earningsRate": -0.573, "totalFee": 60967, "tradeCount": 19, "from": "2018-01-01 10:00", "to": "2018-03-29 10:00",
(25, 80, 18, 80) "lastBalance": 3713867, "earningsRate": 2.7139, "totalFee": 3637926, "tradeCount": 197, "from": "2017-01-01 10:00", "to": "2018-03-29 10:00",
"lastBalance": 427670, "earningsRate": -0.5723, "totalFee": 52552, "tradeCount": 15, "from": "2018-01-01 10:00", "to": "2018-03-29 10:00",
변수 값이 변해도 비슷한 결과를 보입니다.
최근에 반토막 나는 전략입니다. 상승장에서는 좋았지만 하락장에서는 쓸 수 없는 결과입니다.
생각을 전환해 봅니다.
과매수에 매수, 과매도에 매도 즉 추세형 전략으로 바꾸면 다음과 같습니다.
if rsi(c, a1)>a2 then buy 1 contracts next bar at market;
if rsi(c, a3)<a4 then sell 1 contracts next bar at market;
[BTC]
(25, 60) (25, 40) "lastBalance": 6247247, "earningsRate": 5.2472, "totalFee": 4015961, "tradeCount": 294, "from": "2017-01-01 09:30", "to": "2018-04-10 00:00",
"lastBalance": 1173151, "earningsRate": 0.1732, "totalFee": 377455, "tradeCount": 62, "from": "2018-01-01 01:15", "to": "2018-04-10 00:00",
(50, 55) (50, 45) "lastBalance": 6344325, "earningsRate": 5.3443, "totalFee": 2853768, "tradeCount": 228, "from": "2017-01-01 09:30", "to": "2018-04-10 00:00",
"lastBalance": 1350742, "earningsRate": 0.3507, "totalFee": 281356, "tradeCount": 44, "from": "2018-01-01 01:15", "to": "2018-04-10 00:00",
(20, 65) (20, 35) "lastBalance": 6656966, "earningsRate": 5.657, "totalFee": 2932204, "tradeCount": 224, "from": "2017-01-01 09:30", "to": "2018-04-10 00:00",
"lastBalance": 1488853, "earningsRate": 0.4889, "totalFee": 316889, "tradeCount": 46, "from": "2018-01-01 01:15", "to": "2018-04-10 00:00",
(15, 70) (15, 30) "lastBalance": 7156408, "earningsRate": 6.1564, "totalFee": 3105846, "tradeCount": 206, "from": "2017-01-01 09:30", "to": "2018-04-10 00:00",
"lastBalance": 1297455, "earningsRate": 0.2975, "totalFee": 269247, "tradeCount": 44, "from": "2018-01-01 01:15", "to": "2018-04-10 00:00",
[ETH]
(25, 60) (25, 40) "lastBalance": 33651831, "earningsRate": 32.6518, "totalFee": 29001642, "tradeCount": 300, "from": "2017-01-01 09:30", "to": "2018-04-10 00:00",
"lastBalance": 1203012, "earningsRate": 0.203, "totalFee": 520006, "tradeCount": 62, "from": "2018-01-01 01:15", "to": "2018-04-10 00:00",
(50, 55) (50, 45) "lastBalance": 37293269, "earningsRate": 36.2933, "totalFee": 22144256, "tradeCount": 240, "from": "2017-01-01 09:30", "to": "2018-04-10 00:00",
"lastBalance": 1148094, "earningsRate": 0.1481, "totalFee": 365448, "tradeCount": 50, "from": "2018-01-01 01:15", "to": "2018-04-10 00:00",
(20, 65) (20, 35) "lastBalance": 22191693, "earningsRate": 21.1917, "totalFee": 14136072, "tradeCount": 167, "from": "2017-01-01 09:30", "to": "2018-04-10 00:00",
"lastBalance": 746933, "earningsRate": -0.2531, "totalFee": 189841, "tradeCount": 35, "from": "2018-01-01 13:00", "to": "2018-04-10 00:00",
(15, 70) (15, 30) "lastBalance": 16679391, "earningsRate": 15.6794, "totalFee": 15813072, "tradeCount": 244, "from": "2017-01-01 09:30", "to": "2018-04-10 00:00",
"lastBalance": 937563, "earningsRate": -0.0624, "totalFee": 375081, "tradeCount": 54, "from": "2018-01-01 01:15", "to": "2018-04-10 00:00",
우선 추세형 프레임은 의미 있는 결과를 보입니다.
변동성이 크고 추세가 큰 장에서는 당연한 결과입니다.
추세형 진입은 후행성 진입이기 때문에 불리한 가격에 진입하게 되고 따라서 수익이 날 때 기대 손실보다 많은 수익을 내야 수익이 발생하게 됩니다.
따라서 추세형 전략은 손실은 제한하고 수익은 제한하지 않는 것이 좋습니다만 정답은 아닙니다.
하루에도 10% 이상이 움직이는 암호화폐 시장에서 적절한 익절과 손절을 정하기란 매우 어려운 일일 것입니다.
거래 횟수가 통계적으로 충분하지 않은 데이터에서 손절과 익절은 트레이더가 견딜 수 있는 수준으로 정할 수밖에 없습니다.
손절을 16%로 정하고 익절을 두지 않도록 하겠습니다.
[BTC]
(25, 60, 25, 40) 손절 16% "lastBalance": 8677124, "earningsRate": 7.6771, "totalFee": 4951514, "tradeCount": 295, "from": "2017-01-01 10:30", "to": "2018-03-29 10:00",
(20, 70, 25, 40) 손절 16% "lastBalance": 8489571, "earningsRate": 7.4896, "totalFee": 2794787, "tradeCount": 170, "from": "2017-01-01 19:30", "to": "2018-03-29 10:00",
(60, 60, 25, 40) 손절 16% "lastBalance": 8230051, "earningsRate": 7.2301, "totalFee": 2212546, "tradeCount": 140, "from": "2017-01-01 20:00", "to": "2018-03-29 10:00",
(55, 60, 80, 50) 손절 16% "lastBalance": 8249751, "earningsRate": 7.2498, "totalFee": 2198635, "tradeCount": 148, "from": "2017-01-01 19:45", "to": "2018-03-29 10:00",
상위 세 개의 매도부 변수는 같고, 매수부 변수는 조금씩 다르기 때문에 같은 전략으로 평가할 수 있을 것이고 네 번째 변수는 상위 세 개의 매수부 변수와 흡사하고 매도부 변수는 차이가 있는 형태입니다.
이번 결과에서 알 수 있는 사실은 암호화폐 하락장에서 RSI를 단독으로 쓰려면 추세형으로 쓰고 역추세 형으로 쓰면 하락장에 손실을 방어할 수 없다는 것입니다.
[ETH]
(25, 60, 25, 40) 손절 16% "lastBalance": 38504198, "earningsRate": 37.5042, "totalFee": 27598289, "tradeCount": 311, "from": "2017-01-01 10:00", "to": "2018-03-29 10:00",
"lastBalance": 1430223, "earningsRate": 0.4302, "totalFee": 473202, "tradeCount": 53, "from": "2018-01-01 10:45", "to": "2018-03-29 10:00",
(55, 60, 80, 50) 손절 16% "lastBalance": 28806611, "earningsRate": 27.8066, "totalFee": 15032570, "tradeCount": 170, "from": "2017-01-01 10:00", "to": "2018-03-29 10:00",
"lastBalance": 1022239, "earningsRate": 0.0222, "totalFee": 146744, "tradeCount": 24, "from": "2018-01-01 13:15", "to": "2018-03-29 10:00",
[ETC]
(25, 60, 25, 40) 손절 16% "lastBalance": 1692087, "earningsRate": 0.6921, "totalFee": 2378252, "tradeCount": 360, "from": "2017-01-01 11:45", "to": "2018-03-29 10:00",
"lastBalance": 1476375, "earningsRate": 0.4764, "totalFee": 483518, "tradeCount": 58, "from": "2018-01-01 12:00", "to": "2018-03-29 10:00",
(55, 60, 80, 50) 손절 16% "lastBalance": 5202001, "earningsRate": 4.202, "totalFee": 2263810, "tradeCount": 168, "from": "2017-01-03 23:45", "to": "2018-03-29 10:00",
"lastBalance": 1587323, "earningsRate": 0.5873, "totalFee": 157514, "tradeCount": 24, "from": "2018-01-01 12:00", "to": "2018-03-29 10:00",
RSI 한 가지 지표만 이용해서 거래하기에 불안하다면 두 가지 지표를 조합해 보겠습니다.
추세&추세, 역추세&역추세, 추세&역추세 크게 세 가지 형태로 지표를 조합할 수 있을 것입니다.
RSI를 추세형으로 쓰기로 결정했다면 나머지 지표는 추세 또는 비추세 로 사용하면 될 것입니다.
물론 매수/매도를 비대칭형(Or/기타 지표)으로 쓴다면 그 조합은 무한대로 늘어날 것이기 때문에 우선 대칭형 조합만 확인하도록 합니다.
[RSI 추세 & ADX 추세]
if adx(a1)>a2 and rsi(c, a3)>a4 then buy 1 contracts next bar at market;
if adx(a1)<100-a2 and rsi(c, a3)<100-a4 then sell 1 contracts next bar at market;
RSI 추세 & ADX 역추세는 좋은 결과를 찾을 수 없었습니다.
추세 & 추세는 RSI가 대부분의 시그널을 형성하고 ADX는 좋은 필터가 아니었습니다.
RSI에 ADX 필터는 좋은 조합이 아님을 확인했습니다.
[RSI 추세 & ParabolicSAR 역추세]
RSI 만으로 전략을 구성할 수 있다는 것을 알았기 때문에 RSI 단독으로는 의미 없는 결과이지만 합쳤을 때 의미 있는 결과를 보이는 전략이 좋은 결과입니다.
RSI 만 쓴 전략과 상관관계가 떨어져야 포트폴리오 효과를 낼 수 있기 때문입니다.
if c<ParabolicCustom(0.02,0.02) and rsi(c,90)>50 then buy 1 contracts next bar at market;
if c>ParabolicCustom(0.02,0.02) and rsi(c,90)<50 then sell 1 contracts next bar at market;
setstoploss(c*0.01*15);
위 전략 중 RSI 만 쓰면
Parabolic 만 쓰면
두 지표를 함께 쓰면
단리에서는 승률이 낮아도 수익이 나지만 복리에서는 승률이 매우 중요합니다.
따라서 단리 수익이 난다고 해서 워치봇 즉 복리에서 수익이 나는 것이 아닙니다.
Parabolic + RSI 조합 몇 가지를 정리해 보았습니다.
[BTC]
PSAR (0.02, 0.02), RSI(90,50) 손절 15% "lastBalance": 18349622, "earningsRate": 17.3496, "totalFee": 9001519, "tradeCount": 294, "from": "2017-01-01 14:00", "to": "2018-03-29 10:00",
"lastBalance": 1094457, "earningsRate": 0.0945, "totalFee": 247098, "tradeCount": 46, "from": "2018-01-01 17:45", "to": "2018-03-29 10:00",
PSAR (0.04, 0.02), RSI(70,50) 손절 15% "lastBalance": 9361954, "earningsRate": 8.362, "totalFee": 5457548, "tradeCount": 348, "from": "2017-01-01 14:00", "to": "2018-03-29 10:00",
"lastBalance": 1195642, "earningsRate": 0.1956, "totalFee": 273755, "tradeCount": 48, "from": "2018-01-01 17:45", "to": "2018-03-29 10:00",
PSAR (0.03, 0.04), RSI(60,50) 손절 15% "lastBalance": 5717883, "earningsRate": 4.7179, "totalFee": 5092600, "tradeCount": 484, "from": "2017-01-01 11:45", "to": "2018-03-29 10:00",
"lastBalance": 1240497, "earningsRate": 0.2405, "totalFee": 388677, "tradeCount": 62, "from": "2018-01-01 10:00", "to": "2018-03-29 10:00",
[ETH]
PSAR (0.02, 0.02), RSI(90,50) 손절 15% "lastBalance": 27092686, "earningsRate": 26.0927, "totalFee": 20435112, "tradeCount": 322, "from": "2017-01-01 19:15", "to": "2018-03-29 10:00",
"lastBalance": 1245459, "earningsRate": 0.2455, "totalFee": 391337, "tradeCount": 52, "from": "2018-01-01 20:30", "to": "2018-03-29 10:00",
PSAR (0.04, 0.02), RSI(70,50) 손절 15% "lastBalance": 19244393, "earningsRate": 18.2444, "totalFee": 18625702, "tradeCount": 402, "from": "2017-01-01 20:00", "to": "2018-03-29 10:00",
"lastBalance": 1171107, "earningsRate": 0.1711, "totalFee": 474534, "tradeCount": 66, "from": "2018-01-01 20:30", "to": "2018-03-29 10:00",
PSAR (0.03, 0.04), RSI(60,50) 손절 15% "lastBalance": 11809108, "earningsRate": 10.8091, "totalFee": 15524467, "tradeCount": 502, "from": "2017-01-01 17:30", "to": "2018-03-29 10:00",
"lastBalance": 944519, "earningsRate": -0.0555, "totalFee": 569146, "tradeCount": 88, "from": "2018-01-01 17:45", "to": "2018-03-29 10:00",
Test Spec
Tool : Multichart 8.0Exchange : Coinone
Timeframe : 15 min
Slippage&Commission : 20000
Initial Capital : 1000000
Period : 2017.01.01~2018.03.16
Value : BTC/KRW
Leave [암호화폐 트레이딩] Watchbot's RSI to:
Read more #kr posts
Best Posts From perkyto
We have not curated any of watchbot's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.