DNSE VN301!, 3 SMA Cross Strategy by DNSE

Performance Metrics

Description

"SMA 7/50 Cross Trend Following" is a trend-following strategy designed to identify trend changes and capture directional price movements using the crossover of short-term and medium-term moving averages. The strategy uses a fast SMA(7) and a slow SMA(50), generating Long signals when the fast SMA crosses above the slow SMA and Short signals when it crosses below.To improve signal quality, the strategy incorporates an optional SMA(200) trend filter, allowing Long trades only when the trend SMA is rising and Short trades only when it is falling. By combining moving average crossovers with broader trend confirmation, the strategy seeks to reduce counter-trend entries and filter out weaker signals, particularly in sideways markets. It also includes configurable stop loss, take profit, trading session, trade direction, and automatic end-of-session position closure for disciplined risk management.Strategy settings and configurationChart timeframe: Recommended 15-minute chartPosition size: 3 contractsFast SMA length: 7Slow SMA length: 50SMA trend filter: Enabled 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 defaultSlippage: 3 ticksCommission: VND 10,000 per contractDefault script settingsThe strategy uses SMA(7) as the fast signal line. This line reacts more quickly to short-term price movement.SMA(50) acts as the slower signal line. It helps confirm the short-term trend more steadily.The main signal is generated when SMA(7) crosses SMA(50). This creates a simple, clear, and easy-to-control trading logic.SMA(200) is used as the larger trend filter. When this filter is enabled, the bot only allows Long trades when SMA(200) is rising or flat compared with the previous bar. It only allows Short trades when SMA(200) is falling.Entry and exit rulesLong entrySMA(7) crosses above SMA(50)AND SMA(200) is rising or flat, if the SMA trend filter is enabledAND the signal appears during the trading session, if the time filter is enabledAND trade direction allows Long entriesLong exitStop loss: 10 points from entry priceTake profit: 20 points from entry price, if enabledTrend exit: Close the position when SMA(200) turns from bullish to bearish, if the SMA trend filter is enabledReversal: When a valid Short signal appearsSession exit: Automatically close the position at the end of the trading session, if the time filter is enabledShort entrySMA(7) crosses below SMA(50)AND SMA(200) is falling, if the SMA trend filter is enabledAND the signal appears during the trading session, if the time filter is enabledAND trade direction allows Short entriesShort exitStop loss: 10 points from entry priceTake profit: 20 points from entry price, if enabledTrend exit: Close the position when SMA(200) turns from bearish to bullish or flat, if the SMA trend filter is enabledReversal: When a valid Long signal appearsSession exit: Automatically close the position at the end of the trading session, if the time filter is enabledStrategy logicCNPS 07 is suitable for market phases where a clearer directional trend develops. When the fast SMA crosses above the slow SMA, the bot looks for opportunities to follow an upward move. When the fast SMA crosses below the slow SMA, the bot looks for opportunities to follow a downward move.The SMA(200) trend filter helps reduce signals that are not aligned with the direction of the longer-term moving average. This may reduce the number of trades, but it can help filter some noisy signals during sideways market conditions.Signals are confirmed at candle close. Under TradingView's default strategy execution model, market orders are processed on the next available bar.Time filterThe default trading session is 09:00 – 14:30.When the time filter is enabled, the bot only allows new entries during this period and automatically closes any remaining position when the configured trading session ends.Users can adjust the start time and end time in the bot settings.Risk disclaimerFutures 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 7/50 Cross 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 sự thay đổi xu hướng và nắm bắt các chuyển động giá theo hướng nhất định thông qua tín hiệu giao cắt giữa các đường trung bình động ngắn hạn và trung hạn. Chiến lược sử dụng SMA(7) làm đường trung bình động nhanh và SMA(50) làm đường trung bình động chậm, tạo tín hiệu Long khi SMA nhanh cắt lên trên SMA chậm và tín hiệu Short khi SMA nhanh cắt xuống dưới SMA chậm.Để nâng cao chất lượng tín hiệu, chiến lược tích hợp bộ lọc xu hướng SMA(200) tùy chọn, chỉ cho phép giao dịch Long khi SMA xu hướng đang dốc lên và giao dịch Short khi SMA xu hướng đang dốc xuống. Bằng cách kết hợp tín hiệu giao cắt giữa các đường trung bình động với xác nhận xu hướng tổng thể, chiến lược hướng tới việc giảm thiểu các lệnh giao dịch ngược xu hướng và lọc các tín hiệu yếu, đặc biệt trong giai đoạn thị trường đi ngang. Chiến lược cũng bao gồm các tùy chọn Stop Loss, Take Profit, khung thời gian giao dịch, hướng giao dịch và cơ chế tự động đóng toàn bộ 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ượcBiểu đồ: Khuyến nghị khung 15 phútKhối lượng giao dịch: 3 hợp đồngChu kỳ SMA nhanh: 7Chu kỳ SMA chậm: 50Bộ lọc xu hướng SMA: Bậ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 địnhSlippage: 3 ticksPhí giao dịch: 10.000 VNĐ / hợp đồngCài đặt mặc định của scriptChiến lược sử dụng SMA(7) làm đường tín hiệu nhanh. Đường này phản ứng nhanh hơn với biến động giá ngắn hạn.SMA(50) đóng vai trò là đường tín hiệu chậm. Đường này giúp xác nhận xu hướng ngắn hạn một cách ổn định hơn.Tín hiệu chính được tạo ra khi SMA(7) giao cắt với SMA(50). Đây là logic giao dịch đơn giản, trực quan và dễ kiểm soát.SMA(200) được dùng làm bộ lọc xu hướng lớn. Khi bật bộ lọc này, bot chỉ cho phép lệnh Mua khi SMA(200) đang tăng hoặc đi ngang so với cây trước. Bot chỉ cho phép lệnh Bán khi SMA(200) đang giảm.Điều kiện vào và thoát lệnhVào lệnh MuaSMA(7) cắt lên SMA(50)VÀ SMA(200) đang tăng hoặc đi ngang, nếu bật bộ lọc xu hướng SMAVÀ tín hiệu xuất hiện trong khung giờ giao dịch, nếu bật bộ lọc giờVÀ chiều giao dịch cho phép lệnh MuaThoát lệnh MuaCắ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Đóng lệnh: Khi SMA(200) chuyển từ trạng thái tăng sang giảm, nếu bật bộ lọc xu hướng SMAĐảo chiều: Khi xuất hiện tín hiệu Bán hợp lệĐóng cuối phiên: Tự động đóng lệnh khi hết khung giờ giao dịch, nếu bật bộ lọc giờVào lệnh BánSMA(7) cắt xuống SMA(50)VÀ SMA(200) đang giảm, nếu bật bộ lọc xu hướng SMAVÀ tín hiệu xuất hiện trong khung giờ giao dịch, nếu bật bộ lọc giờVÀ chiều giao dịch cho phép lệnh BánThoát lệnh BánCắ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Đóng lệnh: Khi SMA(200) chuyển từ trạng thái giảm sang tăng hoặc đi ngang, nếu bật bộ lọc xu hướng SMAĐảo chiều: Khi xuất hiện tín hiệu Mua hợp lệĐóng cuối phiên: Tự động đóng lệnh khi hết khung giờ giao dịch, nếu bật bộ lọc giờLogic chiến lượcCNPS 07 phù hợp với các giai đoạn thị trường xuất hiện xu hướng rõ ràng. Khi SMA nhanh cắt lên SMA chậm, bot tìm kiếm cơ hội đi theo nhịp tăng. Khi SMA nhanh cắt xuống SMA chậm, bot tìm kiếm cơ hội đi theo nhịp giảm.Việc bật thêm SMA(200) giúp lọc bớt các tín hiệu không đồng thuận với hướng của đường xu hướng dài hơn. Điều này có thể làm giảm số lượng lệnh nhưng giúp hạn chế một phần tín hiệu nhiễu trong các giai đoạn thị trường đi ngang.Tín hiệu được xác nhận khi cây nến đóng cửa. Theo cơ chế thực thi mặc định của TradingView Strategy, lệnh thị trường được xử lý ở cây nến kế tiếp.Bộ lọc giờKhung giờ mặc định là 09:00 – 14:30.Khi bật bộ lọc giờ, bot chỉ cho phép mở lệnh trong khoảng thời gian này và tự động đóng vị thế còn lại khi phiên giao dịch được cấu hình kết thúc.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 roGiao 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