OPEN-SOURCE SCRIPT
DNSE VN301!, SMA 34/89 Dual Slope Strategy

"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 chart
Position size: 3 contracts
Fast SMA length: 34
Slow SMA length: 89
SMA trend filter: disabled by default
Trend filter SMA length: 200
Stop loss: 10 points
Take profit: 20 points
Take profit: On / Off
Time filter: On / Off
Trading session: 09:00 – 14:30
Trade direction: Long / Short / Both
Signal arrows: disabled by default
Default 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 rising
AND SMA(89) is rising
AND SMA(200) is rising, if the SMA trend filter is enabled
AND the signal appears during the trading session
AND trade direction allows Long entries
Long exit:
Stop loss: 10 points from entry price
Take profit: 20 points from entry price, if enabled
Reversal when a valid Short signal appears
Close position when the SMA trend filter turns downward, if the SMA trend filter is enabled
Automatic position close at the end of the trading session
Short entry:
SMA(34) is falling
AND SMA(89) is falling
AND SMA(200) is falling, if the SMA trend filter is enabled
AND the signal appears during the trading session
AND trade direction allows Short entries
Short exit:
Stop loss: 10 points from entry price
Take profit: 20 points from entry price, if enabled
Reversal when a valid Long signal appears
Close position when the SMA trend filter turns upward, if the SMA trend filter is enabled
Automatic position close at the end of the trading session
Strategy 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út
Khối lượng giao dịch: 3 hợp đồng
Chu kỳ SMA nhanh: 34
Chu kỳ SMA chậm: 89
Bộ lọc xu hướng SMA: Tắt mặc định
Chu kỳ SMA bộ lọc: 200
Cắt lỗ: 10 điểm
Chốt lời: 20 điểm
Dùng chốt lời: Bật / Tắt
Bộ lọc giờ: Bật / Tắt
Khung giờ giao dịch: 09:00 – 14:30
Chiều giao dịch: Mua / Bán / Cả hai
Hiện mũi tên tín hiệu: Tắt mặc định
Cà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ên
VÀ SMA(89) dốc lên
VÀ SMA(200) dốc lên, nếu bật bộ lọc xu hướng SMA
VÀ tín hiệu xuất hiện trong khung giờ giao dịch
VÀ chiều giao dịch cho phép lệnh Mua
Thoát lệnh Mua:
Cắt lỗ: 10 điểm từ giá vào lệnh
Chố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 SMA
Tự động đóng lệnh khi hết khung giờ giao dịch
Vào lệnh Bán:
SMA(34) dốc xuống
VÀ SMA(89) dốc xuống
VÀ SMA(200) dốc xuống, nếu bật bộ lọc xu hướng SMA
VÀ tín hiệu xuất hiện trong khung giờ giao dịch
VÀ chiều giao dịch cho phép lệnh Bán
Thoát lệnh Bán:
Cắt lỗ: 10 điểm từ giá vào lệnh
Chố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 SMA
Tự động đóng lệnh khi hết khung giờ giao dịch
Logic 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.
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 chart
Position size: 3 contracts
Fast SMA length: 34
Slow SMA length: 89
SMA trend filter: disabled by default
Trend filter SMA length: 200
Stop loss: 10 points
Take profit: 20 points
Take profit: On / Off
Time filter: On / Off
Trading session: 09:00 – 14:30
Trade direction: Long / Short / Both
Signal arrows: disabled by default
Default 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 rising
AND SMA(89) is rising
AND SMA(200) is rising, if the SMA trend filter is enabled
AND the signal appears during the trading session
AND trade direction allows Long entries
Long exit:
Stop loss: 10 points from entry price
Take profit: 20 points from entry price, if enabled
Reversal when a valid Short signal appears
Close position when the SMA trend filter turns downward, if the SMA trend filter is enabled
Automatic position close at the end of the trading session
Short entry:
SMA(34) is falling
AND SMA(89) is falling
AND SMA(200) is falling, if the SMA trend filter is enabled
AND the signal appears during the trading session
AND trade direction allows Short entries
Short exit:
Stop loss: 10 points from entry price
Take profit: 20 points from entry price, if enabled
Reversal when a valid Long signal appears
Close position when the SMA trend filter turns upward, if the SMA trend filter is enabled
Automatic position close at the end of the trading session
Strategy 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út
Khối lượng giao dịch: 3 hợp đồng
Chu kỳ SMA nhanh: 34
Chu kỳ SMA chậm: 89
Bộ lọc xu hướng SMA: Tắt mặc định
Chu kỳ SMA bộ lọc: 200
Cắt lỗ: 10 điểm
Chốt lời: 20 điểm
Dùng chốt lời: Bật / Tắt
Bộ lọc giờ: Bật / Tắt
Khung giờ giao dịch: 09:00 – 14:30
Chiều giao dịch: Mua / Bán / Cả hai
Hiện mũi tên tín hiệu: Tắt mặc định
Cà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ên
VÀ SMA(89) dốc lên
VÀ SMA(200) dốc lên, nếu bật bộ lọc xu hướng SMA
VÀ tín hiệu xuất hiện trong khung giờ giao dịch
VÀ chiều giao dịch cho phép lệnh Mua
Thoát lệnh Mua:
Cắt lỗ: 10 điểm từ giá vào lệnh
Chố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 SMA
Tự động đóng lệnh khi hết khung giờ giao dịch
Vào lệnh Bán:
SMA(34) dốc xuống
VÀ SMA(89) dốc xuống
VÀ SMA(200) dốc xuống, nếu bật bộ lọc xu hướng SMA
VÀ tín hiệu xuất hiện trong khung giờ giao dịch
VÀ chiều giao dịch cho phép lệnh Bán
Thoát lệnh Bán:
Cắt lỗ: 10 điểm từ giá vào lệnh
Chố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 SMA
Tự động đóng lệnh khi hết khung giờ giao dịch
Logic 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.
Open-source script
In true PulseWire spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Mr. Khôi Nguyên; phụ trách sản phẩm tích hợp PulseWire
E: [email protected]
Linkedin:
E: [email protected]
Linkedin:
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by PulseWire. Read more in the Terms of Use.
Open-source script
In true PulseWire spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Mr. Khôi Nguyên; phụ trách sản phẩm tích hợp PulseWire
E: [email protected]
Linkedin:
E: [email protected]
Linkedin:
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by PulseWire. Read more in the Terms of Use.
