OPEN-SOURCE SCRIPT
AetherEdge - Self-Evolving S/R

🖊️ Overview
AE-SESR is a self-evolving S/R engine that auto-detects support/resistance and applies a reinforcement-learning reward concept to evolve only the levels that actually work. Every bounce off a level earns it score; every break decisively through it deducts. Only the top 3 levels are ever shown, so the chart stays uncluttered and only the most meaningful battle lines remain.
🔶 Key Features
Auto-detection: candidates harvested from confirmed swings (non-repainting)
RL-style scoring: bounce = reward, break = penalty teaches each level's value
Top-3-only display: strongest resistance above, strongest support below, plus the next-best
Strength-scaled line thickness: more reliable levels draw thicker
Labels show bounce count and current score
Time decay: old levels naturally fade; new performance rises
HUD shows the strongest R/S levels, their strength, and hit counts
🧠 Technical Architecture
This tool is not a full reinforcement-learning agent but reproduces its core idea — learn action values from experience, prefer high-value actions — as an online value table. Confirmed swing highs/lows (ta.pivothigh/low) become S/R candidates; nearby candidates merge into existing ones. Each candidate holds a score (its value). When price reaches a level, the subsequent move classifies it as a bounce (significant move against the approach) or a break (significant move through), updating score via reward or penalty. All scores time-decay each bar, keeping the system adaptive rather than over-anchored to old history. Levels whose score goes negative are auto-pruned, preventing pool bloat. The display picks three: the strongest resistance above price, the strongest support below, and a third slot for the next-best remaining — ranked ★1/★2/★3 by score, with line thickness proportional to score.
⚙️ Recommended Settings & Tuning Guide
Tuned with crypto in mind. Pivot Confirmation Bars near 8 is a starting point — larger captures only major levels, smaller picks up finer structure. Touch Proximity (ATR), the distance at which a level counts as "touched," defaults to 0.5 (typically fine). Score Decay is the time-decay rate; default 0.995 (0.5% decay per bar). In fast-rotating regimes, lower it (e.g., 0.99) to weight recent behavior more. Merge Distance (%) controls how close candidates consolidate — lower it on dense instruments to keep them separate.
💡 How to Use in Practice
The three displayed lines are the most performance-proven levels on this instrument. The thickest ★1 line is the highest-conviction wall right now — moments where price approaches it are candidates for bounce entries or take-profit exits. The "×N" label counts past bounces — the larger N, the more historically reliable. During regime shifts, new levels enter the top 3 while old ones decay away, visible as self-evolution. Pair with trend/structure tools and prioritize levels where AE-SESR lines align with other evidence.
⚠️ Important Notes
This tool is RL-style, not a true reinforcement-learning agent; within Pine's constraints it reproduces the core idea as experience-based level scoring. Because it's based on confirmed swings, candidates enter the pool with a few bars' delay — a necessary property of the non-repainting design. Scores need accumulated touches to become meaningful, so new instruments or short-window charts may show fewer levels.
🚨 Disclaimer
This indicator is provided for educational and informational purposes only and does not constitute financial or investment advice. No level guarantees future prices, and past performance does not indicate future results. All trading decisions are made at your own risk.
AE-SESR is a self-evolving S/R engine that auto-detects support/resistance and applies a reinforcement-learning reward concept to evolve only the levels that actually work. Every bounce off a level earns it score; every break decisively through it deducts. Only the top 3 levels are ever shown, so the chart stays uncluttered and only the most meaningful battle lines remain.
🔶 Key Features
Auto-detection: candidates harvested from confirmed swings (non-repainting)
RL-style scoring: bounce = reward, break = penalty teaches each level's value
Top-3-only display: strongest resistance above, strongest support below, plus the next-best
Strength-scaled line thickness: more reliable levels draw thicker
Labels show bounce count and current score
Time decay: old levels naturally fade; new performance rises
HUD shows the strongest R/S levels, their strength, and hit counts
🧠 Technical Architecture
This tool is not a full reinforcement-learning agent but reproduces its core idea — learn action values from experience, prefer high-value actions — as an online value table. Confirmed swing highs/lows (ta.pivothigh/low) become S/R candidates; nearby candidates merge into existing ones. Each candidate holds a score (its value). When price reaches a level, the subsequent move classifies it as a bounce (significant move against the approach) or a break (significant move through), updating score via reward or penalty. All scores time-decay each bar, keeping the system adaptive rather than over-anchored to old history. Levels whose score goes negative are auto-pruned, preventing pool bloat. The display picks three: the strongest resistance above price, the strongest support below, and a third slot for the next-best remaining — ranked ★1/★2/★3 by score, with line thickness proportional to score.
⚙️ Recommended Settings & Tuning Guide
Tuned with crypto in mind. Pivot Confirmation Bars near 8 is a starting point — larger captures only major levels, smaller picks up finer structure. Touch Proximity (ATR), the distance at which a level counts as "touched," defaults to 0.5 (typically fine). Score Decay is the time-decay rate; default 0.995 (0.5% decay per bar). In fast-rotating regimes, lower it (e.g., 0.99) to weight recent behavior more. Merge Distance (%) controls how close candidates consolidate — lower it on dense instruments to keep them separate.
💡 How to Use in Practice
The three displayed lines are the most performance-proven levels on this instrument. The thickest ★1 line is the highest-conviction wall right now — moments where price approaches it are candidates for bounce entries or take-profit exits. The "×N" label counts past bounces — the larger N, the more historically reliable. During regime shifts, new levels enter the top 3 while old ones decay away, visible as self-evolution. Pair with trend/structure tools and prioritize levels where AE-SESR lines align with other evidence.
⚠️ Important Notes
This tool is RL-style, not a true reinforcement-learning agent; within Pine's constraints it reproduces the core idea as experience-based level scoring. Because it's based on confirmed swings, candidates enter the pool with a few bars' delay — a necessary property of the non-repainting design. Scores need accumulated touches to become meaningful, so new instruments or short-window charts may show fewer levels.
🚨 Disclaimer
This indicator is provided for educational and informational purposes only and does not constitute financial or investment advice. No level guarantees future prices, and past performance does not indicate future results. All trading decisions are made at your own risk.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.