
यह रणनीति अलग है। जब कई सिर बंद हो जाते हैं, तो सिस्टम तुरंत खाली हो जाता है; जब खाली सिर बंद हो जाता है, तो तुरंत अधिक बदल जाता है। इस तरह के “फेस-टू-फेस-बुक” डिजाइन से रणनीति को उतार-चढ़ाव की स्थिति में भी लगातार मुनाफा हासिल करने की अनुमति मिलती है। रिवर्स पोजिशनिंग मैकेनिज्म ने पारंपरिक एकतरफा रणनीति की तुलना में लगभग 30% कम खाली पोजीशन समय दिखाया।
संख्याओं को छोटा मत समझो, 30 चक्र के औसत मूल्य के आधार पर प्रतिशत डिजाइन निश्चित अंक की तुलना में अधिक वैज्ञानिक है। 0.45% का स्टॉप लॉस सोने के लिए लगभग 8-10 डॉलर के उतार-चढ़ाव और 0.60% स्टॉप लॉस के लिए लगभग 12-15 डॉलर के अनुरूप है। रिटर्न तंत्र अधिक स्मार्ट हैः यदि पहली बार स्टॉप लॉस के बाद रिटर्न का चयन किया जाता है, तो स्टॉप लॉस का लक्ष्य 0.30 तक कम हो जाता है, और स्टॉप लॉस 0.20% तक बंद हो जाता है। यह गतिशील समायोजन रणनीति को लाभ के बाद अधिक संरक्षित बनाता है।
जब एटीआर 0.2 से कम होता है, तो रणनीति 10 मिनट के शीतलन अवधि में प्रवेश करती है और सभी नए संकेतों को अस्वीकार करती है। यह डिजाइन बहुत महत्वपूर्ण है। कम अस्थिरता वाले वातावरण में, जबरदस्ती लेनदेन के लिए पैसे भेजना बेहतर है, तो प्रतीक्षा करें। साथ ही, जब K-लाइन इकाई 5 चक्र एटीआर से 2 गुना से अधिक हो जाती है, तो रणनीति को रोक दिया जाता है, असामान्य उतार-चढ़ाव से बचने के लिए। डेटा साबित करता है कि ये दो फ़िल्टर जीत की दर को प्रभावी ढंग से बढ़ा सकते हैं।
चार K लाइन बाएं और दो K लाइन दाएं की धुरी सेटिंग, क्लासिक 5-5 मापदंडों की तुलना में अधिक कट्टरपंथी है। इसका मतलब है कि रणनीति टर्नओवर को पहले पहचानती है, लेकिन अधिक झूठी तोड़ने का जोखिम भी उठाती है। 50 चक्र औसत रेखा प्रवृत्ति फ़िल्टर के साथ, केवल बहु-ध्रुवीय निचले बिंदुओं के साथ औसत रेखा से ऊपर की कीमतें और शून्य-ध्रुवीय ऊंचाइयों के साथ औसत रेखा से नीचे की कीमतें। यह संयोजन प्रवृत्ति की स्थिति में बेहतर प्रदर्शन करता है।
रुकावट के बाद 50% की संभावना है कि स्थिति को फिर से खोला जाए, 50% की संभावना है कि यह फिर से शुरू हो जाए। यह डिजाइन दिलचस्प है, लेकिन यह भी खतरनाक है। लाभ यह है कि रुझान पलटने की शुरुआत में तेजी से टर्नओवर किया जा सकता है, नुकसान यह है कि यह नकली ब्रेकआउट में वापस आ सकता है। कोड की दृष्टि से, यह यादृच्छिकता bar_index गणना पर आधारित है, जिसमें कुछ नियमितता है। विभिन्न बाजार स्थितियों में इस तंत्र की प्रभावशीलता का परीक्षण करने की सिफारिश की गई है।
रणनीति को दो स्थितियों से सबसे ज्यादा डर लगता हैः एक बहुत ही कम उतार-चढ़ाव वाला क्रॉसओवर और एक बहुत ही उच्च उतार-चढ़ाव वाला एकतरफा परिदृश्य। पूर्व में, शीतलन तंत्र अक्सर व्यापार को रोकता है, और बाद में बड़े के-लाइन फ़िल्टर द्वारा रोका जा सकता है। सामान्य व्यापारिक वातावरण के लिए सबसे उपयुक्त है जो 15-30 डॉलर के भीतर दिन के भीतर उतार-चढ़ाव करता है। पैरामीटर सेटिंग से, यह सोने की नकदी या वायदा मात्रा के लिए अनुकूलित रणनीति की तरह है।
हालांकि एक पलटाव तंत्र है, लेकिन लगातार झूठे ब्रेकआउट सिग्नल के साथ, रणनीति को लगातार नुकसान का सामना करना पड़ सकता है। बाजार की भावना में उतार-चढ़ाव के कारण, विशेष रूप से महत्वपूर्ण आर्थिक आंकड़ों के जारी होने से पहले, धुरी सिग्नल विफल हो सकता है। एकल स्थिति पर सख्त नियंत्रण की सिफारिश की जाती है, और महत्वपूर्ण घटनाओं से पहले रणनीति को मैन्युअल रूप से निलंबित कर दिया जाता है।
/*backtest
start: 2024-09-24 00:00:00
end: 2025-09-22 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"ETH_USDT","balance":500000}]
*/
//@version=6
strategy("Gold By Ann v.2", overlay=true)
// --- Inputs ---
leftBars = input.int(4, "Pivot Lookback Left")
rightBars = input.int(2, "Pivot Lookback Right")
atrLength = input.int(14, "ATR Length")
atrMult = input.float(2.0, "ATR Multiplier")
atrThreshold = input.float(0.2, "ATR Threshold")
cooldownMinutes = input.int(10, "Cooldown Minutes")
// --- Pivot Calculation ---
ph = ta.pivothigh(leftBars, rightBars)
pl = ta.pivotlow(leftBars, rightBars)
ma = ta.sma(close, 50)
bullishTrend = close > ma
bearishTrend = close < ma
// --- Volatility (ATR) and Cooldown ---
atrValue = ta.atr(atrLength)
var float cooldownEnd = na
if atrValue < atrThreshold and na(cooldownEnd)
cooldownEnd := timenow + cooldownMinutes * 60 * 1000 // ms
if not na(cooldownEnd) and timenow > cooldownEnd
cooldownEnd := na
inCooldown = not na(cooldownEnd)
// --- Tall candle filter ---
rangeBar = high - low
isTall = rangeBar > ta.atr(5) * atrMult
// --- SL & TP based on % of 30-bar close ---
baseClose = ta.sma(close, 30) // 30-bar average close
slPercent = 0.0045 // 0.45%
tpPercent = 0.0060 // 0.60%
tpReEntryPercent = 0.006 // 0.30% (smaller TP after re-entry)
stopReEntryPercent = 0.005 // -0.20%
stopReEntryValue = baseClose * stopReEntryPercent
slValue = baseClose * slPercent
tpValue = baseClose * tpPercent
tpReValue = baseClose * tpReEntryPercent
// --- Re-entry state flag ---
var bool isReEntry = false
// --- Trade Logic (Only if NOT in cooldown) ---
if not inCooldown and not isTall
if strategy.position_size == 0
if not na(pl)
strategy.entry("PivExtLE", strategy.long, comment="Long")
isReEntry := false
if not na(ph)
strategy.entry("PivExtSE", strategy.short, comment="Short")
isReEntry := false
// =====================================================
// --- Take Profit / Stop Loss with auto-flip ---
// =====================================================
// LONG
if strategy.position_size > 0 and not isTall
entryPrice = strategy.position_avg_price
tpLevel = entryPrice + (isReEntry ? tpReValue : tpValue)
// Re-entry extra stop condition
if isReEntry and close <= entryPrice - stopReEntryValue
strategy.close("PivExtLE", comment="Stop Re-Entry Long (-0.20%)")
isReEntry := false
else if close >= tpLevel
strategy.close("PivExtLE", comment=isReEntry ? "TP Long (Re-Entry)" : "TP Long")
randChoice = (bar_index * 9301 + 49297) % 2
if randChoice == 0
strategy.entry("PivExtSE", strategy.short, comment="Flip to Short (TP)")
isReEntry := false
else
strategy.entry("PivExtLE", strategy.long, comment="Re-Enter Long (TP)")
isReEntry := true
else if close <= entryPrice - slValue
strategy.close("PivExtLE", comment="SL Long")
strategy.entry("PivExtSE", strategy.short, comment="Flip to Short (SL)")
isReEntry := false
// SHORT
if strategy.position_size < 0 and not isTall
entryPrice = strategy.position_avg_price
tpLevel = entryPrice - (isReEntry ? tpReValue : tpValue)
// Re-entry extra stop condition
if isReEntry and close >= entryPrice + stopReEntryValue
strategy.close("PivExtSE", comment="Stop Re-Entry Short (-0.20%)")
isReEntry := false
else if close <= tpLevel
strategy.close("PivExtSE", comment=isReEntry ? "TP Short (Re-Entry)" : "TP Short")
strategy.entry("PivExtLE", strategy.long, comment="Flip to Long (TP)")
isReEntry := true
else if close >= entryPrice + slValue
strategy.close("PivExtSE", comment="SL Short")
strategy.entry("PivExtLE", strategy.long, comment="Flip to Long (SL)")
isReEntry := false
// --- Plot reference ---
plot(slValue, title="SL Value (0.45% of 30-bar Close)", color=color.red)
plot(tpValue, title="TP Value (0.60% of 30-bar Close)", color=color.green)
plot(tpReValue, title="TP Value (Re-Entry 0.30%)", color=color.orange)