
이 전략은 다단계 스톱을 가진 BTC 로봇 거래 전략이다. 최저 지점을 찾아서 구매를 하고, 그 다음 다단계 스톱을 설정하여 스톱 출구를 한다. 동시에 스톱을 설정하여 위험을 통제한다. 이 전략은 BTC를 보는 상황에 적합하다.
진입 시점을 찾아라: CC 지표 아래 0축을 통과할 때 구매 신호가 발생하고, 이 지점에서 더 많은 주문을 구매한다.
스톱포인트 설정: 입력 설정 스톱퍼센트를 통해 가격으로 변환한 스톱포인트.
다단계 정지점을 설정: 4개의 출구점으로 나누고, 각 출구점의 정지 퍼센티지를 입력하여 가격으로 변환하여 정지점을 분할한다.
위험 제어: 최대 포지션량을 설정하고, 각 출구 지점의 출구 비율을 설정하여 위험을 분산한다.
이 전략은 다음과 같은 장점이 있습니다.
입점 신호는 신뢰성이 높기 때문에 가장 낮은 지점에서 구매를 찾고, 높은 지점에서 구매를 피한다.
다단계 스톱은 수익의 일부를 잠금하고 수익의 일부를 유지하면서 계속 작동 할 수 있습니다.
스톱로스 포인트를 설정하여 위험을 통제하여 손실을 일정 범위 내에서 제어 할 수 있습니다.
분기적으로 출전하면 위험을 분산하여 한 번에 모든 손실을 피할 수 있다.
하지만, 그 후로, 이 모든 것은 통제될 수 있습니다.
이 전략에는 다음과 같은 위험도 있습니다.
CC 지표는 100%의 하위점을 결정하지 못하여 구매 기회를 놓칠 수 있습니다.
스톱포인트 설정이 잘못되면 불필요한 스톱포인트 손실이 발생할 수 있습니다.
부적절한 출전 배열은 수익 손실을 초래할 수 있다.
“이런 일이 일어나면, 우리는 더 많은 일을 할 수 있을 것이다.
이 사건은 급격한 변동으로 인해, 막기 어려울 수도 있습니다.
다음의 몇 가지 측면에서 최적화할 수 있습니다.
입시 신호를 최적화하여 더 많은 지표 또는 기계 학습 판단을 추가하여 구매 시점을 결정합니다.
손해 방지 전략을 최적화하여 더 탄력적이고 더 잘 대처할 수 있도록 합니다.
경기 출전 전략을 최적화하여 경기 현황과 추세에 더 잘 적응할 수 있도록 한다.
트레일링 스톱 (trailing stop) 과 같은 전략이 추가되면서 더 탄력적인 스톱을 만들 수 있습니다.
다양한 품종의 파라미터 설정을 테스트하여 최적의 파라미터 조합을 찾습니다.
이 전략은 전반적으로 가장 낮은 점 구매 신호를 찾고, 여러 단계의 스톱과 스톱을 설정하는 BTC 거래 전략이다. 장점이 있지만, 또한 최적화 할 수있는 방향이 있습니다. 추가적인 최적화를 통해 전략은 철회 제어 및 스톱에서 더 잘 할 수 있습니다.
/*backtest
start: 2023-09-17 00:00:00
end: 2023-10-17 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
args: [["v_input_1",2]]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © RafaelZioni
// © theCrypster 2020
//@version=4
// strategy(title = "BTC bot", overlay = true, pyramiding=1,initial_capital = 10000, default_qty_type= strategy.percent_of_equity, default_qty_value = 100, calc_on_order_fills=false, slippage=0,commission_type=strategy.commission.percent,commission_value=0.075)
strat_dir_input = input(title="Strategy Direction", defval="long", options=["long", "short", "all"])
strat_dir_value = strat_dir_input == "long" ? strategy.direction.long : strat_dir_input == "short" ? strategy.direction.short : strategy.direction.all
strategy.risk.allow_entry_in(strat_dir_value)
//INPUTS
higherTF = input("W", type=input.resolution)
pc = security(syminfo.tickerid, higherTF, close[1], lookahead=true)
ph = security(syminfo.tickerid, higherTF, high[1], lookahead=true)
pl = security(syminfo.tickerid, higherTF, low[1], lookahead=true)
PP = 0.0,R1 = 0.0, R2 = 0.0, R3 = 0.0,S1 = 0.0, S2 = 0.0, S3 = 0.0
PP := (ph + pl + pc) / 3
R1 := PP + (PP - pl)
S1 := PP - (ph - PP)
R2 := PP + (ph - pl)
S2 := PP - (ph - pl)
factor=input(2)
R3 := ph + factor * (PP - pl)
S3 := pl - 2 * (ph - PP)
//
length=input(21)
//
p = close
vrsi = rsi(p, length)
pp=ema(vrsi,length)
d=(vrsi-pp)*5
cc=(vrsi+d+pp)/2
//
low1=crossover(cc,0)
sell=crossover(close[1],R3)
//
l = low1
s=sell
if l
strategy.entry("buy", strategy.long)
if s
strategy.entry("sell", strategy.short)
per(pcnt) =>
strategy.position_size != 0 ? round(pcnt / 100 * strategy.position_avg_price / syminfo.mintick) : float(na)
stoploss=input(title=" stop loss", defval=15, minval=0.01)
los = per(stoploss)
q1=input(title=" qty_percent1", defval=25, minval=1)
q2=input(title=" qty_percent2", defval=25, minval=1)
q3=input(title=" qty_percent3", defval=25, minval=1)
tp1=input(title=" Take profit1", defval=3, minval=0.01)
tp2=input(title=" Take profit2", defval=5, minval=0.01)
tp3=input(title=" Take profit3", defval=7, minval=0.01)
tp4=input(title=" Take profit4", defval=10, minval=0.01)
strategy.exit("x1", qty_percent = q1, profit = per(tp1), loss = los)
strategy.exit("x2", qty_percent = q2, profit = per(tp2), loss = los)
strategy.exit("x3", qty_percent = q3, profit = per(tp3), loss = los)
strategy.exit("x4", profit = per(tp4), loss = los)