
यह रणनीति एक दोहरे समय चक्र ट्रेडिंग प्रणाली है जो सुपरट्रेंड और आरएसआई पर आधारित है। यह 120 मिनट और 15 मिनट के दो समय चक्रों के तकनीकी विश्लेषण संकेतकों को जोड़ती है, जो सुपरट्रेंड के माध्यम से मध्य-अवधि की प्रवृत्ति की दिशा को पकड़ती है, जबकि आरएसआई का उपयोग करके मुनाफा कमाता है। रणनीति एक धन प्रबंधन तंत्र का उपयोग करती है, जो प्रतिशत के आधार पर पदों को आवंटित करती है, और प्रतिशत के आधार पर स्टॉप की स्थिति निर्धारित करती है।
इस रणनीति का मूल तर्क निम्नलिखित प्रमुख तत्वों पर आधारित हैः
यह एक संरचित, तर्कसंगत और स्पष्ट प्रवृत्ति ट्रैकिंग रणनीति है। प्रवृत्ति को पकड़ने के लिए विभिन्न समय अवधि के तकनीकी संकेतकों के संयोजन के माध्यम से, जोखिम नियंत्रण पर ध्यान दें। हालांकि कुछ अनुकूलन के लिए जगह है, समग्र डिजाइन विचार मात्रात्मक व्यापार के बुनियादी सिद्धांतों के अनुरूप है। व्यापारियों को सलाह दी जाती है कि वे वास्तविक समय में उपयोग करने से पहले पैरामीटर को अनुकूलित करें और अपने जोखिम सहनशीलता के अनुसार स्थिति को समायोजित करें।
/*backtest
start: 2024-10-01 00:00:00
end: 2024-10-31 23:59:59
period: 1h
basePeriod: 1h
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/
// © felipemiransan
//@version=5
strategy("Supertrend Strategy", overlay=true)
// Function for Supertrend
supertrend(_factor, _atrPeriod) =>
[out, _] = ta.supertrend(_factor, _atrPeriod)
out
// Supertrend Settings
factor = input.float(3.42, title="Supertrend Factor")
atrPeriod = input.int(14, title="ATR Period")
tf2 = input.timeframe("120", title="Supertrend Timeframe")
// RSI Settings
rsi_tf = input.timeframe("15", title="RSI Timeframe")
rsiLength = input.int(5, title="RSI Length")
rsiUpper = input.int(95, title="RSI Upper Limit")
rsiLower = input.int(5, title="RSI Lower Limit")
// RSI Timeframe
rsi_tf_value = request.security(syminfo.tickerid, rsi_tf, ta.rsi(close, rsiLength), lookahead=barmerge.lookahead_off, gaps=barmerge.gaps_off)
// Supertrend Timeframe
supertrend_tf2 = request.security(syminfo.tickerid, tf2, supertrend(factor, atrPeriod), lookahead=barmerge.lookahead_off, gaps=barmerge.gaps_off)
// Take Profit Settings (Percentage in relation to the average price)
takeProfitPercent = input.float(30, title="Take Profit", step=0.1) / 100
// Entry conditions based on price crossover with Supertrend Timeframe
longCondition = ta.crossover(close, supertrend_tf2) and barstate.isconfirmed
shortCondition = ta.crossunder(close, supertrend_tf2) and barstate.isconfirmed
// Execution of reversal orders with closing of previous position
if (longCondition)
// Close a short position before opening a long position
if (strategy.position_size < 0)
strategy.close("Short", comment="Close Short for Long Entry")
strategy.entry("Long", strategy.long)
if (shortCondition)
// Close long position before opening short position
if (strategy.position_size > 0)
strategy.close("Long", comment="Close Long for Short Entry")
strategy.entry("Short", strategy.short)
// Calculate take profit levels relative to the average entry price
if (strategy.position_size > 0)
takeProfitLong = strategy.position_avg_price * (1 + takeProfitPercent)
strategy.exit("Take Profit Long", "Long", limit=takeProfitLong)
if (strategy.position_size > 0 and (rsi_tf_value >= rsiUpper))
strategy.close("Long", comment="RSI Take Profit Long")
if (strategy.position_size < 0)
takeProfitShort = strategy.position_avg_price * (1 - takeProfitPercent)
strategy.exit("Take Profit Short", "Short", limit=takeProfitShort)
if (strategy.position_size < 0 and (rsi_tf_value <= rsiLower))
strategy.close("Short", comment="RSI Take Profit Short")
// Plot Supertrend timeframe with commit check to avoid repainting
plot(barstate.isconfirmed ? supertrend_tf2 : na, color=color.blue, title="Supertrend Timeframe (120 min)", linewidth=1)
// Plot RSI for visualization
plot(rsi_tf_value, "RSI", color=color.purple)
hline(rsiUpper, "RSI Upper", color=color.red)
hline(rsiLower, "RSI Lower", color=color.green)