JBravo 양적 동향 전략

저자:차오장, 날짜: 2023-12-27 14:53:07
태그:

전략 개요

JBravo 양적 트렌드 전략은 이동 평균에 기반한 트렌드 추후 전략이다. 9일 간 간단한 이동 평균, 20일 기하급수적 이동 평균, 180일 간 간단한 이동 평균을 사용하여 시장 트렌드 방향을 결정하고 최종 구매 및 판매 신호를 사용합니다.

전략 이름은 만화 캐릭터인 조니 브라보에서 영감을 받아 자신감 있고 결정적인 거래 결정을 나타냅니다. 용어 GoGo Juice은 VWAP 라인이 20 일 지수 이동 평균을 넘을 때 공격적인 진입을 묘사합니다.

전략 원칙

매매 신호는 매출 가격이 9일 간 간편 이동 평균을 넘어서면 생성되며 매출 신호는 매출 가격이 20일 간격 이동 평균을 넘어서면 생성됩니다.

9일, 20일, 180일 이동 평균이 모두 상승하고, 9일 이동 평균이 20일 이동 평균, 20일 이동 평균이 180일 이동 평균보다 높으면 강력한 구매 신호가 생성됩니다.

만약 9일, 20일, 180일 이동 평균이 모두 하향적으로 움직이고, 9일 이동 평균이 20일 이동 평균보다 낮고, 20일 이동 평균이 180일 이동 평균보다 낮다면 강력한 판매 신호가 생성됩니다.

볼륨 가중화 평균 가격 선이 20일 지수 이동 평균을 상향으로 넘으면, GoGo Long 신호가 생성됩니다. 볼륨 가중화 평균 가격 선이 20일 지수 이동 평균을 하향으로 넘으면, GoGo Short 신호가 생성됩니다.

이점 분석

이 전략은 트렌드 추적 및 브레이크아웃 전략의 아이디어를 결합합니다. 이동 평균은 시장 트렌드의 방향을 명확하게 결정하고 잘못된 거래의 가능성을 줄일 수 있습니다. 동시에 VWAP 지표를 유연하게 사용하여 진입 시간을 결정하고 시장의 돌파구를 선호하면서 위험을 제어합니다.

이동 평균만을 사용하는 것과 비교하면 이 전략은 강력한 트렌드에서 더 높은 수익을 얻을 수 있는 공격적인 진입 메커니즘인 GoGo Juice을 추가합니다.

전체적으로 이 전략은 소액의 마이너스와 안정적인 수익성을 가지고 있습니다.

위험 분석

이 전략은 입장의 강도를 증가시키지만, 측면 시장에서 스톱 로스 포인트가 종종 유발될 수 있습니다. 또한, 이동 평균 자체는 높은 관성을 가지고 있으며 시간에 따른 가격 변화에 따라가지 못합니다.

이것은 전략이 실제로 시장 가격 움직임을 반영하지 않는 특정 수의 가상 거래를 생성 할 수 있음을 의미합니다. 또한 공격적인 입출은 손실 위험을 증가시킵니다.

위험을 줄이기 위해, 우리는 적절한 이동 평균의 주기를 조정할 수 있습니다; 또는 손실이 특정 수준에 도달하면 손실을 중지하기 위해 손실 중지 모듈을 추가합니다.

최적화 방향

이 전략은 다음과 같은 방향으로 최적화 될 수 있습니다.

  1. 이동 평균 매개 변수를 조정하고 최적의 매개 변수 조합을 찾기 위해 사이클 매개 변수를 최적화

  2. 부진적인 가격 변동의 시기에 잘못된 신호를 피하기 위해 부피 지표를 추가합니다.

  3. 스톱 로스 모듈을 늘리고 거래 손실 당 제어하는 출구 규칙을 설정합니다.

  4. 전략이 더 타겟화되도록 시장 열기 부문의 선택을 결합

  5. 개척 위치 비율을 최적화, 다른 매개 변수에 대한 다른 스케일을 최적화

결론

JBravo 양적 트렌드 전략은 이동 평균 분석과 VWAP 트렌드 판단을 통합합니다. 일정 수준의 공격적인 거래 메커니즘을 갖추면서 안정적인 장기 수익을 추구합니다. 전략은 중장기 보유에 적합하며, 중-고위 위험과 높은 수익을 제공합니다. 매우 좋은 시장 적응력을 가진 포트폴리오 거래 전략의 일부가 될 수 있습니다.

