Tags: SMAMA99

This strategy is based on the 99-period Simple Moving Average (MA99) to determine trading signals. When the price touches the MA99, a position can be opened without requiring confirmation from two candles. The stop-loss uses a dynamic approach, meaning that when the price breaks through the MA99 and is confirmed in the next candle, the position is closed for stop-loss. This strategy aims to capture price fluctuations around the MA99 while controlling risk through dynamic stop-loss.

- Calculate the 99-period Simple Moving Average MA99.
- Determine if the current price touches the MA99, i.e., the lowest price is less than or equal to MA99, and the highest price is greater than or equal to MA99.
- If the price touches MA99 and the closing price is above MA99, go long; if the price touches MA99 and the closing price is below MA99, go short.
- For long positions, if the closing price falls below MA99 and is confirmed again in the next candle, close the position; for short positions, if the closing price breaks above MA99 and is confirmed again in the next candle, close the position.
- Each time a position is opened, set the current MA99 as the stop-loss price; reset the stop-loss price after each position is closed.

- Simple and easy to use: This strategy is based on a single indicator, MA99, with clear and straightforward rules that are easy to understand and implement.
- Dynamic stop-loss: Compared to fixed stop-loss, dynamic stop-loss can better adapt to market changes and control risk in a timely manner.
- Trend following: MA99 represents the medium to long-term trend. Opening positions when the price touches MA99 allows for trading in the direction of the main trend.
- Noise reduction: Compared to using shorter-period moving averages, the 99-period moving average can effectively filter out short-term fluctuation noise.

- Parameter optimization: This strategy only uses the parameter of 99, which may not be the optimal parameter. It requires backtesting and optimization to determine the best parameters.
- Choppy markets: In choppy markets, prices may frequently fluctuate around MA99, potentially leading to frequent trades and losses.
- Trend reversal: When the trend reverses and the price breaks through MA99, this strategy may continue to hold positions in the wrong direction, resulting in losses.
- Slippage costs: Frequent trading may incur higher slippage and transaction costs, affecting strategy profitability.

- Introduce trend filters: When determining entry signals, other trend indicators such as MACD, ADX, etc., can be incorporated to confirm trend strength and direction, improving entry quality.
- Optimize parameters: Optimize parameters such as the MA period and stop-loss conditions to find the best parameter combination and improve strategy robustness.
- Incorporate position sizing: Dynamically adjust position size based on factors such as market trend strength and volatility to control drawdown risk.
- Consider trading costs: When backtesting and live trading, consider cost factors such as trading slippage and commissions to evaluate the strategy’s actual performance.

The MA99 Touch and Dynamic Stop-Loss Strategy opens positions based on the relationship between price and MA99 and uses dynamic stop-loss to control risk. This strategy is simple and easy to use, capable of following medium to long-term trends, but may face the problem of frequent trading in choppy markets. By introducing other indicators for filtering, optimizing parameters, managing positions, and considering costs, the performance and robustness of this strategy can be further improved.

/*backtest start: 2023-04-23 00:00:00 end: 2024-04-28 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ // This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ //@version=5 strategy("MA99 Temas ve Dinamik Stop-Loss Stratejisi", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10) // MA99 hesaplayalım ma99 = ta.sma(close, 99) plot(ma99, color=color.blue, title="MA99") // Fiyatın MA99'a temas edip etmediğini kontrol edelim priceTouchedMA99 = (low <= ma99 and high >= ma99) // Long ve short koşullarını tanımlayalım longCondition = priceTouchedMA99 and close > ma99 shortCondition = priceTouchedMA99 and close < ma99 var float longStopLoss = na var float shortStopLoss = na var int longStopTriggered = 0 var int shortStopTriggered = 0 // Alım veya satım sinyallerine göre işlemleri başlatalım ve stop-loss ayarlayalım if (longCondition) strategy.entry("Long Entry", strategy.long) longStopLoss := ma99 longStopTriggered := 0 if (shortCondition) strategy.entry("Short Entry", strategy.short) shortStopLoss := ma99 shortStopTriggered := 0 // Stop-loss koşullarını ve iki mum kuralını kontrol edelim if (not na(longStopLoss)) if (close < longStopLoss) longStopTriggered := 1 else longStopTriggered := 0 if (longStopTriggered[1] == 1 and close < longStopLoss) // Bir önceki mumda tetiklendi ve hala altında strategy.close("Long Entry", comment="Stop Loss Long") longStopLoss := na longStopTriggered := 0 if (not na(shortStopLoss)) if (close > shortStopLoss) shortStopTriggered := 1 else shortStopTriggered := 0 if (shortStopTriggered[1] == 1 and close > shortStopLoss) // Bir önceki mumda tetiklendi ve hala üstünde strategy.close("Short Entry", comment="Stop Loss Short") shortStopLoss := na shortStopTriggered := 0

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

- Price Action, Pyramiding, 5% Profit Target, 3% Stop Loss
- Turnaround Tuesday Strategy (Weekend Filter)
- Bollinger Bands Double Standard Deviation Filtering 5-Minute Quantitative Trading Strategy
- Pivot Reversal Strategy with Pivot Exit
- Khaled Tamim's Avellaneda-Stoikov Strategy
- GM-8 & ADX Dual Moving Average Strategy
- Multi-Timeframe Bitcoin, Binance Coin, and Ethereum Pullback Trading Strategy
- Enhanced EMA Crossover Strategy with RSI/MACD/ATR
- Fibonacci Golden Ratio Retracement Buying Strategy
- Z-Score Trend Following Strategy
- Donchian Breakout Trading Strategy
- Ichimoku Leading Span B Breakout Strategy
- Long Entry on EMA Cross with Risk Management Strategy
- MACD and RSI Combined Long-term Trading Strategy
- DCA Dual Moving Average Turtle Trading Strategy
- VWAP Trading Strategy
- Multi-Indicator Combination Strategy (CCI, DMI, MACD, ADX)
- RSI2 Strategy Intraday Reversal Win Rate Backtest
- Hurst Future Lines of Demarcation Strategy
- Trend Following Strategy Based on OBV and MA Crossover Signals