
आरएसआई गतिशीलता तोड़ने की रणनीति एक बहु-समय फ्रेम क्वांटिटेटिव ट्रेडिंग रणनीति है जिसमें विलियम्स एलीगेटर और अपेक्षाकृत मजबूत आरएसआई शामिल हैं। यह रणनीति 15 मिनट की के-लाइन चक्र का उपयोग करती है, जो बाजार की प्रवृत्ति की दिशा का आकलन करने के लिए तीन मूविंग एवरेज के माध्यम से है (लिपलाइन, स्पाइकलाइन, स्पाइकलाइन), जबकि आरएसआई के साथ मिलकर गति की ताकत की पुष्टि करने के लिए एक पूर्ण आउटपुट सिग्नल सिस्टम का गठन किया जाता है। रणनीति स्पष्ट स्टॉप-लॉस और स्टॉप-बॉक्सिंग तंत्र के लिए डिज़ाइन की गई है, जो ट्रेडिंग सिग्नल की विश्वसनीयता को सुनिश्चित करने के लिए कई शर्तों के माध्यम से फ़िल्टरिंग करती है, विशेष रूप से बाजार की स्थिति के लिए उपयुक्त है जिसमें स्पष्ट रूप से प्रवृत्ति की विशेषता है।
इस रणनीति का मूल सिद्धांत विलियम शार्क सूचक की प्रवृत्ति पहचानने की क्षमता और आरएसआई सूचक की गति की पुष्टि करने की क्षमता पर आधारित है। विलियम शार्क सूचक तीन अलग-अलग चक्रों की एक चलती औसत से बना हैः स्लैब लाइन ((13 चक्र, विचलन 8), स्लैब लाइन ((8 चक्र, विचलन 5), स्लैब लाइन ((5 चक्र, विचलन 3) । जब ये तीन लाइनें स्लैब लाइन> स्लैब लाइन> स्लैब लाइन के क्रम में क्रमबद्ध होती हैं, तो यह दर्शाता है कि बाजार में एक उछाल है; इसके विपरीत, यह एक गिरावट है।
एक खरीद संकेत को ट्रिगर करने के लिए चार शर्तों को एक साथ पूरा करना आवश्यक हैः लिपलाइन से अधिक बंद, लिपलाइन से अधिक, और 55 से अधिक आरएसआई। यह बहु-फ़िल्टरिंग तंत्र सुनिश्चित करता है कि केवल ट्रेंड स्पष्ट और पर्याप्त गतिशीलता के साथ स्थिति को खोला जाए। इसके विपरीत, एक बेचने का संकेतः लिपलाइन से कम बंद, लिपलाइन से कम, और 45 से कम आरएसआई।
स्टॉप लॉस मेकानिज्म को ट्रिपल प्रोटेक्शन के लिए डिज़ाइन किया गया है: आरएसआई 50 से नीचे वापस आ जाता है, कीमत फ्लैश लाइन से नीचे गिर जाती है, या लिप लाइन फ्लैश लाइन से नीचे जाती है। स्टॉप लॉस को एक निश्चित राशि पर सेट किया जाता है (₹25) और एक स्पष्ट जोखिम-लाभ अनुपात नियंत्रण प्रदान करता है।
सबसे पहले, बहु-सूचक संलयन एक उच्च संकेत सटीकता प्रदान करता है। विलियम शार्क सूचक एक प्रवृत्ति की शुरुआत और अंत की पहचान करने में माहिर है, जबकि आरएसआई सूचक मूल्य गति को प्रभावी ढंग से मापने में सक्षम है, दोनों के संयोजन से झूठे संकेतों की संभावना को काफी कम किया जा सकता है। दूसरी, रणनीति में क्रमिक रूप से सत्यापित शर्तों का उपयोग किया जाता है, जो केवल तभी व्यापारिक संकेत उत्पन्न करता है जब सभी शर्तें एक साथ पूरी होती हैं, जिससे व्यापार की सफलता दर में काफी वृद्धि होती है।
इस रणनीति में अच्छी अनुकूलनशीलता है, जो विभिन्न बाजार स्थितियों और ट्रेडिंग किस्मों के लिए पैरामीटर समायोजन के माध्यम से अनुकूल है। 15 मिनट की समय सीमा में मध्यम और अल्पकालिक मूल्य उतार-चढ़ाव को पकड़ने के साथ-साथ अत्यधिक बार-बार ट्रेडिंग से बचा जाता है। फिक्स्ड स्टॉप तंत्र ट्रेडिंग निर्णय लेने की प्रक्रिया को सरल बनाता है और ट्रेडिंग अनुशासन को बनाए रखने में मदद करता है।
रणनीति में एक पूर्ण जोखिम प्रबंधन प्रणाली भी है, ट्रिपल स्टॉप लॉस शर्त यह सुनिश्चित करती है कि प्रतिकूल परिस्थितियों में समय पर बाहर निकलने के लिए, एक एकल व्यापार के अधिकतम नुकसान को प्रभावी ढंग से नियंत्रित किया जा सके। दृश्य ट्रेडिंग सिग्नल लोगो रणनीति को अधिक सहज और सुविधाजनक बनाने के लिए निष्पादित करता है।
इस रणनीति के मुख्य जोखिमों में ट्रेंड रिवर्स का जोखिम शामिल है। मजबूत बाजार उलटफेर के मामले में, कई संकेतक एक साथ विफल हो सकते हैं, जिससे बड़े नुकसान हो सकते हैं। विशेष रूप से अस्थिर बाजारों में, मछली के संकेतक अक्सर झूठे संकेत दे सकते हैं, और आरएसआई भी गलत रीडिंग के लिए प्रवण है।
फिक्स्ड स्टॉप मैकेनिज्म, हालांकि ऑपरेशन को सरल करता है, लेकिन मजबूत रुझानों में मुनाफे की क्षमता को भी सीमित कर सकता है। जब बाजार में निरंतर एकतरफा व्यवहार होता है, तो समय से पहले स्टॉप से अधिक मुनाफे के अवसरों को खो दिया जा सकता है। विलंबता एक और चिंता का विषय है, क्योंकि विलियम स्ट्रांग सूचकांक चलती औसत पर आधारित है, प्राकृतिक विलंबता की विशेषता है, जो समय पर प्रवेश के लिए पर्याप्त समय नहीं दे सकती है।
पैरामीटर की संवेदनशीलता भी एक जोखिम बिंदु है। आरएसआई के महत्वपूर्ण मान ((55 और 45) के साथ-साथ मछुआरे के संकेतकों के लिए आवधिक पैरामीटर को अलग-अलग बाजार स्थितियों के लिए समायोजित करने की आवश्यकता होती है, और निश्चित पैरामीटर सभी बाजार स्थितियों के लिए उपयुक्त नहीं हो सकते हैं। इसके अलावा, रणनीति व्यापार लागत के प्रति संवेदनशील होती है, और बार-बार आने और जाने से प्रभार और स्लाइडिंग बिंदुओं द्वारा कमाई को खाई जा सकती है।
गतिशील पैरामीटर समायोजन एक महत्वपूर्ण अनुकूलन दिशा है। एक अनुकूलन तंत्र को पेश किया जा सकता है जो आरएसआई के थ्रेशोल्ड को स्वचालित रूप से बाजार में उतार-चढ़ाव के आधार पर समायोजित करता है। उदाहरण के लिए, उच्च अस्थिरता वाले वातावरण में आरएसआई थ्रेशोल्ड को बढ़ाएं और कम अस्थिरता वाले वातावरण में थ्रेशोल्ड को कम करें, विभिन्न बाजार स्थितियों के अनुकूल।
स्टॉपबॉक्स को एक निश्चित राशि से एक गतिशील स्टॉपबॉक्स में बदल दिया जा सकता है, जैसे कि एटीआर (औसत वास्तविक लहर) के गुणक को स्टॉपबॉक्स के लक्ष्य के रूप में, ताकि बाजार की अस्थिरता को बेहतर ढंग से समायोजित किया जा सके। ट्रेडिंग स्टॉप को लागू करने पर भी विचार किया जा सकता है, जो एक निश्चित स्तर तक पहुंचने के बाद ट्रेडिंग स्टॉपबॉक्स को लॉन्च करता है ताकि अधिक ट्रेंडिंग लाभों को पकड़ सके।
बाजार के माहौल के फिल्टर को जोड़ना एक और अनुकूलन दिशा है। यह निर्धारित करने के लिए कि क्या वर्तमान बाजार रणनीति के लिए उपयुक्त है, बाजार की ताकत या अस्थिरता के संकेतकों को पेश किया जा सकता है, और प्रतिकूल बाजार के माहौल में व्यापार को रोक दिया जा सकता है। समय फिल्टर भी महत्वपूर्ण है, कम तरलता के समय व्यापार करने से बचें।
सिग्नल पुष्टि तंत्र को और अधिक मजबूत किया जा सकता है। लेन-देन की पुष्टि को जोड़ा जा सकता है, सिग्नल को केवल लेन-देन की मात्रा में वृद्धि के मामले में प्रभावी रूप से पुष्टि की जा सकती है। उच्च समय सीमा में प्रवृत्ति की दिशा की पुष्टि करने के बाद, कम समय सीमा में विशिष्ट प्रवेश बिंदु खोजने के लिए बहु-समय सीमा विश्लेषण पर विचार किया जा सकता है।
विलियम शार्क RSI गतिशीलता तोड़ने की रणनीति एक अपेक्षाकृत अच्छी तरह से डिजाइन की गई मात्रात्मक ट्रेडिंग प्रणाली है, जिसमें बहु-सूचक एकीकरण और सख्त शर्तों के फ़िल्टरिंग के माध्यम से ट्रेंडिंग बाजारों में बेहतर प्रदर्शन करने की क्षमता है। रणनीति का मुख्य लाभ इसकी व्यवस्थित जोखिम प्रबंधन और स्पष्ट सिग्नल जनरेशन तंत्र में है, जो व्यापारियों को अपेक्षाकृत स्थिर ट्रेडिंग फ्रेमवर्क प्रदान करने में सक्षम है।
हालांकि, इस रणनीति में कुछ सीमाएं भी हैं, विशेष रूप से अस्थिर बाजारों में प्रदर्शन आदर्श नहीं हो सकता है, और निश्चित पैरामीटर सेटिंग सभी बाजार स्थितियों के अनुकूल नहीं हो सकती है। गतिशील पैरामीटर समायोजन, स्टॉपबॉक्स तंत्र में सुधार और बाजार की स्थिति फ़िल्टर जोड़ने जैसे अनुकूलन उपायों को पेश करके रणनीति की अनुकूलन और लाभप्रदता को और बढ़ाया जा सकता है।
इस रणनीति का उपयोग करने वाले व्यापारियों के लिए, विभिन्न बाजार स्थितियों में पर्याप्त फीडबैक और प्रयोगशाला सत्यापन की सिफारिश की जाती है, और वास्तविक प्रदर्शन के आधार पर पैरामीटर को उचित रूप से समायोजित किया जाता है। साथ ही, अच्छे धन प्रबंधन और व्यापार अनुशासन को बनाए रखना रणनीति के सफल कार्यान्वयन का एक महत्वपूर्ण तत्व है।
||
The Williams Alligator RSI Momentum Breakout Strategy is a comprehensive quantitative trading system that integrates the Williams Alligator indicator with the Relative Strength Index (RSI) across multiple timeframes. This strategy operates on 15-minute candlestick intervals, utilizing the Alligator indicator’s three moving average lines (Lips, Teeth, Jaw) to determine market trend direction while incorporating RSI to confirm momentum strength, creating a complete entry and exit signal framework. The strategy features clear stop-loss and take-profit mechanisms with multiple condition filtering to ensure signal reliability, making it particularly suitable for markets with distinct trending characteristics.
The core principle of this strategy is based on the Williams Alligator indicator’s trend identification capabilities combined with RSI’s momentum confirmation function. The Williams Alligator consists of three moving averages with different periods: Jaw (13-period, offset 8), Teeth (8-period, offset 5), and Lips (5-period, offset 3). When these three lines align in the sequence Lips > Teeth > Jaw, it indicates an uptrend; the reverse suggests a downtrend.
Long signals require four simultaneous conditions: closing price above Lips, Lips above Teeth, Teeth above Jaw, and RSI above 55. This multi-layer filtering mechanism ensures positions are only opened when both trend clarity and sufficient momentum are present. Short signals operate inversely: closing price below Lips, Lips below Teeth, Teeth below Jaw, and RSI below 45.
The stop-loss mechanism incorporates triple protection: RSI falling below 50, price crossing below Teeth, or Lips dropping below Teeth. The take-profit is set at a fixed amount (25 rupees), providing clear risk-reward ratio control.
Firstly, the multi-indicator fusion provides enhanced signal accuracy. The Williams Alligator excels at identifying trend beginnings and endings, while RSI effectively measures price momentum; their combination significantly reduces false signal probability. Secondly, the strategy employs progressive condition verification, generating trading signals only when all conditions are simultaneously satisfied, substantially improving trade success rates.
The strategy demonstrates good adaptability, allowing parameter adjustments to suit different market environments and trading instruments. The 15-minute timeframe captures medium-term price fluctuations while avoiding excessive trading frequency. The fixed take-profit mechanism simplifies trading decisions and helps maintain trading discipline.
The strategy also features a comprehensive risk management system where triple stop-loss conditions ensure timely exits during adverse situations, effectively controlling maximum loss per trade. Visual trading signal identification makes strategy execution more intuitive and convenient.
The primary risks include trend reversal risk. During strong market reversals, multiple indicators may fail simultaneously, leading to significant losses. Particularly in oscillating markets, the Alligator indicator may generate frequent false signals, while RSI can produce misleading readings during sideways consolidation phases.
While the fixed take-profit mechanism simplifies operations, it may limit profit potential during strong trending moves. During sustained directional markets, premature profit-taking might miss larger profit opportunities. Lag is another concern, as the Williams Alligator’s moving average foundation creates natural delay characteristics, potentially causing suboptimal entry timing.
Parameter sensitivity presents additional risk. RSI threshold values (55 and 45) and Alligator period parameters require adjustment for different market environments; fixed parameters may not suit all market conditions. Furthermore, the strategy is sensitive to trading costs, where frequent entries and exits might erode returns through commissions and slippage.
Dynamic parameter adjustment represents a crucial optimization direction. Implementing adaptive mechanisms to automatically adjust RSI thresholds and Alligator parameters based on market volatility could improve performance. For instance, raising RSI thresholds in high-volatility environments while lowering them in low-volatility conditions would better adapt to varying market conditions.
The take-profit mechanism could evolve from fixed amounts to dynamic targets, such as using ATR (Average True Range) multiples as profit objectives, better accommodating market volatility characteristics. Implementing trailing take-profits could also be considered, activating trailing stops after reaching certain profit levels to capture larger trend-based gains.
Adding market environment filters represents another optimization avenue. Introducing market strength indicators or volatility measures to assess current market suitability for the strategy could pause trading during unfavorable conditions. Time filters are equally important, avoiding trades during low-liquidity periods.
Signal confirmation mechanisms warrant further strengthening. Volume confirmation could be added, validating signals only during volume expansion. Multi-timeframe analysis could also be considered, confirming trend direction on higher timeframes before seeking specific entry points on lower timeframes.
The Williams Alligator RSI Momentum Breakout Strategy is a relatively well-designed quantitative trading system that, through multi-indicator integration and strict condition filtering, demonstrates good performance potential in trending markets. The strategy’s main advantages lie in its systematic risk management and clear signal generation mechanisms, providing traders with a relatively stable trading framework.
However, the strategy has limitations, particularly potential underperformance in oscillating markets, where fixed parameter settings may not adapt to all market environments. Through dynamic parameter adjustment, improved take-profit mechanisms, and additional market environment filtering, the strategy’s adaptability and profitability can be further enhanced.
For traders implementing this strategy, thorough backtesting and live trading verification across different market environments is recommended, with appropriate parameter adjustments based on actual performance. Maintaining proper money management and trading discipline remains crucial for successful strategy implementation.[/trans]“`
/*backtest
start: 2025-01-01 00:00:00
end: 2025-08-18 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_OKX","currency":"DOGE_USDT","balance":5000}]
*/
//@version=5
strategy("Crude Oil Alligator RSI Strategy", overlay=true)
// =====================================
// INPUTS
// =====================================
// Williams Alligator Settings (default)
jaw_length = input.int(13, title="Jaw Length", minval=1)
jaw_offset = input.int(8, title="Jaw Offset", minval=0)
teeth_length = input.int(8, title="Teeth Length", minval=1)
teeth_offset = input.int(5, title="Teeth Offset", minval=0)
lips_length = input.int(5, title="Lips Length", minval=1)
lips_offset = input.int(3, title="Lips Offset", minval=0)
// RSI Settings (default)
rsi_length = input.int(14, title="RSI Length", minval=1)
// Crude Oil tick size (typically 0.01)
tick_size = input.float(0.01, title="Tick Size", minval=0.001, step=0.001)
// Take Profit in Rupees
take_profit_rupees = input.float(25.0, title="Take Profit (Rupees)", minval=0.1, step=0.1)
// =====================================
// INDICATORS
// =====================================
// Williams Alligator
jaw = ta.sma(hl2, jaw_length)[jaw_offset]
teeth = ta.sma(hl2, teeth_length)[teeth_offset]
lips = ta.sma(hl2, lips_length)[lips_offset]
// RSI
rsi = ta.rsi(close, rsi_length)
// =====================================
// PLOT INDICATORS
// =====================================
plot(jaw, "Alligator Jaw", color=color.blue, linewidth=2)
plot(teeth, "Alligator Teeth", color=color.red, linewidth=2)
plot(lips, "Alligator Lips", color=color.green, linewidth=2)
// RSI (plotted in separate pane)
hline(50, "RSI Mid Line", color=color.gray, linestyle=hline.style_dashed)
hline(55, "RSI Buy Level", color=color.green, linestyle=hline.style_dotted)
hline(45, "RSI Sell Level", color=color.red, linestyle=hline.style_dotted)
plot(rsi, "RSI", color=color.purple)
// =====================================
// STRATEGY CONDITIONS
// =====================================
// Buy Conditions
buy_condition_1 = close > lips
buy_condition_2 = lips > teeth
buy_condition_3 = teeth > jaw
buy_condition_4 = rsi > 55
buy_signal = buy_condition_1 and buy_condition_2 and buy_condition_3 and buy_condition_4
// Sell Conditions
sell_condition_1 = close < lips
sell_condition_2 = lips < teeth
sell_condition_3 = teeth < jaw
sell_condition_4 = rsi < 45
sell_signal = sell_condition_1 and sell_condition_2 and sell_condition_3 and sell_condition_4
// Stop Loss Conditions for Long Position
long_stop_condition_1 = rsi < 50
long_stop_condition_2 = ta.crossunder(close, teeth)
long_stop_condition_3 = lips < teeth
long_stop_loss = long_stop_condition_1 or long_stop_condition_2 or long_stop_condition_3
// Stop Loss Conditions for Short Position
short_stop_condition_1 = rsi > 50
short_stop_condition_2 = ta.crossover(close, teeth)
short_stop_condition_3 = lips > teeth
short_stop_loss = short_stop_condition_1 or short_stop_condition_2 or short_stop_condition_3
// =====================================
// STRATEGY EXECUTION
// =====================================
// Variables to track entry prices
var float long_entry_price = na
var float short_entry_price = na
// Long Entry
if buy_signal and strategy.position_size == 0
strategy.entry("Long", strategy.long)
long_entry_price := close
alert("Buy Signal Generated - Crude Oil", alert.freq_once_per_bar)
// Short Entry
if sell_signal and strategy.position_size == 0
strategy.entry("Short", strategy.short)
short_entry_price := close
alert("Sell Signal Generated - Crude Oil", alert.freq_once_per_bar)
// Long Exit Conditions
if strategy.position_size > 0
// Take Profit: 25 Rupees above entry
long_take_profit = long_entry_price + take_profit_rupees
if close >= long_take_profit
strategy.close("Long", comment="Take Profit")
alert("Take Profit - Long Position Closed - Crude Oil", alert.freq_once_per_bar)
long_entry_price := na
// Stop Loss
if long_stop_loss
strategy.close("Long", comment="Stop Loss")
alert("Stop Loss - Long Position Closed - Crude Oil", alert.freq_once_per_bar)
long_entry_price := na
// Short Exit Conditions
if strategy.position_size < 0
// Take Profit: 25 Rupees below entry
short_take_profit = short_entry_price - take_profit_rupees
if close <= short_take_profit
strategy.close("Short", comment="Take Profit")
alert("Take Profit - Short Position Closed - Crude Oil", alert.freq_once_per_bar)
short_entry_price := na
// Stop Loss
if short_stop_loss
strategy.close("Short", comment="Stop Loss")
alert("Stop Loss - Short Position Closed - Crude Oil", alert.freq_once_per_bar)
short_entry_price := na
// =====================================
// CHART LABELS AND ALERTS
// =====================================
// Buy Signal Label
if buy_signal and strategy.position_size == 0
label.new(bar_index, low - (high - low) * 0.1, "BUY\nSIGNAL", color=color.green, style=label.style_label_up, textcolor=color.white, size=size.small)
// Sell Signal Label
if sell_signal and strategy.position_size == 0
label.new(bar_index, high + (high - low) * 0.1, "SELL\nSIGNAL", color=color.red, style=label.style_label_down, textcolor=color.white, size=size.small)
// Stop Loss Labels
if strategy.position_size > 0 and long_stop_loss
label.new(bar_index, high + (high - low) * 0.1, "STOP\nLOSS", color=color.orange, style=label.style_label_down, textcolor=color.white, size=size.small)
if strategy.position_size < 0 and short_stop_loss
label.new(bar_index, low - (high - low) * 0.1, "STOP\nLOSS", color=color.orange, style=label.style_label_up, textcolor=color.white, size=size.small)
// Take Profit Labels
if strategy.position_size > 0 and not na(long_entry_price) and close >= (long_entry_price + take_profit_rupees)
label.new(bar_index, high + (high - low) * 0.1, "TAKE\nPROFIT", color=color.blue, style=label.style_label_down, textcolor=color.white, size=size.small)
if strategy.position_size < 0 and not na(short_entry_price) and close <= (short_entry_price - take_profit_rupees)
label.new(bar_index, low - (high - low) * 0.1, "TAKE\nPROFIT", color=color.blue, style=label.style_label_up, textcolor=color.white, size=size.small)
// =====================================
// TAKE PROFIT LEVEL LINES
// =====================================
// Plot take profit levels when in position
var line long_tp_line = na
var line short_tp_line = na
if strategy.position_size > 0 and not na(long_entry_price)
if not na(long_tp_line)
line.delete(long_tp_line)
long_tp_line := line.new(bar_index - 10, long_entry_price + take_profit_rupees, bar_index + 10, long_entry_price + take_profit_rupees, color=color.blue, style=line.style_dashed, width=2)
if strategy.position_size < 0 and not na(short_entry_price)
if not na(short_tp_line)
line.delete(short_tp_line)
short_tp_line := line.new(bar_index - 10, short_entry_price - take_profit_rupees, bar_index + 10, short_entry_price - take_profit_rupees, color=color.blue, style=line.style_dashed, width=2)
// Clean up lines when position is closed
if strategy.position_size == 0
if not na(long_tp_line)
line.delete(long_tp_line)
long_tp_line := na
if not na(short_tp_line)
line.delete(short_tp_line)
short_tp_line := na
// =====================================
// TABLE FOR CURRENT CONDITIONS
// =====================================
var table info_table = table.new(position.top_right, 2, 10, bgcolor=color.white, border_width=1)
if barstate.islast
table.cell(info_table, 0, 0, "Condition", bgcolor=color.gray, text_color=color.white)
table.cell(info_table, 1, 0, "Status", bgcolor=color.gray, text_color=color.white)
table.cell(info_table, 0, 1, "Close > Lips", bgcolor=color.white)
table.cell(info_table, 1, 1, buy_condition_1 ? "✓" : "✗", text_color=buy_condition_1 ? color.green : color.red)
table.cell(info_table, 0, 2, "Lips > Teeth", bgcolor=color.white)
table.cell(info_table, 1, 2, buy_condition_2 ? "✓" : "✗", text_color=buy_condition_2 ? color.green : color.red)
table.cell(info_table, 0, 3, "Teeth > Jaw", bgcolor=color.white)
table.cell(info_table, 1, 3, buy_condition_3 ? "✓" : "✗", text_color=buy_condition_3 ? color.green : color.red)
table.cell(info_table, 0, 4, "RSI > 55", bgcolor=color.white)
table.cell(info_table, 1, 4, buy_condition_4 ? "✓" : "✗", text_color=buy_condition_4 ? color.green : color.red)
table.cell(info_table, 0, 5, "RSI < 45", bgcolor=color.white)
table.cell(info_table, 1, 5, sell_condition_4 ? "✓" : "✗", text_color=sell_condition_4 ? color.red : color.green)
table.cell(info_table, 0, 6, "Current RSI", bgcolor=color.white)
table.cell(info_table, 1, 6, str.tostring(math.round(rsi, 2)), text_color=color.black)
table.cell(info_table, 0, 7, "Position", bgcolor=color.white)
position_text = strategy.position_size > 0 ? "LONG" : strategy.position_size < 0 ? "SHORT" : "NONE"
position_color = strategy.position_size > 0 ? color.green : strategy.position_size < 0 ? color.red : color.gray
table.cell(info_table, 1, 7, position_text, text_color=position_color)
table.cell(info_table, 0, 8, "Entry Price", bgcolor=color.white)
entry_text = strategy.position_size > 0 and not na(long_entry_price) ? str.tostring(long_entry_price, "#.##") : strategy.position_size < 0 and not na(short_entry_price) ? str.tostring(short_entry_price, "#.##") : "N/A"
table.cell(info_table, 1, 8, entry_text, text_color=color.black)
table.cell(info_table, 0, 9, "Take Profit", bgcolor=color.white)
tp_text = strategy.position_size > 0 and not na(long_entry_price) ? str.tostring(long_entry_price + take_profit_rupees, "#.##") : strategy.position_size < 0 and not na(short_entry_price) ? str.tostring(short_entry_price - take_profit_rupees, "#.##") : "N/A"
table.cell(info_table, 1, 9, tp_text, text_color=color.blue)