OPEN-SOURCE SCRIPT
Updated CNPS 9 - SMA7/50 Cross

This is a trend following trading system based on crossing signals of two SMA, served on VN30F1M
Release Notes
CNPS_09 — SMA Cross BotIndicators
Uses two Simple Moving Averages — a fast SMA (default 7) and a slow SMA (default 50) — plotted directly on the price chart. An optional SMA Trend Filter (default 200) can be enabled to restrict trades to the dominant trend direction.
Entry & Exit Rules
Long entry when SMA7 crosses above SMA50; Short entry when SMA7 crosses below SMA50. Signals are confirmed at the close of the signal candle and executed at the open of the next candle. When a reversal signal appears, the bot automatically closes the existing position and opens a new one in the opposite direction.
Risk Management
Fixed stop loss and take profit in price points, calculated from the average entry price. Default SL is 10 points, TP is 30 points (1:3 risk-reward). TP can be toggled on/off via input. Position size is fixed at 1 contract per trade.
Time Filter
Restricts entries to a defined trading session (default 9:15 – 14:30 ICT), avoiding the ATO open and the ATC closing period of VN30F1M. When the session ends, any open position is immediately closed at the first bar outside the session window. Bars outside the session are shaded grey on the chart.
Release Notes
- Vietnamese template- Add more filters for better result: time filter, trend filter.
- Change SMA to EMA because of original version is duplicated to 3SMA cross system
Open-source script
In true TradingView 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.
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 TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView 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.
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 TradingView. Read more in the Terms of Use.