
यह रणनीति एक ट्रेंड ट्रैकिंग और गतिशील ट्रेडिंग पर आधारित एक बुद्धिमान ट्रेडिंग सिस्टम है, जो मुख्य रूप से शॉर्ट लाइन और फास्ट ट्रेडिंग परिदृश्यों के लिए डिज़ाइन की गई है। रणनीति के केंद्र में सूचकांक चलती औसत (ईएमए) क्रॉसिंग, अपेक्षाकृत मजबूत सूचक (आरएसआई) और औसत वास्तविक तरंग (एटीआर) का संयोजन निर्णय प्रणाली है, और प्रतिशत-आधारित बुद्धिमान स्टॉप-लॉस तंत्र के साथ सुसज्जित है। यह रणनीति विशेष रूप से 1 मिनट और 5 मिनट जैसी अपेक्षाकृत छोटी अवधि के चार्ट ट्रेडिंग के लिए उपयुक्त है, जो गतिशील रूप से पैरामीटर को समायोजित करके विभिन्न बाजार स्थितियों के अनुकूल है।
रणनीति ने ट्रेडिंग सिग्नल सिस्टम के निर्माण के लिए तीन मुख्य तकनीकी मापदंडों का उपयोग कियाः
ट्रेडिंग तर्क स्पष्ट रूप से डिज़ाइन किया गया हैः मल्टीहेड प्रविष्टि को धीमी रेखा पार करने की आवश्यकता होती है, आरएसआई 70 से कम है और कीमत एटीआर गुणांक को तोड़ती है; खाली हेड प्रविष्टि को धीमी रेखा पार करने की आवश्यकता होती है, आरएसआई 30 से अधिक है और कीमत एटीआर गुणांक को तोड़ती है। सिस्टम 1% गतिशील स्टॉप-लॉस स्थिति के साथ सुसज्जित है, जो जोखिम को प्रभावी ढंग से नियंत्रित करता है।
जोखिम को कम करने के लिए, यह सलाह दी जाती हैः
यह रणनीति कई तकनीकी संकेतकों के सामंजस्यपूर्ण कार्य के माध्यम से एक पूर्ण व्यापार प्रणाली का निर्माण करती है। सिस्टम को लचीला बनाए रखते हुए, सख्त जोखिम नियंत्रण के माध्यम से व्यापार की सुरक्षा सुनिश्चित की जाती है। हालांकि कुछ सीमाएं हैं, लेकिन निरंतर अनुकूलन और सुधार के माध्यम से, इस रणनीति में अच्छा अनुप्रयोग मूल्य और विकास की क्षमता है।
/*backtest
start: 2025-02-17 10:00:00
end: 2025-02-20 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Binance","currency":"SOL_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © DBate
//@version=6
strategy("Enhanced Scalping Strategy with Stop Loss", overlay=true)
// Input parameters
fastMA_length = input.int(9, title="Fast MA Length", minval=1)
slowMA_length = input.int(21, title="Slow MA Length", minval=1)
RSI_length = input.int(14, title="RSI Length", minval=1)
RSI_overbought = input.int(70, title="RSI Overbought")
RSI_oversold = input.int(30, title="RSI Oversold")
ATR_multiplier = input.float(1.5, title="ATR Multiplier")
ATR_length = input.int(14, title="ATR Length", minval=1)
stopLossPercent = input.float(1.0, title="Stop Loss %", minval=0.1) / 100 // Convert percentage to decimal
// Timeframe-specific adjustments
is1m = timeframe.period == "1"
is5m = timeframe.period == "5"
// Adjust input parameters based on timeframe
fastMA_length := is1m ? 9 : is5m ? 12 : fastMA_length
slowMA_length := is1m ? 21 : is5m ? 26 : slowMA_length
RSI_length := is1m ? 14 : is5m ? 14 : RSI_length
// Moving Averages
fastMA = ta.ema(close, fastMA_length)
slowMA = ta.ema(close, slowMA_length)
// RSI Calculation
rsi = ta.rsi(close, RSI_length)
// ATR Calculation for volatility filter
atr = ta.atr(ATR_length)
// Trade state variables
var bool inLongTrade = false
var bool inShortTrade = false
var float entryPrice = na
var float stopLossLevel = na
// Long and Short Conditions with added filters
longCondition = ta.crossover(fastMA, slowMA) and rsi < RSI_overbought and close > fastMA + ATR_multiplier * atr
shortCondition = ta.crossunder(fastMA, slowMA) and rsi > RSI_oversold and close < fastMA - ATR_multiplier * atr
// Ensure previous trades are closed before entering new ones
if (longCondition)
strategy.close("Short")
strategy.entry("Long", strategy.long)
entryPrice := close
stopLossLevel := close * (1 - stopLossPercent) // 1% below entry for long trades
inLongTrade := true
inShortTrade := false
if (shortCondition)
strategy.close("Long")
strategy.entry("Short", strategy.short)
entryPrice := close
stopLossLevel := close * (1 + stopLossPercent) // 1% above entry for short trades
inShortTrade := true
inLongTrade := false
// Stop Loss Exits
stopLossLongCondition = inLongTrade and close <= stopLossLevel
stopLossShortCondition = inShortTrade and close >= stopLossLevel
// Exit Conditions (Moving Average crossover or Stop Loss)
exitLongCondition = inLongTrade and (ta.crossunder(fastMA, slowMA) or stopLossLongCondition)
exitShortCondition = inShortTrade and (ta.crossover(fastMA, slowMA) or stopLossShortCondition)
// Reset trade state on exit
if (exitLongCondition)
strategy.close("Long")
inLongTrade := false
inShortTrade := false
if (exitShortCondition)
strategy.close("Short")
inShortTrade := false
inLongTrade := false
// Plot buy and sell signals
plotshape(longCondition, title="Long Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="LONG")
plotshape(shortCondition, title="Short Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SHORT")
// Plot moving averages
plot(fastMA, title="Fast MA", color=color.blue, linewidth=2)
plot(slowMA, title="Slow MA", color=color.orange, linewidth=2)
// Background color for overbought/oversold RSI
bgcolor(rsi > RSI_overbought ? color.new(color.red, 90) : na, title="Overbought Background")
bgcolor(rsi < RSI_oversold ? color.new(color.green, 90) : na, title="Oversold Background")
// Alerts
alertcondition(longCondition, title="Long Alert", message="Buy Signal")
alertcondition(shortCondition, title="Short Alert", message="Sell Signal")
alertcondition(exitLongCondition, title="Exit Long Alert", message="Exit Long Signal")
alertcondition(exitShortCondition, title="Exit Short Alert", message="Exit Short Signal")