
概要:この戦略は,BitfinexのBTC期貨のポジションデータを使用して取引を指導する. ショートポジションの数が上がるときは空白し,ショートポジションの数が下がるときは多めにする. 智囊団取引行動を追うのに適用する.
戦略の原則:
優位分析:
リスク分析:
改善する方向:
結論から言うと この戦略は,BitfinexのBTC期貨専門トレーダーをフォローすることによって,適切なタイミングで知られた機関取引信号を実現する. 投資家は,市場の熱度を監視し,高低点を把握するのに役立ちます. また,専門トレーダーが大量に空いているときに,投資リスクを警告し,多頭ポジションを慎重に下げる必要があります. 全体的に,この戦略は,期貨取引先の位置情報の優位性を利用し,興味深い取引アイデアとして失われません. しかし,参入者優化とリスク管理は,実際の取引で安定した利益を得るためには,さらに改善する必要があります.
/*backtest
start: 2023-12-26 00:00:00
end: 2024-01-25 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Bitfinex Shorts Strat",
overlay=true,
default_qty_type=strategy.percent_of_equity,
default_qty_value=10, precision=2, initial_capital=1000,
pyramiding=2,
commission_value=0.05)
//Backtest date range
StartDate = input(timestamp("01 Jan 2021"), title="Start Date")
EndDate = input(timestamp("01 Jan 2024"), title="Start Date")
inDateRange = true
symbolInput = input(title="Bitfinex Short Symbol", defval="BTC_USDT:swap")
Shorts = request.security(symbolInput, "", open)
// RSI Input Settings
length = input(title="Length", defval=7, group="RSI Settings" )
overSold = input(title="High Shorts Threshold", defval=75, group="RSI Settings" )
overBought = input(title="Low Shorts Threshold", defval=30, group="RSI Settings" )
// Calculating RSI
vrsi = ta.rsi(Shorts, length)
RSIunder = ta.crossover(vrsi, overSold)
RSIover = ta.crossunder(vrsi, overBought)
// Stop Loss Input Settings
longLossPerc = input.float(title="Long Stop Loss (%)", defval=25, group="Stop Loss Settings") * 0.01
shortLossPerc = input.float(title="Short Stop Loss (%)", defval=25, group="Stop Loss Settings") * 0.01
// Calculating Stop Loss
longStopPrice = strategy.position_avg_price * (1 - longLossPerc)
shortStopPrice = strategy.position_avg_price * (1 + shortLossPerc)
// Strategy Entry
if (not na(vrsi))
if (inDateRange and RSIover)
strategy.entry("LONG", strategy.long, comment="LONG")
if (inDateRange and RSIunder)
strategy.entry("SHORT", strategy.short, comment="SHORT")
// Submit exit orders based on calculated stop loss price
if (strategy.position_size > 0)
strategy.exit(id="LONG STOP", stop=longStopPrice)
if (strategy.position_size < 0)
strategy.exit(id="SHORT STOP", stop=shortStopPrice)