DNSE VN301!, SMA ADX/DI Trend Following Strategy by DNSE

Performance Metrics

Description

"SMA ADX DI Trend Following" is a trend-following strategy designed to identify and capture directional price movements by combining SMA slope analysis with ADX trend-strength confirmation and DI directional signals. The strategy uses SMA(89) to determine the primary trend direction, while ADX(14) confirms that the market has sufficient trend strength and DI identifies whether bullish or bearish pressure is dominant.By requiring agreement between trend direction, trend strength, and directional momentum, the strategy seeks to filter out weak or unclear market conditions while participating in stronger intraday trends. An optional SMA(200) trend filter provides additional broader-trend confirmation. The strategy also includes configurable stop loss, take profit, trading session filters, signal confirmation settings, and automatic end-of-session position closure for disciplined risk management. Strategy settings and configuration:Chart timeframe: recommended 15-minute chartPosition size: 3 contractsSignal SMA length: 89SMA slope lookback: 5ADX length: 14ADX threshold: 20DI filter: On / OffNew signal only: On / OffSMA 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 a signal SMA with a length of 89 to identify the main market direction. Instead of comparing the current SMA with only the previous candle, the bot uses a slope lookback of 5.This means the bot compares the current SMA with the SMA value from 5 candles ago. If the current SMA is higher than the SMA from 5 candles ago, the SMA is considered rising. If the current SMA is lower than the SMA from 5 candles ago, the SMA is considered falling.This method helps reduce noise on the 1-minute timeframe. The bot does not enter a trade just because the SMA moves slightly within one candle.ADX(14) is used to confirm trend strength. When ADX is above 20, the market is considered to have enough trend strength for trading signals to be considered.DI is used to confirm trend direction. When +DI is above -DI, buying pressure is dominant. When -DI is above +DI, selling pressure is dominant.When the DI filter is enabled, the bot only allows Long trades when +DI > -DI. It only allows Short trades when -DI > +DI.The “New signal only” option helps reduce repeated entries in the same signal state. When this option is enabled, the bot only enters when a new Long or Short state appears.The SMA(200) trend filter is disabled by default. Users can enable this filter if they want stricter alignment with the larger trend.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:Signal SMA is rising based on the 5-candle lookbackAND ADX(14) > 20AND +DI > -DI, if the DI filter is enabledAND SMA(200) is rising, if the SMA trend filter is enabledAND a new Long state has just appeared, if new signal only mode 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 enabledSignal SMA turns downwardReversal when a valid Short signal appearsAutomatic position close at the end of the trading sessionShort entry:Signal SMA is falling based on the 5-candle lookbackAND ADX(14) > 20AND -DI > +DI, if the DI filter is enabledAND SMA(200) is falling, if the SMA trend filter is enabledAND a new Short state has just appeared, if new signal only mode 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 enabledSignal SMA turns upwardReversal when a valid Long signal appearsAutomatic position close at the end of the trading sessionStrategy logic:CNPS 05 is suitable for market phases with clear trend direction. The signal SMA identifies the main direction. ADX filters for markets with enough trend strength. DI confirms whether buying or selling pressure is dominant.This structure helps reduce noise in sideways conditions. The bot does not rely only on SMA slope. It also requires enough trend strength and directional confirmation from DI.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 ADX DI Trend Following" là một chiến lược giao dịch theo xu hướng, được thiết kế nhằm xác định và nắm bắt các chuyển động giá theo xu hướng bằng cách kết hợp phân tích độ dốc SMA với xác nhận sức mạnh xu hướng từ ADX và tín hiệu định hướng từ DI. Chiến lược sử dụng SMA(89) để xác định hướng xu hướng chính, trong khi ADX(14) xác nhận thị trường đang có đủ sức mạnh xu hướng và DI xác định bên mua hay bên bán đang chiếm ưu thế.Bằng cách yêu cầu sự đồng thuận giữa hướng xu hướng, sức mạnh xu hướng và động lượng định hướng, chiến lược hướng tới việc lọc các điều kiện thị trường yếu hoặc không rõ xu hướng, đồng thời tham gia vào các xu hướng intraday mạnh hơn. Bộ lọc xu hướng SMA(200) tùy chọn cung cấp thêm xác nhận về 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, cài đặt xác nhận tín hiệu 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 15 phútKhối lượng giao dịch: 3 hợp đồngChu kỳ SMA tín hiệu: 89SMA slope lookback: 5Chu kỳ ADX: 14Ngưỡng ADX: 20Bộ lọc DI: Bật / TắtChỉ vào khi tín hiệu mới: Bật / TắtBộ 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 SMA tín hiệu chu kỳ 89 để xác định hướng chính của thị trường. Thay vì so sánh SMA hiện tại với đúng một nến trước, bot sử dụng SMA slope lookback 5.Điều này có nghĩa là bot so sánh SMA hiện tại với SMA của 5 nến trước. Nếu SMA hiện tại cao hơn SMA của 5 nến trước, SMA được xem là đang dốc lên. Nếu SMA hiện tại thấp hơn SMA của 5 nến trước, SMA được xem là đang dốc xuống.Cách tính này giúp giảm nhiễu trên khung 1 phút. Bot không vào lệnh chỉ vì SMA nhích nhẹ trong một nến ngắn.ADX(14) được dùng để xác nhận sức mạnh xu hướng. Khi ADX lớn hơn 20, thị trường được xem là có đủ lực xu hướng để xét tín hiệu giao dịch.DI được dùng để xác nhận hướng xu hướng. Khi +DI lớn hơn -DI, lực tăng đang chiếm ưu thế. Khi -DI lớn hơn +DI, lực giảm đang chiếm ưu thế.Khi bật bộ lọc DI, bot chỉ cho phép lệnh Mua khi +DI > -DI. Bot chỉ cho phép lệnh Bán khi -DI > +DI.Tùy chọn “Chỉ vào khi tín hiệu mới” giúp hạn chế vào lại liên tục trong cùng một trạng thái. Khi bật tùy chọn này, bot chỉ vào lệnh khi trạng thái Long hoặc Short vừa mới xuất hiện.Bộ lọc SMA(200) được để tắt mặc định. Người dùng có thể bật bộ lọc này nếu muốn giao dịch chặt hơn theo xu hướng lớ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 tín hiệu dốc lên theo lookback 5VÀ ADX(14) > 20VÀ +DI > -DI, nếu bật bộ lọc DIVÀ SMA(200) dốc lên, nếu bật bộ lọc xu hướng SMAVÀ trạng thái Mua vừa mới xuất hiện, nếu bật chế độ chỉ vào tín hiệu mớiVÀ 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ậtSMA tín hiệu đảo chiều xuốngĐảo chiều khi xuất hiện tín hiệu Bán hợp lệTự động đóng lệnh khi hết khung giờ giao dịchVào lệnh Bán:SMA tín hiệu dốc xuống theo lookback 5VÀ ADX(14) > 20VÀ -DI > +DI, nếu bật bộ lọc DIVÀ SMA(200) dốc xuống, nếu bật bộ lọc xu hướng SMAVÀ trạng thái Bán vừa mới xuất hiện, nếu bật chế độ chỉ vào tín hiệu mớiVÀ 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ậtSMA tín hiệu đảo chiều lênĐảo chiều khi xuất hiện tín hiệu Mua hợp lệTự động đóng lệnh khi hết khung giờ giao dịchLogic chiến lược:CNPS 05 phù hợp với các giai đoạn thị trường có xu hướng rõ ràng. SMA tín hiệu giúp xác định hướng di chuyển chính. ADX giúp lọc những giai đoạn thị trường có lực. DI giúp xác nhận lực đang nghiêng về bên Mua hay bên Bán.Cấu trúc này giúp bot hạn chế tín hiệu nhiễu trong vùng sideway. Bot không chỉ nhìn độ dốc SMA, mà còn yêu cầu thị trường có đủ sức mạnh xu hướng và có xác nhận hướng từ DI.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