
フィボナッチ金分割逆戻り買入戦略は,フィボナッチ逆戻りレベルとトレンドトラッキングストップをベースにした取引戦略である.この戦略は,フィボナッチ逆戻りレベルを潜在的サポートとレジスタンスとして使用し,トレンドトラッキングストップと組み合わせて,買入と売却のタイミングを決定する.価格が上昇傾向で特定のフィボナッチレベルに逆戻りし,トレンドトラッキングストップを超えると,戦略は買入シグナルを発信する.価格がトレンドトラッキングストップまたは特定のフィボナッチレベルを破ると,戦略は販売シグナルを発信する.
フィボナッチ・ゴールド・スプリング・レトロ・バイ・ストラテジーは,フィボナッチ・レトロ・レベルとトレンド・トラッキング・ストップ・ローズを組み合わせた取引戦略である.この戦略は,フィボナッチ・レトロ・レベルを潜在的サポートとレジスタンスとして利用し,トレンド・トラッキング・ストップ・ローズと組み合わせて,買入と売却のタイミングを決定する.この戦略の優点は,技術分析とトレンド・トラッキングを組み合わせて,異なる市場状況に適応し,明確な入場と出場条件を提供することにある.しかし,戦略は,市場変動のリスク,パラメータ設定のリスク,トレンド識別のリスクにも直面している.戦略のパフォーマンスを最適化するために,他の技術指標,動態調整パラメータ,およびリスク管理の導入を考慮することができる.
/*backtest
start: 2023-04-23 00:00:00
end: 2024-04-28 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy(title='Fibonacci BFSP', overlay=true)
// Define Fibonacci retracement levels
fib0 = input(0, title="Fibonacci 0% Level")
fib1 = input(1, title="Fibonacci 1% Level")
fib23 = input(0.236, title="Fibonacci 23.6% Level")
fib38 = input(0.382, title="Fibonacci 38.2% Level")
fib50 = input(0.5, title="Fibonacci 50% Level")
fib61 = input(0.618, title="Fibonacci 61.8% Level")
fib78 = input(0.786, title="Fibonacci 78.6% Level")
Price = input(50, title="Price")
// Calculate Fibonacci levels
priceHigh = ta.highest(high, Price)
priceLow = ta.lowest(low, Price)
priceRange = priceHigh - priceLow
fibRetracement0 = priceHigh - fib0 * priceRange
fibRetracement1 = priceHigh - fib1 * priceRange
fibRetracement23 = priceHigh - fib23 * priceRange
fibRetracement38 = priceHigh - fib38 * priceRange
fibRetracement50 = priceHigh - fib50 * priceRange
fibRetracement61 = priceHigh - fib61 * priceRange
fibRetracement78 = priceHigh - fib78 * priceRange
// Plot Fibonacci retracement levels
plot(fibRetracement0, color=color.gray, linewidth=2)
plot(fibRetracement1, color=color.gray, linewidth=2)
plot(fibRetracement23, color=color.green, linewidth=2)
plot(fibRetracement38, color=color.olive, linewidth=2)
plot(fibRetracement50, color=color.white, linewidth=2)
plot(fibRetracement61, color=color.orange, linewidth=2)
plot(fibRetracement78, color=color.red, linewidth=2)
// Inputs
no = input(1, title="Swing")
// Calculate swing highs and lows
res = ta.highest(high, no)
sup = ta.lowest(low, no)
// Calculate trailing stop loss
avd = close > res[1] ? 1 : close < sup[1] ? -1 : 0
avn = ta.valuewhen(avd != 0, avd, 0)
tsl = avn == 1 ? sup : res
// Define buy and sell conditions
buyCondition = (close > tsl) and (close > fibRetracement23 or close > fibRetracement38 or close > fibRetracement50 or close > fibRetracement61 or close > fibRetracement78)
sellCondition = (close < tsl) and (close < fibRetracement23 or close < fibRetracement38 or close < fibRetracement50 or close < fibRetracement61 or close < fibRetracement78)
// Entry strategy
if (buyCondition)
strategy.entry("Buy", strategy.long)
// Exit strategy
if (sellCondition)
strategy.close("Buy")
// Color bars based on buy and sell conditions
barColor = buyCondition ? color.green : sellCondition ? color.red : na
barcolor(barColor)