OPEN-SOURCE SCRIPT
Diupdate

3 Red / 3 Green Strategy with Volatility Check

278
Strategy Name: 3 Red / 3 Green Strategy with Volatility Check by AlgoTradeKit

Overview
This long-only strategy is designed for daily bars on NASDAQ (or similar instruments) and combines simple price action with a volatility filter. It “tells it like it is” – enter when the market shows weakness, but only in sufficiently volatile conditions, and exit either on signs of a reversal or after a set number of days.

Entry Conditions
- Price Action:
Enter a long position when there are 3 consecutive red days (each day's close is below its open).
- Volatility Filter:
The entry is allowed only if the current ATR (Average True Range) calculated over the specified ATR Period (default 12) is greater than its 30-day simple moving average. This ensures the market has enough volatility to justify the trade.

Exit Conditions
- Reversal Signal:
Exit the long position when 3 consecutive green days occur (each day's close is above its open), signaling a potential reversal.
- Time Limit:
Regardless of market conditions, any open trade is closed if it reaches the Maximum Trade Duration (default 22 days). This helps limit exposure during stagnant or unfavorable market conditions.
- You can toggle the three-green-day exit if you want to isolate the time-based exit.

Input Parameters
- Maximum Trade Duration (days): Default is 22 days.
- ATR Period: Default is 12.
- Use 3 Green Days Exit: Toggle to enable or disable the three-green-day exit condition.

How It Works
1. Entry: The strategy monitors daily price action for 3 consecutive down days. When this occurs and if the market is volatile enough (current ATR > 30-day ATR average), it opens a long position.
2. Exit: The position is closed if the price action reverses with 3 consecutive up days or if the trade has been open for the maximum allowed duration - i.e. use it on daily chart.

Risk Management
- The built-in maximum trade duration prevents trades from lingering too long in a non-trending or consolidating market.
- The volatility filter helps ensure that trades are only taken when there is sufficient price movement, potentially increasing the odds of a meaningful move.

Disclaimer
This strategy is provided “as is” without any warranties. It is essential to backtest and validate the performance on your specific instrument and market conditions before deploying live capital. Trading involves significant risk, and you should adjust parameters to match your risk tolerance.

Test and tweak this strategy to see if it fits your trading style and market conditions. Happy trading!
Catatan Rilis
Updated default account size and pyramiding value.

Pernyataan Penyangkalan

Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.