Forex Reversal Strategy [5-Min] – Optimized for Scalping & Intracreated from @AlgoAlpha
📈 Description:
This Forex Reversal Strategy is designed for scalping and short-term trading on the 5-minute timeframe. It leverages reversal signals, trend confirmation, and volatility filters to capture high-probability trading opportunities.
🚀 Key Features:
✅ Reversal Signal Detection – Identifies potential trend reversals using price action.
✅ 200 EMA Trend Filter – Only takes trades in the direction of the trend.
✅ ATR-Based Stop Loss & Take Profit – Dynamically adjusts risk based on market volatility.
✅ ADX Volatility Filter – Avoids low-momentum and sideways markets.
✅ Session Filter (London & NY) – Trades only during high liquidity periods for better performance.
✅ Optimized for Forex Scalping – Ideal for pairs like EUR/USD, GBP/USD, USD/JPY, and XAU/USD.
📌 How It Works:
Long Trades: Enter when a bullish reversal is detected above the 200 EMA and market volatility is high.
Short Trades: Enter when a bearish reversal is detected below the 200 EMA and momentum confirms.
Exit Strategy: Uses ATR-based stop loss & take profit, with a 1.8:1 risk-reward ratio for optimized returns.
⚙ Customization Options:
Adjust Stop Loss ATR Multiplier for tighter or wider risk management.
Modify Risk-Reward Ratio to balance profit potential.
Enable/Disable Session Filter for 24/5 trading.
🔔 Alerts Included – Get notified when a trade opportunity arises!
📊 Recommended Timeframe: 5-Min
💰 Best Used On: Forex Pairs (EUR/USD, GBP/USD, USD/JPY, XAU/USD)
📈 Suggested Market Conditions: Trending and volatile markets.
🔥 Test it in the Strategy Tester and optimize it for your trading style! 🚀
תבניות גרפים
ALGOX V6_1_24 - Non-RepaintingWorking of the source from @CharlieChanCR
🔹 Fixes Implemented:
✅ Higher Timeframe Data (request.security()) fixed → Uses lookahead = barmerge.lookahead_off
✅ Heikin Ashi Candles Removed → Uses regular close prices
✅ Pivot Highs/Lows (ta.pivothigh() & ta.pivotlow()) replaced → Implements a rolling window method
✅ Process orders on every tick → Ensures real-time accuracy with calc_on_every_tick = true
✅ Ensures Stop Loss & Take Profit don’t repaint → Uses static levels per trade
Now, I'll modify and present the non-repainting version of your script. Stay tuned! 🚀
Fix Repainting Algox
🔧 Fixes Applied:
1️⃣ Fixed Higher Timeframe Data (request.security())
Now uses lookahead = barmerge.lookahead_off to prevent repainting.
2️⃣ Removed Heikin Ashi Candles
The strategy now strictly uses regular candlestick data.
3️⃣ Replaced ta.pivothigh() & ta.pivotlow()
Uses a rolling window method (f_swing_high() and f_swing_low()) to avoid future bar dependency.
4️⃣ Ensured Stop Loss & Take Profit Do Not Repaint
Uses static price levels based on strategy.position_avg_price.
5️⃣ Processes Orders on Every Tick (calc_on_every_tick = true)
Ensures real-time accuracy without modifying past signals.
6️⃣ Added Alerts for Entries & Exits
Get notified when Long/Short Entries or Take Profit levels are reached.
------------------------------------------------
🔥 Why This Version is Better?
✅ No more repainting—what you see in backtests is what happens in real-time.
✅ More reliable entries & exits—no signals disappearing after recalculation.
✅ Better for automation & live trading—consistent results when using bots.
------------------------------------------
Adaptive SuperTrend StrategyThe Adaptive SuperTrend Trading Strategy is an advanced trading algorithm inspired by the Machine Learning Adaptive SuperTrend @AlgoAlpha indicator. This strategy enhances the traditional SuperTrend concept by integrating volatility clustering, adaptive ATR-based trend detection, and a structured entry/exit system. It aims to maximize trading efficiency by reducing false signals and capturing trends with optimized risk management.
How It Works
The strategy revolves around the following key components:
1. Adaptive SuperTrend Calculation
The core SuperTrend is calculated using the ATR (Average True Range) with an adjustable factor to detect trend direction.
Trend shifts are confirmed using directional crossovers (ta.crossunder(dir, 0) for bullish shifts and ta.crossover(dir, 0) for bearish shifts).
2. Volatility Clustering via Machine Learning
The strategy applies a k-means-like clustering method to segment market volatility into three categories:
High Volatility (Cluster 0): Avoids trend entries due to unstable market conditions.
Medium Volatility (Cluster 1): Accepts entries but with cautious stop-loss management.
Low Volatility (Cluster 2): Ideal conditions for trend-following entries.
Clustering is derived from historical ATR values, ensuring adaptability to changing market conditions.
3. Entry and Exit Rules
Long Entry Conditions:
Bullish trend shift (ta.crossunder(dir, 0)).
Market is in low or medium volatility to avoid choppy conditions.
Price is above the SuperTrend line.
Short Entry Conditions:
Bearish trend shift (ta.crossover(dir, 0)).
Market is in high volatility, indicating a strong downward move.
Price is below the SuperTrend line.
Exit Conditions:
Stop-loss and take-profit are determined by ATR multipliers.
A long trade is exited when price crosses below the SuperTrend line.
A short trade is exited when price crosses above the SuperTrend line.
How It Captures Profit
Trend Following: By entering trades at trend shifts and staying in the trend, the strategy maximizes profit potential.
Volatility Filtering: Avoids trading in highly volatile, unpredictable conditions, reducing drawdowns.
Risk Management: Uses ATR-based stop-loss and take-profit to dynamically adjust for different market conditions.
Best Markets & Timeframes
This strategy is versatile and can be applied across multiple markets and timeframes:
Best Markets
Forex (EUR/USD, GBP/USD, USD/JPY): Works well due to trending nature.
Cryptocurrency (Bitcoin, Ethereum, Solana): Captures major trend moves with volatility filtering.
Stocks (AAPL, TSLA, AMZN): Ideal for swing trading on daily or 4H charts.
Commodities (Gold, Oil, Silver): Performs well in breakout trends and trending cycles.
Recommended Timeframes
Intraday (15m, 30m, 1H): Works well for active traders who want frequent trades.
Swing Trading (4H, Daily): Captures major trends for medium-term traders.
Long-Term (Weekly, Monthly): Useful for filtering macro trends and long-term investing.
Conclusion
The Adaptive SuperTrend Trading Strategy builds upon the Machine Learning Adaptive SuperTrend concept by incorporating trend confirmation, volatility clustering, and risk management into a robust trading system. It provides high-probability trade entries while minimizing risk through volatility-based filtering.
With its adaptability across different markets and timeframes, it serves as a powerful tool for traders looking to optimize their trend-following strategies while maintaining strong risk control mechanisms.
Optimized Triple Smoothed MA Crossover StrategyUsed @AlgoAlpha as the basis of this strategy.
Strategy Overview
The Optimized Triple Smoothed MA Crossover Strategy is a trend-following system that leverages a triple-smoothed moving average to filter out noise and generate high-probability trading signals. This strategy aims to reduce false signals by incorporating additional trend, momentum, and volatility confirmations before entering a trade.
Unlike simple crossover strategies, this approach smooths price action multiple times, ensuring that only strong trends are considered. By combining moving averages with RSI, ATR, and a 200 EMA trend filter, the strategy ensures that trades are aligned with the dominant trend and market momentum.
Why It Works Best on the 1H Timeframe
🔹 Filters Out Market Noise:
Shorter timeframes (e.g., 5m, 15m) are prone to whipsaws and false breakouts.
The 1H timeframe smooths out short-term fluctuations, making trend confirmation more reliable.
🔹 Captures Strong Market Movements:
The 1H chart balances frequent trade opportunities with stronger trend-following accuracy.
It allows traders to catch significant swings without being overly sensitive to minor price changes.
🔹 Optimized for Institutional Trading Behavior:
Many institutional traders and large market participants use the 1H timeframe for trend identification.
This ensures higher liquidity and better trend reliability compared to lower timeframes.
🔹 Works Well Across Multiple Markets:
In Forex & Crypto, the 1H timeframe captures major session overlaps (London/New York in Forex, Asia/London in Crypto).
In Stocks, it aligns with intraday momentum trends, avoiding random fluctuations.
How It Works
✅ Trade Entries:
Long Entry: When the signal line crosses below the triple-smoothed MA, confirming a bullish trend.
Short Entry: When the signal line crosses above the triple-smoothed MA, confirming a bearish trend.
✅ Confirmation Filters:
Trend Filter (200 EMA): Trades are only taken when aligned with the dominant trend.
RSI Momentum Filter: Long trades are taken when RSI > 50, and short trades when RSI < 50.
ATR Volatility Filter: Trades are executed only when ATR indicates high market activity, avoiding choppy conditions.
✅ Risk Management:
Stop Loss: Dynamically set using 1.5 × ATR, adjusting for market volatility.
Take Profit: 2 × ATR, ensuring a favorable risk-reward ratio.
No Repainting: Signals remain fixed after the bar closes, ensuring accurate backtesting and live trading performance.
Sloogals Bollinger Bands Strategy📈 Sloogals Bollinger Bands Trading Strategy - Simple & Effective! 📉
🔹 Strategy Name: Bollinger Bands Strategy
🔹 Works On: Stocks, Forex, Crypto, and Indices
🔹 Best Timeframe: 5m, 15m, 1H, or 4H (adjustable)
🔹 Risk-Reward Ratio: 2:1 (Default)
--------------------------------------------------------------------
🚀 How It Works:
This strategy automatically trades using Bollinger Bands, a popular indicator for spotting price breakouts and reversals.
✅ Buys (Long Entry) when the price crosses above the Lower Bollinger Band (oversold condition).
✅ Sells (Short Entry) when the price crosses below the Upper Bollinger Band (overbought condition).
✅ Closes positions when the price returns to the Middle Bollinger Band (mean reversion).
It also includes stop loss and take profit to protect your capital and maximize profits!
-------------------------------------------------------------------
📊 Key Features:
✅ Automatic Trading & Paper Trading - Simulated trades in TradingView's Strategy Tester
✅ Adjustable Stop Loss & Take Profit - Default 1% SL, 2% TP for a 2:1 Risk-Reward
✅ Smart Alerts - Get notified via sound in the browser when a trade triggers
✅ Performance Dashboard - Track account balance, profit, and win rate in real time
✅ Dynamic Position Sizing - Trades a fixed % of your account equity
-------------------------------------------------------------------
📢 How to Use It:
1️⃣ Add the script to your TradingView chart
2️⃣ Go to “Strategy Tester” and check backtest results
3️⃣ Enable Paper Trading to test it in real-time
4️⃣ Set up Alerts for trade signals
--------------------------------------------------------------
📌 Adjustments You Can Make:
🔹 Change Bollinger Band Settings (bbLength, bbStdDev)
🔹 Modify Stop Loss & Take Profit % to match your risk tolerance
🔹 Customize Alerts for SMS, email, or webhook notifications
Gemini Supreme Bot - CompoundingThis bot rides major market trends with a dynamic stop-loss that adapts to volatility. It uses compounding to reinvest profits, accelerating growth.
Trend Following + Momentum: ADX, moving averages, and RSI confirm strong entries.
Adaptive Risk Management: Risk is controlled with a percentage-based stop-loss and position sizing.
Compounding for Growth: Profits are reinvested to boost returns.
Backtest and optimize to unleash its full potential!
NOG50TRADERSAlways be conservative when you get the NOG50T Long signal always wait a pullback in Discount price! when you see NOG50T Short Signal always wait A pullback in expensive price. never chase market. (Manasse IRADUKUNDA CEO)
Scalping Strategy TesterStrategy Description: Scalping Strategy Tester
The Scalping Strategy Tester is a highly focused intraday trading approach designed for quick trades based on technical indicators. It combines the use of Exponential Moving Averages (EMA), the Relative Strength Index (RSI), and the Moving Average Convergence Divergence (MACD) to identify optimal entry and exit points for short-term trades. This strategy is best suited for volatile markets where frequent price movements allow for rapid gains.
Key Components
Exponential Moving Averages (EMA):
Short EMA (9-period): Tracks short-term price momentum.
Medium EMA (21-period): Represents medium-term trend direction.
A crossover between the two signals potential trend changes.
Relative Strength Index (RSI):
Evaluates the momentum and speed of price changes.
Oversold Zone (<30): Indicates potential buy signals.
Overbought Zone (>70): Indicates potential sell signals.
Moving Average Convergence Divergence (MACD):
MACD Line and Signal Line: Measures momentum shifts.
A bullish crossover (MACD > Signal) confirms upward momentum.
A bearish crossover (MACD < Signal) confirms downward momentum.
Trading Rules
Long Entry (Buy):
Condition:
The short EMA crosses above the medium EMA.
RSI is below 30 (oversold).
MACD Line is above the Signal Line.
Action: Open a long position.
Short Entry (Sell):
Condition:
The short EMA crosses below the medium EMA.
RSI is above 70 (overbought).
MACD Line is below the Signal Line.
Action: Open a short position.
Exit Rules:
Long Position: Close when the short condition is met.
Short Position: Close when the long condition is met.
Visual Aids
Blue Line: 9-period EMA for short-term trend tracking.
Red Line: 21-period EMA for medium-term trend tracking.
The relationship between these lines helps identify trend changes and trading opportunities.
Advantages
Quick identification of high-probability trades using multiple confirmations (EMA, RSI, MACD).
Designed for fast-paced trading environments, making it ideal for scalping.
Simple exit rules reduce emotional decision-making.
Use Cases
This strategy works best for scalping in markets with high liquidity and volatility, such as cryptocurrency or forex markets, where rapid price changes create frequent trading opportunities. It can be applied effectively on shorter timeframes, like 1-minute or 5-minute charts.
Disclaimer
This is a technical strategy designed for educational purposes. Backtest thoroughly on demo accounts before deploying with real funds. Always account for slippage, transaction costs, and market conditions.
RSI50此策略的逻辑是:
1.将RSI周期调整为750.
2.增加一条ma均线,这条ma线是将rsi线进行sma计算 ,并且设置sma周期为15
3.ma均线上穿rsi=50 线,做多
ma均线下穿rsi= 50 线,做空
ma均线上穿rsi=52线,平多
ma均线下穿rsi=48线,平空
此策略暂时适用于btcusdt 15min
The logic of this strategy is as follows:
1. Set the RSI period to 750.
2. Add a moving average (MA) line, which is the simple moving average (SMA) of the RSI line, with a SMA period of 15.
3.Enter a long position when the MA line crosses above the RSI = 50 line.
Enter a short position when the MA line crosses below the RSI = 50 line.
Close the long position when the MA line crosses above the RSI = 52 line.
Close the short position when the MA line crosses below the RSI = 48 line.
this strategy is applied to BTCUSDT on the 15-minute chart.
15/30/1hr Min Breakout Strategy
15-Minute Breakout Strategy
This strategy identifies breakout opportunities based on the first 15-minute candle. Ideal for intraday traders, it works only on a 15-minute chart.
How It Works:
First Candle High/Low: The strategy marks the high (green line) and low (red line) of the 9:15 candle.
Breakout Conditions:
Buy: Triggered if the price closes above the first candle’s high.
Sell: Triggered if the price closes below its low
RSI50此策略的逻辑是:
1.将RSI周期调整为750.
2.增加一条ma均线,这条ma线是将rsi线进行sma计算 ,并且设置sma周期为15
3.ma均线上穿rsi=50 线,做多
ma均线下穿rsi= 50 线,做空
ma均线上穿rsi=52线,平多
ma均线下穿rsi=48线,平空
此策略暂时适用于btcusdt 15min
The logic of this strategy is as follows:
1. Set the RSI period to 750.
2. Add a moving average (MA) line, which is the simple moving average (SMA) of the RSI line, with a SMA period of 15.
3.Enter a long position when the MA line crosses above the RSI = 50 line.
Enter a short position when the MA line crosses below the RSI = 50 line.
Close the long position when the MA line crosses above the RSI = 52 line.
Close the short position when the MA line crosses below the RSI = 48 line.
this strategy is applied to BTCUSDT on the 15-minute chart.
Harmonic Pattern with WPR Strategy This strategy uses Harmonic Patterns like Gartley, Bat, Crab and Butterfly along with William Percent Range to enter/exit trade
Works best on XAUUSD (specially on smaller time frames)
Can be used for scalping
The Gold Box StrategySuggestions for Improving Entry and Exit Signals:
1. Filtering Signals with EMA Confluence:
Ensure that buy signals (bullish engulfing) are only triggered when the price is above the 20 EMA.
Ensure that sell signals (bearish engulfing) are only triggered when the price is below the 20 EMA.
This will reduce false signals and ensure trades are taken in the direction of the overall trend.
2. Round Number Levels Filtering:
You can add a condition to only allow entries when the price is near round numbers (e.g., within a certain dollar range from $5 intervals like 1775, 1780, etc.).
3. Session Filtering:
Ensure that trades are only taken during active trading sessions (London or New York) to avoid low-volatility periods where false signals are more likely.
ema 59 Giải thích mã:
Thêm biến buyLabel và sellLabel:
buyLabel và sellLabel được sử dụng để xác định khi nào label Buy hoặc Sell xuất hiện trên biểu đồ.
Cảnh báo khi label Buy xuất hiện:
Sử dụng alertcondition với điều kiện outsideBarCrossAbove để thông báo khi label Buy xuất hiện.
Cảnh báo khi label Sell xuất hiện:
Sử dụng alertcondition với điều kiện outsideBarCrossBelow để thông báo khi label Sell xuất hiện.
Thông báo chi tiết:
Thông báo sẽ hiển thị giá tại thời điểm label xuất hiện.
Ví dụ thông báo:
Khi label Buy xuất hiện: "Label Buy xuất hiện tại giá: 1.1050".
Khi label Sell xuất hiện: "Label Sell xuất hiện tại giá: 1.1000".
Lưu ý:
Đảm bảo rằng bạn đã bật cảnh báo trong TradingView để nhận thông báo khi label xuất hiện.
Kiểm tra kỹ lưỡng chiến lược trên dữ liệu lịch sử trước khi sử dụng trong giao dịch thực tế.
Nếu bạn muốn thông báo chi tiết hơn (ví dụ: thêm thông tin về số lượng hợp đồng hoặc vị thế), bạn có thể sử dụng alert trong strategy thay vì alertcondition. Tuy nhiên, alert chỉ hoạt động với strategy, không hoạt động với indicator.
image.png
PNG 11.25KB
Lỗi "Void expression cannot be assigned to a variable" xảy ra khi bạn cố gắng gán một biểu thức không trả về giá trị (void) vào một biến. Trong Pine Script, hàm plotshape không trả về giá trị nào, vì vậy bạn không thể gán nó vào một biến như buyLabel hoặc sellLabel.
Nguyên nhân:
Bạn đang cố gắng gán kết quả của plotshape vào biến buyLabel và sellLabel, nhưng plotshape không trả về giá trị.
Cách sửa lỗi:
Bạn không cần gán plotshape vào biến. Thay vào đó, bạn có thể sử dụng trực tiếp điều kiện outsideBarCrossAbove và outsideBarCrossBelow để tạo cảnh báo.
Dưới đây là đoạn mã đã được sửa:
pinescript
Copy
//@version=5
strategy(title="Outside Bar EMA Crossover Strategy with EMA Shift", shorttitle="Outside Bar EMA Cross", overlay=true)
// Input for EMA lengths
lenEMA1 = input.int(5, title="EMA 5 Length")
lenEMA2 = input.int(9, title="EMA 9 Length")
// Input for EMA 9 shift
emaShift = input.int(1, title="EMA 9 Shift", minval=0)
// Calculate EMAs
ema1 = ta.ema(close, lenEMA1)
ema2 = ta.ema(close, lenEMA2)
// Apply shift to EMA 9
ema2Shifted = na(ema2 ) ? na : ema2 // Dịch chuyển EMA 9 bằng cách sử dụng offset
// Plot EMAs
plot(ema1, title="EMA 5", color=color.blue, linewidth=2)
plot(ema2Shifted, title="EMA 9 Shifted", color=color.red, linewidth=2)
// Outside Bar condition
outsideBar() => high > high and low < low
// Cross above EMA 5 and EMA 9 (shifted)
crossAboveEMA = close > ema1 and close > ema2Shifted
// Cross below EMA 5 and EMA 9 (shifted)
crossBelowEMA = close < ema1 and close < ema2Shifted
// Outside Bar cross above EMA 5 and EMA 9 (shifted)
outsideBarCrossAbove = outsideBar() and crossAboveEMA
// Outside Bar cross below EMA 5 and EMA 9 (shifted)
outsideBarCrossBelow = outsideBar() and crossBelowEMA
// Plot shapes for visual signals
plotshape(series=outsideBarCrossAbove, title="Outside Bar Cross Above", location=location.belowbar, color=color.green, style=shape.labelup, text="Buy", textcolor=color.white)
plotshape(series=outsideBarCrossBelow, title="Outside Bar Cross Below", location=location.abovebar, color=color.red, style=shape.labeldown, text="Sell", textcolor=color.white)
// Calculate Outside Bar height
outsideBarHeight = high - low // Chiều cao của nến Outside Bar
// Calculate TP and SL levels
tpRatio = 0.5 // TP = 50% chiều cao nến Outside Bar
slRatio = 1.0 // SL = 100% chiều cao nến Outside Bar
tpLevelLong = close + outsideBarHeight * tpRatio // TP cho lệnh mua
slLevelLong = close - outsideBarHeight * slRatio // SL cho lệnh mua
tpLevelShort = close - outsideBarHeight * tpRatio // TP cho lệnh bán
slLevelShort = close + outsideBarHeight * slRatio // SL cho lệnh bán
// Strategy logic
if (outsideBarCrossAbove)
strategy.entry("Buy", strategy.long)
strategy.exit("Take Profit/Stop Loss", "Buy", stop=slLevelLong, limit=tpLevelLong) // Thêm TP và SL
if (outsideBarCrossBelow)
strategy.entry("Sell", strategy.short)
strategy.exit("Take Profit/Stop Loss", "Sell", stop=slLevelShort, limit=tpLevelShort) // Thêm TP và SL
// Logic: Nếu lệnh Buy bị Stop Loss => Vào lệnh Sell
if (strategy.position_size > 0 and close <= slLevelLong)
strategy.close("Buy")
strategy.entry("Sell After Buy SL", strategy.short)
// Logic: Nếu lệnh Sell bị Stop Loss => Vào lệnh Buy
if (strategy.position_size < 0 and close >= slLevelShort)
strategy.close("Sell")
strategy.entry("Buy After Sell SL", strategy.long)
// Cảnh báo khi label Buy xuất hiện
alertcondition(condition=outsideBarCrossAbove, title="Label Buy Xuất Hiện", message="Label Buy xuất hiện tại giá: {{close}}")
// Cảnh báo khi label Sell xuất hiện
alertcondition(condition=outsideBarCrossBelow, title="Label Sell Xuất Hiện", message="Label Sell xuất hiện tại giá: {{close}}")
Giải thích sửa lỗi:
Loại bỏ gán plotshape vào biến:
Bạn không cần gán plotshape vào biến buyLabel hoặc sellLabel. Thay vào đó, bạn có thể sử dụng trực tiếp điều kiện outsideBarCrossAbove và outsideBarCrossBelow để tạo cảnh báo.
Sử dụng alertcondition:
alertcondition được sử dụng để tạo cảnh báo khi điều kiện outsideBarCrossAbove hoặc outsideBarCrossBelow được đáp ứng.
Kết quả:
Khi label Buy xuất hiện, cảnh báo "Label Buy xuất hiện tại giá: X" sẽ được kích hoạt.
Khi label Sell xuất hiện, cảnh báo "Label Sell xuất hiện tại giá: X" sẽ được kích hoạt.
Lưu ý:
Đảm bảo rằng bạn đã bật cảnh báo trong TradingView để nhận thông báo khi label xuất hiện.
Kiểm tra kỹ lưỡng chiến lược trên dữ liệu lịch sử trước khi sử dụng trong giao dịch thực tế.
New chat
High-Low Breakout Strategy (Long Only)This script is a simple yet effective breakout strategy designed for long-only trades. The logic is straightforward:
- ** Entry Condition **: Enter long when the close price exceeds the previous high.
- ** Exit Condition **: Exit the position when the close price drops below the previous low.
Features:
- Automatically identifies the previous high and low for every bar.
- Displays these levels on the chart for easy reference.
Use this script for backtesting and exploring breakout opportunities in various markets. Let us know your thoughts and how it works for you in the comments!
Disclaimer : This script is for educational purposes only and is not financial advice. Past performance does not guarantee future results.
- Perfect for trend-following traders looking for a mechanical, rule-based approach.
Simple 5-8-13 StrategyThe Simple 5-8-13 SMA Strategy is a trend-following trading system that uses three Simple Moving Averages (SMA) with periods of 5, 8, and 13. The strategy generates buy signals when the shorter-term moving averages cross above the longer-term ones (specifically when SMA5 > SMA8 > SMA13), indicating an upward trend. Sell signals are generated when the shortest moving average falls below both longer averages (SMA5 < SMA8 and SMA5 < SMA13), suggesting a downward trend. This strategy is designed to work on 15-minute timeframes and aims to capture medium-term price movements. Like all trading strategies, it should be used in conjunction with proper risk management and other technical analysis tools.
Daily Trend with ATR Strategy//@version=5
strategy("Daily Trend with ATR Strategy", overlay=true)
// تنظیمات
atrLength = input.int(22, title="ATR Length (Daily)")
atrMultiplier = input.float(3.0, title="ATR Multiplier")
atrH1Length = input.int(24, title="ATR Length (Hourly)")
tolerance = input.float(0.05, title="Tolerance")
// محاسبه ATR روزانه
dailyATR = request.security(syminfo.tickerid, "D", ta.atr(atrLength))
// محاسبه معیار حرکت
moveCriterion = (dailyATR * atrMultiplier) * 0.66
// تعیین روند دیلی
dailyTrendUp = request.security(syminfo.tickerid, "D", close - close >= moveCriterion and ta.change(close ) == ta.change(close ) and ta.change(close ) == ta.change(close ))
dailyTrendDown = request.security(syminfo.tickerid, "D", close - close <= -moveCriterion and ta.change(close ) == ta.change(close ) and ta.change(close ) == ta.change(close ))
// تعیین ناحیه حمایت و مقاومت
resistanceZone = moveCriterion * 0.5
supportZone = moveCriterion * 0.66
// محاسبه ATR ساعتی
hourlyATR = ta.atr(atrH1Length)
// تعیین برخوردها
cond1 = ta.crossover(close, resistanceZone)
cond2 = ta.crossover(close, supportZone)
cond3 = ta.crossunder(close, supportZone)
cond4 = ta.crossunder(close, resistanceZone)
// شناسایی برخوردها با ناحیه
zoneTouches = (cond1 or cond2 or cond3 or cond4)
// بررسی نسبت ATR برخوردها
validTouch = close - open > hourlyATR * (1 + tolerance) or close - open < -hourlyATR * (1 - tolerance)
// شرایط ورود به معامله
longCondition = dailyTrendUp and zoneTouches and validTouch
shortCondition = dailyTrendDown and zoneTouches and validTouch
// ورود به معامله
if (longCondition)
strategy.entry("Buy", strategy.long)
if (shortCondition)
strategy.entry("Sell", strategy.short)
// تنظیم استاپ لاس و تیک پرافیت
stopLoss = hourlyATR
takeProfit = stopLoss * 2
strategy.exit("Exit Buy", from_entry="Buy", loss=stopLoss, profit=takeProfit)
strategy.exit("Exit Sell", from_entry="Sell", loss=stopLoss, profit=takeProfit)
Gap and Breakout Strategy with Buy and Selltrying a different startegy for the everyone who wants to make really good things to the world
prevdayhighlowstrategyjjjj.bjbioıbioıbgiıgbiıuhbi.oujhbioujhbioh
dfisşd,fisşd,fisşd,fisşd,fisdşf,sidfşs,id4
sd,ifsd,fisdşf,isdfşsdfs