
[trans]
Chiến lược giao dịch đa chiều với hệ thống chỉ số Fibonacci động là một chiến lược giao dịch dựa trên phân tích kỹ thuật, chủ yếu sử dụng các chỉ số đa dạng như điểm trung tâm trong ngày, khoảng trung tâm (CPR), mức thu hồi Fibonacci, trung bình trọng lượng giao dịch (VWAP) và đường trung bình di chuyển để xác định cơ hội mua và bán tiềm năng. Chiến lược này phù hợp với các nhà giao dịch trong ngày, đặc biệt đối với giao dịch ngắn trên biểu đồ đường K 3 phút. Chiến lược này tập trung vào việc xác định xem đường K có tiếp xúc với mức hỗ trợ và kháng cự quan trọng trong một điều kiện cụ thể hay không, để kích hoạt tín hiệu giao dịch.
Chiến lược này sử dụng hệ thống điểm trung tâm tính toán giá cao, giá thấp và giá đóng cửa hàng ngày, kết hợp với giá trung bình cân bằng khối lượng giao dịch (VWAP) và VWAP di động (MVWAP) làm tham chiếu kháng cự hỗ trợ động. Đồng thời, xây dựng một hệ thống quyết định giao dịch toàn diện thông qua các chỉ số kỹ thuật như chỉ số tương đối mạnh (RSI), đường trung bình di chuyển đơn giản (SMA) và đường trung bình di chuyển chỉ số (EMA).
Chiến lược này đầu tiên xác định các đường K màu xanh lá cây (lên) và đỏ (xuống) phù hợp, sau đó đánh giá xem các đường K này có chạm vào các mức giá quan trọng không, chẳng hạn như điểm pivot, mức hỗ trợ, mức kháng cự hoặc VWAP. Khi đường K màu đỏ chạm vào mức giá quan trọng, nó sẽ kích hoạt tín hiệu mua (CE); khi đường K màu xanh lá cây chạm vào mức giá quan trọng, nó sẽ kích hoạt tín hiệu bán (PE).
Nguyên tắc của chiến lược này dựa trên hành vi của thị trường xung quanh sự biến động của giá xung quanh mức hỗ trợ và kháng cự quan trọng, kết hợp hình dạng đường K, khối lượng giao dịch và các chỉ số động lực để đưa ra quyết định giao dịch. Phân tích cơ bản cụ thể như sau:
Cơ chế nhận dạng K-line:
Hệ thống tính toán điểm trung tâm:
Động thái giá tham khảo:
Hệ thống chỉ số hỗ trợ:
Tạo tín hiệu giao dịch:
Ý tưởng cốt lõi của chiến lược là nắm bắt sự đảo ngược tiềm năng của giá gần mức kháng cự hỗ trợ quan trọng, lọc thông qua hình dạng đường K cụ thể và nhiều chỉ số kỹ thuật để tăng hiệu quả tín hiệu. Các đường K chạm vào các điểm trung tâm thường đại diện cho khả năng tăng của thị trường ở những mức giá quan trọng.
Một phân tích sâu hơn về mã của chiến lược này cho thấy những ưu điểm đáng chú ý sau:
Cơ chế xác thực đa chiềuKết hợp nhiều chỉ số kỹ thuật (xấu chốt, VWAP, trung bình di chuyển, RSI) để xác minh tín hiệu giao dịch, giảm nguy cơ tín hiệu giả.
Động lực thích ứng với thị trườngHệ thống điểm trung tâm trong ngày được cập nhật hàng ngày, cho phép các chiến lược thích ứng với các môi trường thị trường khác nhau và tỷ lệ biến động.
Xác định chính xác đường KLưu ý: Chọn các cơ hội giao dịch tiềm năng thông qua các điều kiện hình dạng K-line nghiêm ngặt và mức Fibonacci để cải thiện chất lượng tín hiệu.
Cài đặt hiển thị linh hoạtChiến lược: Có khả năng tự điều chỉnh hình ảnh, chỉ hiển thị các điểm trung tâm trong khung thời gian thích hợp (trên biểu đồ trong ngày dưới 15 phút), giảm sự lộn xộn của biểu đồ.
Lợi thế của tư duy ngượcChiến lược: Tìm kiếm cơ hội mua khi đường K màu đỏ chạm vào vị trí quan trọng, tìm kiếm cơ hội bán khi đường K màu xanh chạm vào vị trí quan trọng, tận dụng tình trạng mua bán quá mức có thể xảy ra trong thị trường.
Hệ thống phân cấp giá cả hoàn chỉnh: Bao gồm nhiều lớp hỗ trợ kháng cự ((S1-S4 và R1-R4), cung cấp giá tham chiếu phong phú, phù hợp với môi trường thị trường có độ dao động khác nhau.
Khối trung tâm tích hợp (CPR)CPR cung cấp nhận dạng khu vực cân bằng tiềm năng trong ngày, có giá trị tham khảo quan trọng trong giao dịch trong ngày.
Hỗ trợ hình ảnh: Bằng cách hiển thị các dấu hiệu và hình dạng phong phú, trực quan xác định các đường K phù hợp trên biểu đồ và các trường hợp chạm vào giá quan trọng, giúp thương nhân nhận ra nhanh chóng.
Xác nhận giao hàngKết hợp phân tích khối lượng giao dịch, đánh giá sự tham gia của thị trường thông qua khối lượng giao dịch trung bình, tăng cường độ tin cậy tín hiệu.
Thích hợp cho giao dịch trong ngàyChiến lược này được thiết kế cho các khung thời gian ngắn (đặc biệt là biểu đồ 3 phút), phù hợp với các nhà giao dịch trong ngày để sử dụng biến động thị trường để giao dịch thường xuyên.
Những ưu điểm trên làm cho chiến lược này trở thành một hệ thống giao dịch trong ngày toàn diện, mạnh mẽ và thích ứng, đặc biệt phù hợp với các nhà đầu tư có hiểu biết về phân tích kỹ thuật và muốn giao dịch dựa trên hành vi giá và mức giá quan trọng.
Mặc dù chiến lược này có nhiều lợi thế, nhưng cũng có một số rủi ro tiềm ẩn cần được các nhà giao dịch thận trọng:
Tín hiệu quá nguy hiểmDo chiến lược liên quan đến nhiều điểm trung tâm ((PP, R1-R4, S1-S4) và các chỉ số khác, có thể tạo ra quá nhiều tín hiệu trong thị trường biến động mạnh, dẫn đến giao dịch thường xuyên và phí xử lý tăng lên.
Bẫy giao dịch ngượcChiến lược này dựa trên logic ngược ((đường K màu đỏ chạm vào vị trí quan trọng mua, đường K màu xanh lá cây chạm vào vị trí quan trọng bán), có thể dẫn đến tổn thất liên tục trong thị trường xu hướng mạnh.
Độ nhạy tham sốHiệu quả của chiến lược phụ thuộc rất nhiều vào tham số nhận diện K-line (nếu K-line cao hơn 17 điểm) và thiết lập chu kỳ trung bình di chuyển, các tham số khác nhau có thể được yêu cầu trong các môi trường thị trường khác nhau.
Thiếu cơ chế ngăn chặn thiệt hạiLưu ý: Không có chiến lược dừng lỗ rõ ràng trong mã, có thể dẫn đến tổn thất đơn lẻ quá lớn.
Hạn chế trong chiến lược trong ngàyTrong một chiến lược giao dịch trong ngày, tập trung vào biểu đồ 3 phút, không phù hợp để nắm giữ trong trung và dài hạn, bỏ lỡ cơ hội xu hướng dài hạn có thể.
Hạn chế về điểm trung tâmTrong thị trường ngang, giá có thể liên tục chạm vào nhiều điểm trung tâm, tạo ra tín hiệu hỗn loạn.
Thiếu cân đối khối lượng giao dịch: Mặc dù sử dụng VWAP, chiến lược không thay đổi trọng lượng tín hiệu theo khối lượng giao dịch.
Thời gian phụ thuộc: Các điểm trục ngày dựa trên dữ liệu ngày trước, có thể không ổn định khi bắt đầu một ngày giao dịch mới vì không có đủ dữ liệu trong ngày.
Thách thức thực hiện tự động hóaChiến lược liên quan đến việc đánh giá nhiều điều kiện, thực tế có thể gặp sự chậm trễ hoặc không kịp thời khi thực hiện tự động hóa.
Đánh giá rủi ro sai lệch: logic nhận diện K-line màu xanh lá cây/màu đỏ trong mã có thể không phù hợp với môi trường ổ đĩa thực trong phản hồi.
Nhận biết và quản lý những rủi ro này là rất quan trọng để áp dụng chiến lược thành công, và các nhà giao dịch nên điều chỉnh phù hợp với khả năng chịu rủi ro và thói quen giao dịch của họ.
Dựa trên phân tích sâu về mã, các hướng chính mà chiến lược này có thể được tối ưu hóa là:
Các tham số nhận dạng đường K động:
Hệ thống lọc xu hướng:
Hệ thống đánh giá chất lượng tín hiệu:
Tích hợp quản lý tài chính:
Xác nhận khung thời gian đa dạng:
Cơ chế dừng và ngăn chặn:
Trình lọc thời gian giao dịch:
Các tham số chỉ số thích nghi:
Phân loại môi trường thị trường:
Tăng cường học máy:
Bằng cách thực hiện các hướng tối ưu hóa trên, chiến lược này có thể cải thiện đáng kể khả năng thích ứng, chính xác và lợi nhuận lâu dài, đáp ứng tốt hơn các thách thức của các điều kiện thị trường khác nhau trên cơ sở duy trì lợi thế ban đầu.
Chiến lược giao dịch đa chiều và hệ thống chỉ số Fibonacci động là một hệ thống chiến lược giao dịch trong ngày có cấu trúc toàn diện và mạnh mẽ. Nó kết hợp một cách khéo léo các công cụ phân tích kỹ thuật truyền thống (trung tâm, Fibonacci retraction, trung bình di chuyển) với các chỉ số động hiện đại (V, WAP, CPR), cung cấp cho các nhà giao dịch một khung giao dịch trong ngày tiềm năng thông qua lọc điều kiện K-line nghiêm ngặt và xác nhận nhiều chỉ số.
Ưu điểm cốt lõi của chiến lược này nằm ở việc bao phủ toàn diện các mức giá quan trọng và nắm bắt nhạy cảm các điểm biến động tiềm năng. Bằng cách đặt các điều kiện nhận diện K-line nghiêm ngặt, chiến lược có thể lọc ra một lượng lớn tiếng ồn thị trường vô nghĩa và tập trung vào các cơ hội giao dịch có tỷ lệ xác suất cao. Đồng thời, kết hợp với việc sử dụng các chỉ số khối lượng giao dịch và động lực, tăng thêm độ tin cậy của tín hiệu.
Tuy nhiên, chiến lược cũng có một số hạn chế, chẳng hạn như có thể có quá nhiều tín hiệu, rủi ro giao dịch ngược và thách thức tối ưu hóa tham số. Đối với những vấn đề này, chúng tôi đã đề xuất một số hướng tối ưu hóa, bao gồm điều chỉnh tham số động, xác nhận khung thời gian đa dạng, quản lý tiền thông minh và thích ứng với môi trường thị trường, các tối ưu hóa này có thể giúp thương nhân điều chỉnh chiến lược theo nhu cầu của riêng mình và đặc điểm của thị trường để cải thiện hiệu quả giao dịch tổng thể.
Điều đáng chú ý là bất kỳ chiến lược giao dịch nào cũng không phải là một công cụ “đặt đá vào vàng”, giao dịch thành công đòi hỏi sự kiên nhẫn, kỷ luật và học tập liên tục của nhà giao dịch ngoài việc phụ thuộc vào chính chiến lược. Đối với chiến lược này, người giao dịch được khuyến cáo thử nghiệm đầy đủ trong môi trường mô phỏng, làm quen với các đặc điểm hoạt động của nó trong các điều kiện thị trường khác nhau, dần dần điều chỉnh các tham số để phù hợp với các loại giao dịch cụ thể và phong cách cá nhân, cuối cùng tạo ra một hệ thống giao dịch cá nhân, bền vững và có lợi nhuận.
Với sự thực hành, phản hồi và tối ưu hóa liên tục, chiến lược giao dịch đa chiều và hệ thống chỉ số Fibonacci động có thể trở thành một vũ khí mạnh mẽ trong hộp công cụ của các nhà giao dịch trong ngày, cung cấp một khung phân tích kỹ thuật đáng tin cậy để nắm bắt sự biến động của thị trường trong ngày.
The Multi-Dimensional Pivot Point Trading System with Dynamic Fibonacci Indicators is a technical analysis-based trading strategy that utilizes daily pivot points, Central Pivot Range (CPR), Fibonacci retracement levels, Volume Weighted Average Price (VWAP), and moving averages to identify potential buying and selling opportunities. This strategy is particularly suitable for intraday traders, especially those focusing on 3-minute chart timeframes. The core of the strategy is determining whether candles meeting specific conditions touch key support and resistance levels, thereby triggering trading signals.
The strategy employs a pivot point system calculated from daily high, low, and close prices, combined with Volume Weighted Average Price (VWAP) and Moving VWAP (MVWAP) as dynamic support and resistance references. It also incorporates technical indicators such as the Relative Strength Index (RSI), Simple Moving Average (SMA), and Exponential Moving Average (EMA) to create a comprehensive trading decision system.
The strategy first identifies qualifying green (bullish) and red (bearish) candles, then determines if these candles touch key price levels such as pivot points, support levels, resistance levels, or VWAP. When a red candle touches a key price level, it triggers a buy signal (CE); when a green candle touches a key price level, it triggers a sell signal (PE). This contrarian approach reflects the core concept of seeking potential reversal points at key price levels.
The principles of this strategy are built on market behavior where prices fluctuate around key support and resistance levels, combined with candle patterns, volume, and momentum indicators for trading decisions. The specific principles are analyzed as follows:
Candle Identification Mechanism:
Pivot Point Calculation System:
Dynamic Price References:
Auxiliary Indicator System:
Trade Signal Generation:
The core idea of the strategy is to capture potential reversals near key support and resistance levels, filtered through specific candle patterns and multiple technical indicators to enhance signal validity. Candles touching pivot points often represent increased possibility of market hesitation or reversal at these key price levels.
Deep analysis of the strategy code reveals the following significant advantages:
Multi-dimensional Verification Mechanism: Combines multiple technical indicators (pivot points, VWAP, moving averages, RSI) to validate trading signals, reducing false signal risk.
Dynamic Market Adaptation: Daily pivot point system updates daily, allowing the strategy to adapt to different market environments and volatilities.
Precise Candle Identification: Screens potential trading opportunities through strict candle pattern conditions and Fibonacci levels, improving signal quality.
Flexible Display Settings: The strategy features view adaptation functionality, only displaying pivot points in appropriate timeframes (intraday charts below 15 minutes), reducing chart clutter.
Contrarian Thinking Advantage: The strategy looks for buying opportunities when red candles touch key levels and selling opportunities when green candles touch key levels, leveraging potential short-term overbought/oversold market conditions.
Complete Price Level Hierarchy: Includes multiple layers of support and resistance (S1-S4 and R1-R4), providing rich reference prices suitable for market environments with different volatility ranges.
Integrated Central Pivot Range (CPR): CPR provides identification of potential consolidation areas for the day, which has important reference value in intraday trading.
Visual Assistance: Through rich markers and shapes, qualifying candles and instances of touching key price levels are intuitively marked on the chart, enabling traders to quickly identify them.
Volume Confirmation: Incorporates volume analysis, assessing market participation through volume moving averages, enhancing signal reliability.
Suitable for Intraday Trading: The strategy is specially designed for short timeframes (particularly 3-minute charts), suitable for intraday traders looking to capitalize on market fluctuations through frequent trading.
These advantages make this strategy a strong, adaptive intraday trading system, particularly suitable for investors with a good understanding of technical analysis who wish to trade based on price action and key price levels.
Despite its many advantages, the strategy also presents several potential risks that traders should carefully address:
Excessive Signal Risk: Due to the strategy involving multiple pivot points (PP, R1-R4, S1-S4) and other indicators, it may generate too many signals in volatile markets, leading to frequent trading and increased fees.
Contrarian Trading Trap: The strategy is based on contrarian logic (buy when red candles touch key levels, sell when green candles touch key levels), which may lead to consecutive losses in strong trending markets.
Parameter Sensitivity: Strategy effectiveness is highly dependent on candle identification parameters (e.g., candle height must exceed 17 points) and moving average period settings, which may require different parameters in different market environments.
Lack of Stop-Loss Mechanism: No explicit stop-loss strategy is set in the code, which may lead to excessive single-trade losses.
Intraday Strategy Limitations: As a strategy focusing on 3-minute charts, it is not suitable for medium to long-term holdings, potentially missing opportunities in longer-term trends.
Pivot Point Limitations: In range-bound markets, prices may frequently touch multiple pivot points, generating confusing signals.
Lack of Volume Weight Adjustment: Although VWAP is used, the strategy does not dynamically adjust signal weights based on volume size.
Time Dependency: Daily pivot points are based on previous day’s data, and may perform unstably at the beginning of a new trading day due to insufficient current day data.
Automation Implementation Challenges: The strategy involves multiple condition judgments, and may face delays or untimely execution during actual automated execution.
Backtest Bias Risk: The green/red candle identification logic in the code may perform inconsistently between backtesting and live trading environments.
Recognizing and managing these risks is crucial for successfully applying this strategy. Traders should make appropriate adjustments based on their risk tolerance and trading habits.
Based on deep analysis of the code, the following are key directions for optimizing this strategy:
Dynamic Candle Identification Parameters:
Trend Filtering System:
Signal Quality Scoring Mechanism:
Capital Management Integration:
Multiple Timeframe Confirmation:
Stop-Loss and Take-Profit Mechanisms:
Trading Time Filters:
Adaptive Indicator Parameters:
Market Environment Classification:
Machine Learning Enhancement:
By implementing these optimization directions, the strategy can significantly improve adaptability, accuracy, and long-term profitability while maintaining its original advantages, better addressing challenges across various market conditions.
The Multi-Dimensional Pivot Point Trading System with Dynamic Fibonacci Indicators is a comprehensive, well-structured intraday trading strategy system. It cleverly combines traditional technical analysis tools (pivot points, Fibonacci retracements, moving averages) with modern dynamic indicators (VWAP, CPR). Through strict candle condition screening and multiple indicator confirmation, it provides traders with a promising intraday trading framework.
The core advantage of this strategy lies in its comprehensive coverage of key price levels and sensitive capture of potential reversal points. By setting strict candle identification conditions, the strategy can filter out a large amount of meaningless market noise and focus on high-probability trading opportunities. At the same time, the use of volume and momentum indicators further enhances signal reliability.
However, the strategy also has some limitations, such as potentially excessive signals, contrarian trading risks, and parameter optimization challenges. To address these issues, we’ve proposed several optimization directions, including dynamic parameter adjustment, multiple timeframe confirmation, intelligent capital management, and market environment adaptation. These optimizations can help traders adjust the strategy according to their own needs and market characteristics, improving overall trading effectiveness.
It’s worth noting that no trading strategy is a “magic bullet.” Successful trading depends not only on the strategy itself but also on the trader’s patience, discipline, and continuous learning. For this strategy, it’s recommended that traders first thoroughly test it in a simulated environment, familiarize themselves with its performance characteristics under different market conditions, gradually adjust parameters to adapt to specific trading instruments and personal styles, and ultimately form a personalized, sustainably profitable trading system.
Through continuous practice, feedback, and optimization, the Multi-Dimensional Pivot Point Trading System with Dynamic Fibonacci Indicators can become a powerful weapon in an intraday trader’s toolbox, providing a reliable technical analysis framework for capturing short-term market opportunities.
The strategy’s integration of traditional pivot points with modern technical tools creates a balanced approach that respects market structure while remaining responsive to intraday price movements. By focusing on key price interactions at critical levels, traders can develop a deeper understanding of market psychology and potentially improve their trading performance.
Ultimately, successful implementation will require thoughtful customization, rigorous testing, and disciplined execution. When properly applied as part of a comprehensive trading plan that includes sound risk management principles, this strategy offers a systematic method for navigating the complexities of intraday markets with greater confidence and precision.
/*backtest
start: 2025-01-01 00:00:00
end: 2025-04-01 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Pivot Point CE/PE Strategy", overlay=true)
// Identify 3-minute candles (Assuming the script is applied to a 3-minute chart)
// Calculate candle range
candleRange = high - low
// Conditions for a qualifying green candle
greenCandle = (close > open) and (candleRange >= 17) and (open < (low + 0.382 * candleRange)) and (close > (low + 0.682 * candleRange))
// Conditions for a qualifying red candle
redCandle = (close < open) and (candleRange >= 17)
// Fibonacci levels for qualifying green and red candles
green_fib_0_382 = greenCandle ? high - 0.382 * candleRange : na
green_fib_0_618 = greenCandle ? high - 0.618 * candleRange : na
red_fib_0_382 = redCandle ? low + 0.382 * candleRange : na
red_fib_0_682 = redCandle ? low + 0.682 * candleRange : na
// Daily Pivot Point Calculation
[daily_high, daily_low, daily_close] = request.security(syminfo.tickerid, "D", [high, low, close])
daily_pivot = (daily_high + daily_low + daily_close) / 3
daily_r1 = daily_pivot + (daily_pivot - daily_low)
daily_s1 = daily_pivot - (daily_high - daily_pivot)
daily_r2 = daily_pivot + (daily_high - daily_low)
daily_s2 = daily_pivot - (daily_high - daily_low)
daily_r3 = daily_high + 2 * (daily_pivot - daily_low)
daily_s3 = daily_low - 2 * (daily_high - daily_pivot)
daily_r4 = daily_high + 3 * (daily_pivot - daily_low)
daily_s4 = daily_low - 3 * (daily_high - daily_pivot)
// Updated CPR Calculation
bottom_cpr = (daily_high + daily_low) / 2
top_cpr = (daily_pivot - bottom_cpr) + daily_pivot
// VWAP and MVWAP Calculation
vwap = ta.vwap(close)
mvwap_length = input.int(20, title="MVWAP Length")
mvwap = ta.sma(vwap, mvwap_length)
// Volume Analysis
volume_ma = ta.sma(volume, 20)
plot(volume, color=color.gray, title="Volume")
plot(volume_ma, color=color.orange, title="Volume MA")
// RSI Calculation
rsi_length = input.int(14, title="RSI Length")
rsi = ta.rsi(close, rsi_length)
plot(rsi, color=color.blue, title="RSI")
// SMA and EMA Calculation
sma_length = input.int(50, title="SMA Length")
ema_length = input.int(20, title="EMA Length")
sma = ta.sma(close, sma_length)
ema = ta.ema(close, ema_length)
plot(sma, color=color.red, title="SMA")
plot(ema, color=color.green, title="EMA")
// Dynamic Visibility Condition Based on Chart Scale
show_pivot = (timeframe.isintraday and timeframe.multiplier <= 15)
// Display daily pivot points
plot(show_pivot ? daily_pivot : na, color=color.blue, title="Daily Pivot", style=plot.style_stepline)
plot(show_pivot ? daily_r1 : na, color=color.red, title="Daily R1", style=plot.style_stepline)
plot(show_pivot ? daily_r2 : na, color=color.red, title="Daily R2", style=plot.style_stepline)
plot(show_pivot ? daily_r3 : na, color=color.red, title="Daily R3", style=plot.style_stepline)
plot(show_pivot ? daily_r4 : na, color=color.red, title="Daily R4", style=plot.style_stepline)
plot(show_pivot ? daily_s1 : na, color=color.green, title="Daily S1", style=plot.style_stepline)
plot(show_pivot ? daily_s2 : na, color=color.green, title="Daily S2", style=plot.style_stepline)
plot(show_pivot ? daily_s3 : na, color=color.green, title="Daily S3", style=plot.style_stepline)
plot(show_pivot ? daily_s4 : na, color=color.green, title="Daily S4", style=plot.style_stepline)
// Display Central Pivot Range (CPR)
plot(show_pivot ? top_cpr : na, color=color.purple, title="Top CPR", style=plot.style_stepline)
plot(show_pivot ? bottom_cpr : na, color=color.orange, title="Bottom CPR", style=plot.style_stepline)
plot(vwap, color=color.fuchsia, title="VWAP")
plot(mvwap, color=color.teal, title="MVWAP")
// Mark qualifying candles
plotshape(greenCandle, title="Green Candle", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(redCandle, title="Red Candle", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Detect Green Candle Touching Pivot Points
greenTouchPivot = greenCandle and ((open <= daily_pivot and high >= daily_pivot) or
(open <= daily_r1 and high >= daily_r1) or
(open <= daily_r2 and high >= daily_r2) or
(open <= daily_r3 and high >= daily_r3) or
(open <= daily_r4 and high >= daily_r4) or
(open <= daily_s1 and high >= daily_s1) or
(open <= daily_s2 and high >= daily_s2) or
(open <= daily_s3 and high >= daily_s3) or
(open <= daily_s4 and high >= daily_s4) or (open <= vwap and high >= vwap) or (open <= mvwap and high >= mvwap))
// Detect Red Candle Touching Pivot Points
redTouchPivot = redCandle and ((low <= daily_pivot and open >= daily_pivot) or
(low <= daily_r1 and open >= daily_r1) or
(low <= daily_r2 and open >= daily_r2) or
(low <= daily_r3 and open >= daily_r3) or
(low <= daily_r4 and open >= daily_r4) or
(low <= daily_s1 and open >= daily_s1) or
(low <= daily_s2 and open >= daily_s2) or
(low <= daily_s3 and open >= daily_s3) or
(low <= daily_s4 and open >= daily_s4) or ((open >= vwap and low <= vwap) or (open >= mvwap and low <= mvwap)))
// Mark Green Candle Touching Pivot
plotshape(greenTouchPivot, title="Green Touch Pivot", location=location.abovebar, color=color.green, style=shape.triangleup, text="GTouch")
// Mark Red Candle Touching Pivot
plotshape(redTouchPivot, title="Red Touch Pivot", location=location.belowbar, color=color.red, style=shape.triangledown, text="RTouch")
// CE Entry Below Red Touch Pivot
if (redTouchPivot)
strategy.entry("CE", strategy.long)
// PE Entry Above Green Touch Pivot
if (greenTouchPivot)
strategy.entry("PE", strategy.short)