
यह रणनीति एक स्टोचैस्टिक ऑस्सिलेटर पर आधारित एक बहु-समय फ्रेम वेव ट्रेडिंग सिस्टम है। यह ट्रेडिंग के अवसरों को निर्धारित करने के लिए वर्तमान समय फ्रेम और उच्चतर समय फ्रेम के यादृच्छिक संकेतक संकेतों के संयोजन के माध्यम से और जोखिम को प्रबंधित करने के लिए गतिशील स्टॉप लॉस का उपयोग करता है। यह रणनीति अत्यधिक अस्थिरता वाले बाजारों के लिए उपयुक्त है, जो कीमतों में अल्पकालिक उतार-चढ़ाव को पकड़कर लाभ प्राप्त करते हैं।
रणनीति का मूल तर्क निम्नलिखित प्रमुख तत्वों पर आधारित है:
यह तकनीकी विश्लेषण और जोखिम प्रबंधन के संयोजन के साथ एक पूर्ण ट्रेडिंग प्रणाली है। रणनीति में स्थिरता की गारंटी के साथ-साथ कई समय के फ्रेम पर सिग्नल की पुष्टि और गतिशील स्टॉप-लॉस के माध्यम से बेहतर रिटर्न क्षमता है। हालांकि, उपयोगकर्ताओं को अपनी ट्रेडिंग शैली और बाजार की स्थिति के अनुसार पैरामीटर को अनुकूलित करने की आवश्यकता होती है, और हमेशा सख्त जोखिम नियंत्रण बनाए रखना पड़ता है।
/*backtest
start: 2024-02-21 00:00:00
end: 2025-02-18 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Swing Fairas Oil", overlay=true)
// Input parameters
kLength = input(14, title="Stochastic K Length")
dLength = input(3, title="Stochastic D Length")
smoothK = input(3, title="Smooth K")
tfHigher = input.timeframe("30", title="Higher Timeframe")
takeProfit = input(1.7, title="Take Profit Multiplier")
stopLoss = input(1.7, title="Stop Loss Multiplier")
// Calculate Stochastic Oscillator for current timeframe
k = ta.sma(ta.stoch(close, high, low, kLength), smoothK)
d = ta.sma(k, dLength)
// Calculate Stochastic Oscillator for higher timeframe
kHTF = request.security(syminfo.tickerid, tfHigher, ta.sma(ta.stoch(close, high, low, kLength), smoothK))
dHTF = request.security(syminfo.tickerid, tfHigher, ta.sma(kHTF, dLength))
// Buy and sell conditions (confirmation from two timeframes)
buyCondition = ta.crossover(k, d) and k < 20 and kHTF < 20 and kHTF > dHTF
sellCondition = ta.crossunder(k, d) and k > 80 and kHTF > 80 and kHTF < dHTF
// Define Take Profit and Stop Loss levels
longStopLoss = close * (1 - stopLoss / 100)
longTakeProfit = close * (1 + takeProfit / 100)
shortStopLoss = close * (1 + stopLoss / 100)
shortTakeProfit = close * (1 - takeProfit / 100)
// Execute Trades
if buyCondition
strategy.entry("Long", strategy.long)
strategy.exit("Long Exit", from_entry="Long", limit=longTakeProfit, stop=longStopLoss)
if sellCondition
strategy.entry("Short", strategy.short)
strategy.exit("Short Exit", from_entry="Short", limit=shortTakeProfit, stop=shortStopLoss)
// Plot buy/sell signals on candlestick chart
plotshape(series=buyCondition, location=location.belowbar, color=color.green, style=shape.labelup, size=size.small, title="Buy Signal")
plotshape(series=sellCondition, location=location.abovebar, color=color.red, style=shape.labeldown, size=size.small, title="Sell Signal")
// Highlight candles for buy and sell conditions
barcolor(buyCondition ? color.green : sellCondition ? color.red : na)
// Draw Take Profit and Stop Loss levels dynamically with labels
var float tpLevel = na
var float slLevel = na
if buyCondition
tpLevel := longTakeProfit
slLevel := longStopLoss
if sellCondition
tpLevel := shortTakeProfit
slLevel := shortStopLoss