
यह रणनीति एक प्रवृत्ति तोड़ने वाली ट्रेडिंग प्रणाली है, जो तकनीकी विश्लेषण में गिरावट के रूपों पर आधारित है। यह गतिशील रूप से कीमतों में उच्च और निम्न बिंदुओं की पहचान करके एक ऊपर और नीचे की प्रवृत्ति रेखा का निर्माण करता है, और जब कीमतें प्रवृत्ति रेखा को तोड़ती हैं तो मल्टीहेड पोजीशन में प्रवेश करती हैं। रणनीति जोखिम को नियंत्रित करने और मुनाफे को लॉक करने के लिए एक गतिशील स्टॉप-स्टॉप-लॉस तंत्र का उपयोग करती है। यह एक क्लासिक तकनीकी विश्लेषण व्यापार पद्धति का एक प्रोग्राम कार्यान्वयन है, जो विशेष रूप से गिरावट की प्रवृत्ति के अंत के करीब होने पर पलटाव के अवसरों को पकड़ने के लिए उपयुक्त है।
इस रणनीति के मुख्य तर्क में निम्नलिखित प्रमुख कदम शामिल हैंः
यह एक तर्कसंगत ट्रेंड ट्रेडिंग रणनीति है, जो प्रोग्रामेटिक तरीके से पारंपरिक तकनीकी विश्लेषण विधियों को लागू करती है। रणनीति का लाभ यह है कि यह बाजार की संरचना को स्वचालित रूप से पहचानने और संभावित ट्रेंड रिवर्स के अवसरों को पकड़ने में सक्षम है। लेकिन साथ ही साथ झूठे ब्रेक और पैरामीटर अनुकूलन जैसे मुद्दों पर भी ध्यान देने की आवश्यकता है। आगे के अनुकूलन और सुधार के माध्यम से, रणनीति को वास्तविक व्यापार में बेहतर प्रदर्शन करने की उम्मीद है।
/*backtest
start: 2025-04-11 00:00:00
end: 2025-07-10 00:00:00
period: 10m
basePeriod: 10m
exchanges: [{"eid":"Binance","currency":"BTC_USDT","balance":200000}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
//@version=6
strategy("Falling Wedge Strategy by Nitin", overlay=true)
// Input parameters
leftBars = input.int(5, "Left Bars for Pivot", minval=1, maxval=20)
rightBars = input.int(5, "Right Bars for Pivot", minval=1, maxval=20)
takeProfitPercent = input.float(6, "Take Profit %", minval=0.1, maxval=100)/100
stopLossPercent = input.float(2, "Stop Loss %", minval=0.1, maxval=100)/100
// Global variables
var float buyPrice = na
// Detect pivot highs and lows
ph = ta.pivothigh(leftBars, rightBars)
pl = ta.pivotlow(leftBars, rightBars)
// Track last two pivot highs
var float[] highs = array.new_float()
var int[] highIndices = array.new_int()
if not na(ph)
array.unshift(highs, ph)
array.unshift(highIndices, bar_index[rightBars])
if array.size(highs) > 2
array.pop(highs)
array.pop(highIndices)
// Track last two pivot lows
var float[] lows = array.new_float()
var int[] lowIndices = array.new_int()
if not na(pl)
array.unshift(lows, pl)
array.unshift(lowIndices, bar_index[rightBars])
if array.size(lows) > 2
array.pop(lows)
array.pop(lowIndices)
// Calculate trendlines and detect falling wedge pattern
isFallingWedge = false
var float currentUpper = na
var float currentLower = na
if array.size(highs) >= 2 and array.size(lows) >= 2
h1 = array.get(highs, 0)
h2 = array.get(highs, 1)
i1 = array.get(highIndices, 0)
i2 = array.get(highIndices, 1)
l1 = array.get(lows, 0)
l2 = array.get(lows, 1)
j1 = array.get(lowIndices, 0)
j2 = array.get(lowIndices, 1)
m_upper = (h1 - h2) / (i1 - i2)
m_lower = (l1 - l2) / (j1 - j2)
currentUpper := h2 + m_upper * (bar_index - i2)
currentLower := l2 + m_lower * (bar_index - j2)
// Falling wedge pattern condition
isFallingWedge := h1 < h2 and l1 < l2 and m_upper < m_lower and m_upper < 0 and m_lower < 0
// Trading strategy execution
if isFallingWedge and ta.crossover(close, currentUpper) and strategy.position_size == 0
strategy.entry("Buy", strategy.long)
buyPrice := close
strategy.exit("Take Profit/Stop Loss", "Buy", stop=buyPrice * (1 - stopLossPercent), limit=buyPrice * (1 + takeProfitPercent))
// Plotting
plot(strategy.position_size > 0 ? buyPrice * (1 - stopLossPercent) : na, "Stop Loss", color=color.red, linewidth=2)
plot(strategy.position_size > 0 ? buyPrice * (1 + takeProfitPercent) : na, "Take Profit", color=color.green, linewidth=2)