Tags: MA5SMA

This is a dual moving average crossover entry strategy based on the 5-day moving average (MA5). The main idea of this strategy is to enter positions at a certain distance above or below the MA5, and close positions when the closing price is higher than the entry price or returns to the entry price. This strategy aims to capture short-term trends while controlling risks.

This strategy uses the 5-day simple moving average (SMA) as the main indicator. When the opening price of a new candle is above the MA5, it executes buy scenario 1; when the opening price of a new candle is below the MA5 and the distance from the MA5 exceeds 0.002 points, it executes buy scenario 2. For sell conditions, when the closing price is higher than or equal to the average entry price, it executes sell scenario 1; when the closing price is lower than 0.1% of the average entry price, it executes sell scenario 2.

- This strategy is based on short-term trends and can quickly capture market changes.
- By setting a threshold for the distance from the MA5, some noise signals can be filtered out.
- By setting stop-loss conditions, risks can be effectively controlled.
- The strategy logic is clear and easy to understand and implement.

- This strategy relies on a single indicator and may face the risk of indicator failure.
- Short-term trend strategies may face frequent trading and increase the risk of transaction costs.
- Fixed stop-loss percentages may not be able to adapt to different market environments.

- Other indicators such as RSI and MACD can be considered to improve the reliability of signals.
- Stop-loss and take-profit conditions can be optimized, such as using trailing stops or dynamic stop-loss percentages.
- For different market environments, different parameters can be set to improve the adaptability of the strategy.

This dual moving average crossover entry strategy is a simple strategy based on short-term trends. By crossing above and below the MA5, and setting distance thresholds, short-term trend opportunities can be captured. At the same time, fixed percentage stop-losses can control risks. However, this strategy also has some limitations, such as relying on a single indicator and frequent trading. In the future, more indicators can be introduced, and stop-loss and take-profit conditions can be optimized to improve the robustness and adaptability of the strategy.

/*backtest start: 2023-04-24 00:00:00 end: 2024-04-29 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=5 strategy("YBS Strategy 1.1", overlay=true) // Moving Average Settings ma5 = ta.sma(close, 5) // Scenario 1: Buy when a new candle opens above the MA5 buy_condition_scenario1 = open > ma5 // Scenario 2: Buy when a new candle opens below the MA5 and is at a significant distance from the MA5 distance_from_ma5 = open - ma5 buy_condition_scenario2 = open < ma5 and distance_from_ma5 > 0.002 // Define distance in points here // Sell: Sell at the close of the candle if it's positive above the entry price, or if the price returns to the entry price sell_condition_scenario1 = close > strategy.position_avg_price or close == strategy.position_avg_price sell_condition_scenario2 = close <= strategy.position_avg_price * 0.999 // Close if price drops more than 0.1% from entry price // Execute buy and sell orders if (buy_condition_scenario1 and not (strategy.opentrades > 0)) strategy.entry("Buy Scenario 1", strategy.long) if (buy_condition_scenario2 and not (strategy.opentrades > 0)) strategy.entry("Buy Scenario 2", strategy.long) if (sell_condition_scenario1) strategy.close("Buy Scenario 1") if (sell_condition_scenario2) strategy.close("Buy Scenario 2")

- NMVOB-S
- Bollinger Bands Stochastic Oscillator Strategy
- Dynamic Take Profit Bollinger Bands Strategy
- TMA Overlay
- Dynamic Stop Loss and Take Profit Bollinger Bands Strategy
- Mobo Bands
- Squeeze Momentum Indicator
- Nik Stoch
- Hurst Future Lines of Demarcation Strategy
- Bollinger Bands Standard Deviation Breakout Strategy

- Trading Strategy Based on Support and Resistance Levels Using Technical Analysis
- RSI50_EMA Long Only Strategy
- KDJ Trending View with Signals and MA Strategy
- VWAP and RSI Crossover Strategy
- Moving Average and Relative Strength Index Strategy
- EMA Dynamic Trend Following Trading Strategy
- Dynamic Take Profit and Stop Loss Trading Strategy Based on Three Consecutive Bearish Candles and Moving Averages
- MOST and Dual Moving Average Crossover Strategy
- Bollinger Bands Stochastic Oscillator Strategy
- MACD RSI Ichimoku Momentum Trend Following Long Strategy
- Moving Average Crossover Strategy
- RSI Direction Change Strategy
- Trading Strategy Based on Consecutive MACD Golden and Death Crosses
- Bollinger Bands Breakout Strategy
- Enhanced Bollinger Bands RSI Trading Strategy
- Bollinger Bands Standard Deviation Breakout Strategy
- Stochastic Oscillator and Moving Average Strategy
- Pivot and Momentum Strategy
- Triple EMA Crossover Strategy
- Moving Average and RSI Comprehensive Trading Strategy