OPEN-SOURCE SCRIPT
Updated

CNPS 9 - SMA7/50 Cross

444
This is a trend following trading system based on crossing signals of two SMA, served on VN30F1M
Release Notes
CNPS_09 — SMA Cross Bot
Indicators
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

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.