[/trans]


/*backtest
start: 2022-12-20 00:00:00
end: 2023-12-26 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/
// © bradvaughn

//@version=4
strategy("JBravo Swing", overlay = false)

var buy_in_progress = false


//Moving Averages
smaInput1 = input(title="Display SMA 9", type=input.bool, defval=true)
smaInput2 = input(title="Display EMA 20", type=input.bool, defval=true)
smaInput4 = input(title="Display SMA 180", type=input.bool, defval=true)
colored_180 = input(false, title="Color-code 180 trend direction")
vwapInput = input(title="Display VWAP", type=input.bool, defval=true)

sma9 = sma(close, 9)
ema20 = ema(close, 20)
sma180 = sma(close, 180)

//Plot Moving Averages
plot(smaInput1 ? sma9 : na, color= color.red, title="SMA 9")
plot(smaInput2 ? ema20 : na, color = color.yellow, title="EMA 20")

// Plot VWAP
vwap1 = vwap(hlc3)
plot(vwapInput ? vwap1 : na, color = color.blue, title="VWAP")
vwaplong = vwap1 > ema20
vwapshort = vwap1 < ema20

//Color SMA 180 trend direction if selected
sma180_uptrend = sma(close, 180) > sma(close[2], 180)
colr = sma180_uptrend == true or colored_180 == false ? color.white : colored_180 == true ? color.gray : na
plot(smaInput4 ? sma180 : na, color = colr, title="SMA 180")

//Get value of lower end of candle
buyLow = iff(lowest(open, 1) < lowest(close, 1), lowest(open, 1), lowest(close, 1))
sellLow = lowest(close, 1)

// Find the lower MA for crossover sell condition
sellma = iff((sma9<ema20), sma9, ema20)


//SMA 9 trend direction
sma9_uptrend = sma(close, 9) > sma(close[2], 9)
//EMA 20 trend direction
ema20_uptrend = ema(close, 20) > sma(close[2], 20)

//Buy or sell if conditions are met
// Buy when the candle low is above the SMA9
// Sell when the candle low is below the lower of SMA9 and EMA20
Buy = iff(buy_in_progress == false and buyLow > sma9 == true, true, false)
Sell = iff(buy_in_progress == true and sellLow < sellma == true, true, false)

// Determine stong buy and strong sell conditions.
// If moving averages are all up, then this will qualify a buy as a strong buy.
// If the moving averages are not up (ie. down) then this will qualify a sell as a strong sell
StrongBuy = iff (Buy and sma9_uptrend and sma180_uptrend and ema20_uptrend and (sma9 > ema20) and (ema20 > sma180), true, false)
StrongSell = iff (Sell and not sma9_uptrend and not sma180_uptrend and not ema20_uptrend and (sma9 < ema20) and (ema20 < sma180), true, false)

//Update Trading status if bought or sold
if Buy
    buy_in_progress := true
if Sell
    buy_in_progress := false
    
// Clear Buy and Sell conditions if StrongBuy or StrongSell conditions exist.  
// This disables plotting Buy and Sell conditions
if StrongBuy
    Buy := false
if StrongSell
    Sell := false
    

//Display BUY/SELL indicators

plotshape(Buy,title="Buy", color=color.green, style=shape.arrowup,location=location.belowbar, text="Buy")
plotshape(StrongBuy,title="Strong Buy", color=color.green, style=shape.arrowup,location=location.belowbar, text="Strong Buy")
plotshape(Sell,title="Sell", color=color.red, style=shape.arrowdown,text="Sell")
plotshape(StrongSell,title="Strong Sell", color=color.red, style=shape.arrowdown,text="Strong Sell")

strategy.entry("GoGo Long", strategy.long, 1, when=vwaplong and vwapInput)
strategy.entry("GoGo Short", strategy.short, 1, when=vwapshort and vwapInput)

strategy.close("GoGo Long", when = vwapshort and vwapInput)
strategy.close("GoGo Short", when = vwaplong and vwapInput)


alertcondition(Buy, title="Buy Signal", message="Buy")
alertcondition(Sell, title="Sell Signal", message="Sell")

더 많은