DNSE VN301!, SMA 34/89 Dual Slope Strategy by DNSE

Performance Metrics

Description

"SMA 34/89 Dual Slope Trend Following" is a trend-following strategy designed to capture sustained directional price movements by identifying alignment between short-term and medium-term trend momentum. The strategy uses SMA(34) and SMA(89), generating Long signals when both moving averages are rising and Short signals when both are falling.By requiring both SMA slopes to confirm the same direction, the strategy seeks to filter out weaker signals and avoid trades when short- and medium-term trends are not aligned. An optional SMA(200) trend filter provides an additional layer of broader trend confirmation. The strategy also includes configurable stop loss, take profit, trading session filters, and automatic end-of-session position closure for disciplined risk management.Strategy settings and configuration:Chart timeframe: recommended 2-minute chartPosition size: 3 contractsFast SMA length: 34Slow SMA length: 89SMA trend filter: disabled by defaultTrend filter SMA length: 200Stop loss: 10 pointsTake profit: 20 pointsTake profit: On / OffTime filter: On / OffTrading session: 09:00 – 14:30Trade direction: Long / Short / BothSignal arrows: disabled by defaultDefault script settings:The strategy uses two main SMA lines: SMA(34) and SMA(89). SMA(34) reflects the short-term trend. SMA(89) represents the medium-term trend.Unlike a traditional SMA crossover strategy, CNPS 03 does not wait for the two SMA lines to cross. Instead, the bot evaluates the slope of each SMA line to identify trend direction.When SMA(34) is rising and SMA(89) is also rising, the bot confirms an uptrend. When SMA(34) is falling and SMA(89) is also falling, the bot confirms a downtrend.The SMA(200) trend filter is disabled by default. This is because SMA(89) already acts as a medium-term trend component in the strategy. Users can still enable SMA(200) if they want a stricter trend filter.When the SMA(200) trend filter is enabled, the script only allows Long trades when SMA(200) is rising and only allows Short trades when SMA(200) is falling.Entry and exit rules:Long entry:SMA(34) is risingAND SMA(89) is risingAND SMA(200) is rising, if the SMA trend filter is enabledAND the signal appears during the trading sessionAND trade direction allows Long entriesLong exit:Stop loss: 10 points from entry priceTake profit: 20 points from entry price, if enabledReversal when a valid Short signal appearsClose position when the SMA trend filter turns downward, if the SMA trend filter is enabledAutomatic position close at the end of the trading sessionShort entry:SMA(34) is fallingAND SMA(89) is fallingAND SMA(200) is falling, if the SMA trend filter is enabledAND the signal appears during the trading sessionAND trade direction allows Short entriesShort exit:Stop loss: 10 points from entry priceTake profit: 20 points from entry price, if enabledReversal when a valid Long signal appearsClose position when the SMA trend filter turns upward, if the SMA trend filter is enabledAutomatic position close at the end of the trading sessionStrategy logic:CNPS 03 is suitable for market phases with clear trend direction. When both the fast SMA and the slow SMA are pointing in the same direction, the bot prioritizes trading in that direction.This design allows the bot to react earlier than a traditional SMA crossover strategy. However, during sideways market conditions, the SMA slopes may change frequently. Users should test the strategy carefully before applying it to live trading.Time filter:The default trading session is 09:00 – 14:30, designed to avoid two abnormal volatility periods.ATO 08:45 – 09:00 is the opening auction period. Price can gap strongly and technical signals may be noisy.ATC and negotiated trading 14:30 – 15:00 is the closing auction period. Price can move sharply or reverse quickly.Users can adjust the start time and end time in the bot settings.Risk disclaimer:Futures trading involves a high level of risk and prices can move sharply. This script is provided for reference, research, and backtesting purposes only. Users should fully understand derivatives trading, their own risk tolerance, and the strategy logic before applying it to live trading.All investment decisions are the responsibility of the user. phaisinh.online is not responsible for any losses arising from the use of this strategy in real trading. Past performance does not guarantee future results.__________________________________________________________"SMA 34/89 Dual Slope Trend Following" là một chiến lược giao dịch theo xu hướng, được thiết kế nhằm nắm bắt các chuyển động giá có xu hướng kéo dài bằng cách xác định sự đồng thuận giữa xu hướng ngắn hạn và trung hạn. Chiến lược sử dụng SMA(34) và SMA(89), tạo tín hiệu Long khi cả hai đường trung bình động đều dốc lên và tín hiệu Short khi cả hai đều dốc xuống.Bằng cách yêu cầu độ dốc của cả hai đường SMA xác nhận cùng một hướng, chiến lược hướng tới việc lọc các tín hiệu yếu và hạn chế giao dịch khi xu hướng ngắn hạn và trung hạn chưa đồng thuận. Bộ lọc xu hướng SMA(200) tùy chọn cung cấp thêm một lớp xác nhận xu hướng tổng thể. Chiến lược cũng bao gồm các tùy chọn Stop Loss, Take Profit, bộ lọc khung thời gian giao dịch và cơ chế tự động đóng vị thế khi kết thúc phiên, nhằm đảm bảo quản trị rủi ro một cách chặt chẽ và có kỷ luật.Cài đặt & cấu hình chiến lược:Biểu đồ: khuyến nghị khung 2 phútKhối lượng giao dịch: 3 hợp đồngChu kỳ SMA nhanh: 34Chu kỳ SMA chậm: 89Bộ lọc xu hướng SMA: Tắt mặc địnhChu kỳ SMA bộ lọc: 200Cắt lỗ: 10 điểmChốt lời: 20 điểmDùng chốt lời: Bật / TắtBộ lọc giờ: Bật / TắtKhung giờ giao dịch: 09:00 – 14:30Chiều giao dịch: Mua / Bán / Cả haiHiện mũi tên tín hiệu: Tắt mặc địnhCài đặt mặc định của script:Chiến lược sử dụng hai đường SMA chính là SMA(34) và SMA(89). SMA(34) phản ánh xu hướng ngắn hạn. SMA(89) đại diện cho xu hướng trung hạn.Khác với chiến lược giao cắt SMA thông thường, CNPS 03 không chờ hai đường SMA cắt nhau. Bot đánh giá độ dốc của từng đường SMA để xác định xu hướng.Khi SMA(34) dốc lên và SMA(89) cũng dốc lên, bot xác nhận xu hướng tăng. Khi SMA(34) dốc xuống và SMA(89) cũng dốc xuống, bot xác nhận xu hướng giảm.Bộ lọc xu hướng SMA(200) được để tắt mặc định. Lý do là SMA(89) đã đóng vai trò lọc xu hướng trung hạn trong chiến lược. Người dùng vẫn có thể bật thêm SMA(200) nếu muốn lọc xu hướng chặt hơn.Khi bật bộ lọc SMA(200), script chỉ cho phép lệnh Mua khi SMA(200) dốc lên và chỉ cho phép lệnh Bán khi SMA(200) dốc xuống.Điều kiện vào và thoát lệnh:Vào lệnh Mua:SMA(34) dốc lênVÀ SMA(89) dốc lênVÀ SMA(200) dốc lên, nếu bật bộ lọc xu hướng SMAVÀ tín hiệu xuất hiện trong khung giờ giao dịchVÀ chiều giao dịch cho phép lệnh MuaThoát lệnh Mua:Cắt lỗ: 10 điểm từ giá vào lệnhChốt lời: 20 điểm từ giá vào lệnh, nếu bậtĐảo chiều khi xuất hiện tín hiệu Bán hợp lệĐóng lệnh khi SMA bộ lọc đảo chiều xuống, nếu bật bộ lọc xu hướng SMATự động đóng lệnh khi hết khung giờ giao dịchVào lệnh Bán:SMA(34) dốc xuốngVÀ SMA(89) dốc xuốngVÀ SMA(200) dốc xuống, nếu bật bộ lọc xu hướng SMAVÀ tín hiệu xuất hiện trong khung giờ giao dịchVÀ chiều giao dịch cho phép lệnh BánThoát lệnh Bán:Cắt lỗ: 10 điểm từ giá vào lệnhChốt lời: 20 điểm từ giá vào lệnh, nếu bậtĐảo chiều khi xuất hiện tín hiệu Mua hợp lệĐóng lệnh khi SMA bộ lọc đảo chiều lên, nếu bật bộ lọc xu hướng SMATự động đóng lệnh khi hết khung giờ giao dịchLogic chiến lược:CNPS 03 phù hợp với các giai đoạn thị trường có xu hướng rõ ràng. Khi cả SMA nhanh và SMA chậm cùng nghiêng về một hướng, bot ưu tiên giao dịch theo hướng đó.Thiết kế này giúp bot phản ứng sớm hơn so với chiến lược chờ giao cắt SMA truyền thống. Tuy nhiên, trong giai đoạn thị trường đi ngang, hai đường SMA có thể đổi độ dốc liên tục. Vì vậy, người dùng nên kiểm thử kỹ trước khi sử dụng thực tế.Bộ lọc giờ:Mặc định 09:00 – 14:30, nhằm tránh hai vùng biến động bất thường.ATO 08:45 – 09:00 là giai đoạn khớp lệnh mở cửa. Giá thường có thể gap mạnh và tín hiệu kỹ thuật dễ bị nhiễu.ATC và giao dịch thỏa thuận 14:30 – 15:00 là giai đoạn khớp lệnh đóng cửa. Giá có thể biến động mạnh hoặc đảo chiều nhanh.Người dùng có thể điều chỉnh giờ bắt đầu và giờ kết thúc trong phần cài đặt bot.Tuyên bố rủi ro:Giao dịch hợp đồng tương lai có mức độ rủi ro cao và giá có thể biến động mạnh. Script này chỉ phục vụ mục đích tham khảo, nghiên cứu và kiểm thử. Người dùng cần hiểu rõ giao dịch phái sinh, khẩu vị rủi ro cá nhân và logic của chiến lược trước khi áp dụng vào giao dịch thực tế.Mọi quyết định đầu tư thuộc trách nhiệm của người dùng. phaisinh.online không chịu trách nhiệm cho bất kỳ khoản lỗ nào phát sinh từ việc sử dụng chiến lược này trong giao dịch thực tế. Hiệu quả trong quá khứ không đảm bảo kết quả trong tương lai.

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView