OPEN-SOURCE SCRIPT
Fractal Runner Strategy [LuxAlgo]

Follow these exact rules and logic step-by-step:
1. Inputs & Core Components
EMA 1: Length 36 (Source: Close)
EMA 2: Length 100 (Source: Close)
Fractals: Standard Williams Fractals (5-bar period: 2 bars before, 1 center, 2 bars after).
2. Multi-Timeframe Trend Filter (4-Hour Chart)
The indicator must track the trend on the 4-Hour (240 min) timeframe using Market Structure.
4H Uptrend: Higher Highs and Higher Lows.
4H Downtrend: Lower Highs and Lower Lows.
Signals on the current timeframe should only trigger if they align with the 4H trend direction.
3. Entry Conditions
LONG Signal (Buy)
Trigger a "Buy" signal when ALL of the following are true on the 15-minute chart:
Trend Alignment: The 4-Hour trend is Bullish (Higher Highs/Higher Lows).
EMA Alignment: The 36 EMA is strictly ABOVE the 100 EMA.
Pullback Rule: Identify the two most recent Fractal Highs. The most recent Fractal High must be LOWER than the previous Fractal High.
Trigger: Plot a "Buy Stop" level 1 pip ABOVE that most recent Fractal High.
SHORT Signal (Sell)
Trigger a "Sell" signal when ALL of the following are true on the 15-minute chart:
Trend Alignment: The 4-Hour trend is Bearish (Lower Highs/Lower Lows).
EMA Alignment: The 36 EMA is strictly BELOW the 100 EMA.
Pullback Rule: Identify the two most recent Fractal Lows. The most recent Fractal Low must be HIGHER than the previous Fractal Low.
Trigger: Plot a "Sell Stop" level 1 pip BELOW that most recent Fractal Low.
4. Trade Management Visuals (Levels)
When a signal triggers, plot the following levels dynamically on the chart for visual reference:
Entry Price: 1 pip above/below the triggering fractal.
Stop Loss (SL): 1 pip below/above the most recent opposite fractal.
Take Profit (TP): Fixed 1:1 Risk-to-Reward ratio based on the distance between Entry and SL.
5. Visuals & Alerts
Plot a green "▲" shape below the bar for a Buy Setup.
Plot a red "▼" shape above the bar for a Sell Setup.
Include alertcondition() functions for both Buy and Sell setups so I can set up real-time notifications.
1. Inputs & Core Components
EMA 1: Length 36 (Source: Close)
EMA 2: Length 100 (Source: Close)
Fractals: Standard Williams Fractals (5-bar period: 2 bars before, 1 center, 2 bars after).
2. Multi-Timeframe Trend Filter (4-Hour Chart)
The indicator must track the trend on the 4-Hour (240 min) timeframe using Market Structure.
4H Uptrend: Higher Highs and Higher Lows.
4H Downtrend: Lower Highs and Lower Lows.
Signals on the current timeframe should only trigger if they align with the 4H trend direction.
3. Entry Conditions
LONG Signal (Buy)
Trigger a "Buy" signal when ALL of the following are true on the 15-minute chart:
Trend Alignment: The 4-Hour trend is Bullish (Higher Highs/Higher Lows).
EMA Alignment: The 36 EMA is strictly ABOVE the 100 EMA.
Pullback Rule: Identify the two most recent Fractal Highs. The most recent Fractal High must be LOWER than the previous Fractal High.
Trigger: Plot a "Buy Stop" level 1 pip ABOVE that most recent Fractal High.
SHORT Signal (Sell)
Trigger a "Sell" signal when ALL of the following are true on the 15-minute chart:
Trend Alignment: The 4-Hour trend is Bearish (Lower Highs/Lower Lows).
EMA Alignment: The 36 EMA is strictly BELOW the 100 EMA.
Pullback Rule: Identify the two most recent Fractal Lows. The most recent Fractal Low must be HIGHER than the previous Fractal Low.
Trigger: Plot a "Sell Stop" level 1 pip BELOW that most recent Fractal Low.
4. Trade Management Visuals (Levels)
When a signal triggers, plot the following levels dynamically on the chart for visual reference:
Entry Price: 1 pip above/below the triggering fractal.
Stop Loss (SL): 1 pip below/above the most recent opposite fractal.
Take Profit (TP): Fixed 1:1 Risk-to-Reward ratio based on the distance between Entry and SL.
5. Visuals & Alerts
Plot a green "▲" shape below the bar for a Buy Setup.
Plot a red "▼" shape above the bar for a Sell Setup.
Include alertcondition() functions for both Buy and Sell setups so I can set up real-time notifications.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Regards
Ramchandhar Rapolu
Ramchandhar Rapolu
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Regards
Ramchandhar Rapolu
Ramchandhar Rapolu
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.