이 전략은 두 개의 서로 다른 시장 사이의 가격 관계를 활용하여 30 분 시간 동안의 시장 A의 변화를 모니터링하여 시장 A의 눈에 띄는 변화를 식별하고 시장 B에서 대응 거래를 유발합니다. 시장 A가 0.1% 또는 그 이상의 하락하면 전략은 시장 B에서 공백 포지션을 설정합니다. 시장 A가 0.1% 또는 그 이상의 상승하면 전략은 시장 B에서 다중 포지션을 설정합니다. 이 전략은 또한 사용자가 위험 관리 및 수익 목표를 최적화하기 위해 스톱 및 스톱 손실 비율을 사용자 정의 할 수 있습니다.
이 전략의 핵심 원칙은 두 시장 가격 사이의 부정적인 상관 관계를 이용하는 것입니다. 역사적인 데이터는 시장 A와 시장 B의 가격 사이에 평균 -0.6의 부정적인 상관 관계가 있음을 보여줍니다. 이것은 시장 A가 떨어지면 시장 B의 가격이 상승하는 것을 의미합니다. 반대로. 이 전략은 시장 A의 변화를 30 분 시간 동안 모니터링하여 시장 A의 눈에 띄는 변화를 포착하고 시장 B에 대응하는 위치를 구축합니다. 구체적으로, 시장 A가 0.1% 이상 떨어지면 전략은 시장 B에 공백 위치를 구축합니다. 시장 A가 0.1% 이상 상승하면 전략은 시장 B에 다중 위치를 구축합니다.
이 전략은 두 시장 가격 사이의 부정적인 상관관계를 활용하여 시장 A의 눈에 띄는 변화를 모니터링하여 시장 B에 대응하는 입지를 구축한다. 이 전략의 장점은 시장 간의 관계를 활용하여 거래 기회를 제공하는 것과 동시에 사용자가 위험 관리 및 수익 목표를 사용자 정의 할 수 있다는 것입니다. 그러나 이 전략에는 연관성의 안정성, 고정 하락의 제한 등과 같은 몇 가지 위험이 있습니다.
/*backtest
start: 2024-05-01 00:00:00
end: 2024-05-31 23:59:59
period: 4h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Kingcoinmilioner
//@version=5
strategy("DXY/BTC Arbitrage Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// Input for Take Profit and Stop Loss
tp_percent = input.float(1.0, title="Take Profit (%)")
sl_percent = input.float(1.0, title="Stop Loss (%)")
// Fetching DXY data on a 4-hour interval
dxy = request.security("BTC_USDT:swap", "30", close)
dxy_open = request.security("BTC_USDT:swap", "30", open)
// Calculate the price change percentage
price_change_percent = (dxy - dxy_open) / dxy_open * 100
// Plot the price change percentage on the chart
plot(price_change_percent, title="DXY 4-hour Price Change (%)", color=color.blue, linewidth=2)
// Define trade entry conditions
short_condition = price_change_percent <= -0.1
long_condition = price_change_percent >= 0.1
// Initiate short BTC if DXY has a red candle of -0.1%
if (short_condition)
strategy.entry("Short BTC", strategy.short)
// Setting Take Profit and Stop Loss for short
strategy.exit("Take Profit/Stop Loss Short", "Short BTC", limit=close * (1 - tp_percent / 100), stop=close * (1 + sl_percent / 100))
// Initiate long BTC if DXY has a green candle of 0.1%
if (long_condition)
strategy.entry("Long BTC", strategy.long)
// Setting Take Profit and Stop Loss for long
strategy.exit("Take Profit/Stop Loss Long", "Long BTC", limit=close * (1 + tp_percent / 100), stop=close * (1 - sl_percent / 100))
// Visualization
bgcolor(short_condition ? color.new(color.red, 90) : na, title="Short BTC Signal")
bgcolor(long_condition ? color.new(color.green, 90) : na, title="Long BTC Signal")