SiamCafe.net Blog
Technology

support and resistance stock

support and resistance stock
support and resistance stock | SiamCafe Blog
2025-11-05· อ. บอม — SiamCafe.net· 1,683 คำ

Support and Resistance Stock — แนวรับแนวต้านหุ้น 2026

Support (แนวรับ) และ Resistance (แนวต้าน) เป็นแนวคิดพื้นฐานที่สำคัญที่สุดใน Technical Analysis สำหรับการเทรดหุ้น Support คือระดับราคาที่มีแรงซื้อมากพอจะหยุดไม่ให้ราคาลงต่อ Resistance คือระดับราคาที่มีแรงขายมากพอจะหยุดไม่ให้ราคาขึ้นต่อ การเข้าใจ Support/Resistance ช่วยให้เทรดเดอร์หาจุด entry/exit ที่ดี ตั้ง stop loss ที่เหมาะสม และเข้าใจ market structure บทความนี้อธิบายวิธีหาและใช้แนวรับแนวต้านอย่างละเอียด พร้อม Python tools

Support & Resistance Fundamentals

# sr_basics.py — Support and Resistance fundamentals
import json

class SRBasics:
    CONCEPTS = {
        "support": {
            "name": "Support (แนวรับ)",
            "definition": "ระดับราคาที่ demand (แรงซื้อ) มากกว่า supply (แรงขาย)",
            "psychology": "ผู้ซื้อเห็นว่าราคาถูก → เข้าซื้อ → ราคาหยุดลง/ดีดกลับ",
            "action": "Buy เมื่อราคาลงมาถึง support (ถ้า support ยังแข็งแรง)",
            "break": "ถ้า support หัก (break down) → กลายเป็น resistance ใหม่",
        },
        "resistance": {
            "name": "Resistance (แนวต้าน)",
            "definition": "ระดับราคาที่ supply (แรงขาย) มากกว่า demand (แรงซื้อ)",
            "psychology": "ผู้ขายเห็นว่าราคาแพง → เข้าขาย → ราคาหยุดขึ้น/ตกลง",
            "action": "Sell เมื่อราคาขึ้นมาถึง resistance (ถ้า resistance ยังแข็งแรง)",
            "break": "ถ้า resistance หัก (breakout) → กลายเป็น support ใหม่",
        },
    }

    TYPES = {
        "horizontal": {
            "name": "Horizontal S/R",
            "description": "เส้นแนวนอนที่ราคาเคยหยุดหลายครั้ง — classic S/R",
            "strength": "ยิ่งราคาเด้งที่ level เดิมหลายครั้ง = ยิ่งแข็งแรง",
        },
        "trendline": {
            "name": "Trendline S/R",
            "description": "เส้น trend ที่ลากผ่าน highs (resistance) หรือ lows (support)",
            "strength": "ยิ่งมี touch points มาก = ยิ่ง valid",
        },
        "moving_average": {
            "name": "Moving Average S/R",
            "description": "MA เป็น dynamic S/R — SMA 50, SMA 200 เป็น key levels",
            "strength": "MA period ยาว (200) แข็งแรงกว่า period สั้น (20)",
        },
        "fibonacci": {
            "name": "Fibonacci Retracement S/R",
            "description": "Fibonacci levels (38.2%, 50%, 61.8%) เป็น S/R ธรรมชาติ",
            "strength": "61.8% (golden ratio) เป็น level ที่สำคัญที่สุด",
        },
        "round_numbers": {
            "name": "Round Number S/R",
            "description": "ตัวเลขกลมๆ เช่น 100, 500, 1000 เป็น psychological S/R",
            "strength": "ตัวเลขสำคัญ: ราคาหุ้น 100, SET Index 1500, S&P 500 ที่ 5000",
        },
    }

    def show_concepts(self):
        print("=== S/R Concepts ===\n")
        for key, concept in self.CONCEPTS.items():
            print(f"[{concept['name']}]")
            print(f"  Definition: {concept['definition']}")
            print(f"  Break: {concept['break']}")
            print()

    def show_types(self):
        print("=== Types of S/R ===")
        for key, t in self.TYPES.items():
            print(f"\n[{t['name']}]")
            print(f"  {t['description']}")

basics = SRBasics()
basics.show_concepts()
basics.show_types()

วิธีหา Support & Resistance

# find_sr.py — How to find support and resistance
import json

class FindSR:
    METHODS = {
        "swing_points": {
            "name": "1. Swing Highs/Lows",
            "description": "หาจุดที่ราคาเปลี่ยนทิศ — swing high = local peak, swing low = local trough",
            "steps": [
                "ดู chart — หาจุดที่ราคาขึ้นแล้วกลับลง (swing high) = potential resistance",
                "หาจุดที่ราคาลงแล้วกลับขึ้น (swing low) = potential support",
                "Level ที่มี swing points หลายจุด = strong S/R",
            ],
        },
        "volume_profile": {
            "name": "2. Volume Profile",
            "description": "ดู volume ที่แต่ละ price level — high volume = strong S/R",
            "steps": [
                "ใช้ Volume Profile indicator",
                "Price level ที่มี volume สูง (HVN) = strong S/R",
                "Price level ที่มี volume ต่ำ (LVN) = weak S/R, ราคาผ่านเร็ว",
            ],
        },
        "previous_close": {
            "name": "3. Previous Day/Week/Month Close",
            "description": "ราคาปิดของ timeframe ก่อนหน้า = S/R ที่สำคัญ",
            "steps": [
                "Previous day close — intraday S/R",
                "Previous week close — swing trade S/R",
                "Previous month close — position trade S/R",
            ],
        },
        "gaps": {
            "name": "4. Price Gaps",
            "description": "Gap (ช่องว่าง) ในราคา = S/R — ราคามักจะ fill gap",
            "steps": [
                "Gap up: ขอบล่างของ gap = support",
                "Gap down: ขอบบนของ gap = resistance",
                "Unfilled gaps = strong S/R until filled",
            ],
        },
    }

    QUALITY = {
        "touches": "จำนวนครั้งที่ราคาเด้ง — 2+ ครั้ง = confirmed S/R",
        "timeframe": "S/R บน timeframe ใหญ่ (Weekly, Monthly) แข็งแรงกว่า timeframe เล็ก",
        "volume": "S/R ที่มี volume สูง = แข็งแรงกว่า",
        "recency": "S/R ที่เกิดเร็วๆ นี้ = relevant กว่า S/R เก่า",
        "confluence": "S/R ที่ตรงกับ MA, Fibonacci, round number = very strong",
    }

    def show_methods(self):
        print("=== Methods to Find S/R ===\n")
        for key, method in self.METHODS.items():
            print(f"[{method['name']}]")
            print(f"  {method['description']}")
            for step in method['steps'][:2]:
                print(f"    • {step}")
            print()

    def show_quality(self):
        print("=== S/R Quality Factors ===")
        for factor, desc in self.QUALITY.items():
            print(f"  [{factor}] {desc}")

finder = FindSR()
finder.show_methods()
finder.show_quality()

Python S/R Detector

# sr_detector.py — Python support/resistance detection
import json

class SRDetector:
    CODE = """
# detect_sr.py — Automated S/R detection with Python
import pandas as pd
import numpy as np

class SupportResistanceDetector:
    def __init__(self, data):
        '''data: DataFrame with OHLCV columns'''
        self.data = data.copy()
    
    def find_swing_points(self, window=5):
        '''Find swing highs and lows'''
        df = self.data.copy()
        
        # Swing highs: local maxima
        df['swing_high'] = df['High'][
            (df['High'] == df['High'].rolling(window*2+1, center=True).max())
        ]
        
        # Swing lows: local minima
        df['swing_low'] = df['Low'][
            (df['Low'] == df['Low'].rolling(window*2+1, center=True).min())
        ]
        
        highs = df['swing_high'].dropna().tolist()
        lows = df['swing_low'].dropna().tolist()
        
        return {'swing_highs': highs, 'swing_lows': lows}
    
    def cluster_levels(self, prices, tolerance_pct=1.0):
        '''Cluster nearby price levels into zones'''
        if not prices:
            return []
        
        prices = sorted(prices)
        clusters = []
        current_cluster = [prices[0]]
        
        for price in prices[1:]:
            if abs(price - current_cluster[-1]) / current_cluster[-1] * 100 <= tolerance_pct:
                current_cluster.append(price)
            else:
                clusters.append({
                    'level': round(np.mean(current_cluster), 2),
                    'touches': len(current_cluster),
                    'zone_high': round(max(current_cluster), 2),
                    'zone_low': round(min(current_cluster), 2),
                })
                current_cluster = [price]
        
        if current_cluster:
            clusters.append({
                'level': round(np.mean(current_cluster), 2),
                'touches': len(current_cluster),
                'zone_high': round(max(current_cluster), 2),
                'zone_low': round(min(current_cluster), 2),
            })
        
        return sorted(clusters, key=lambda x: -x['touches'])
    
    def find_support_resistance(self, window=5, tolerance_pct=1.5):
        '''Find support and resistance levels'''
        swings = self.find_swing_points(window)
        
        resistance = self.cluster_levels(swings['swing_highs'], tolerance_pct)
        support = self.cluster_levels(swings['swing_lows'], tolerance_pct)
        
        current_price = self.data['Close'].iloc[-1]
        
        # Classify relative to current price
        above = [r for r in resistance if r['level'] > current_price]
        below = [s for s in support if s['level'] < current_price]
        
        return {
            'current_price': round(current_price, 2),
            'resistance_levels': above[:5],
            'support_levels': below[:5],
            'nearest_resistance': above[0] if above else None,
            'nearest_support': below[0] if below else None,
        }
    
    def find_ma_levels(self, periods=[20, 50, 100, 200]):
        '''Find moving average S/R levels'''
        current_price = self.data['Close'].iloc[-1]
        levels = []
        
        for period in periods:
            if len(self.data) >= period:
                ma = self.data['Close'].rolling(period).mean().iloc[-1]
                levels.append({
                    'type': f'SMA {period}',
                    'level': round(ma, 2),
                    'role': 'support' if ma < current_price else 'resistance',
                    'distance_pct': round(abs(current_price - ma) / current_price * 100, 2),
                })
        
        return levels

# import yfinance as yf
# data = yf.download("AAPL", period="1y")
# detector = SupportResistanceDetector(data)
# sr = detector.find_support_resistance()
# ma = detector.find_ma_levels()
"""

    def show_code(self):
        print("=== S/R Detector ===")
        print(self.CODE[:600])

detector = SRDetector()
detector.show_code()

Trading Strategies กับ S/R

# strategies.py — Trading strategies with S/R
import json

class SRStrategies:
    STRATEGIES = {
        "bounce": {
            "name": "Bounce Strategy (เด้ง)",
            "description": "Buy ที่ support, Sell ที่ resistance — range-bound market",
            "entry": "ราคาลงมา support + confirmation (bullish candle, RSI oversold)",
            "stop": "ใต้ support 1-2 ATR",
            "target": "Resistance level ถัดไป",
            "best_for": "Sideways/range-bound markets",
        },
        "breakout": {
            "name": "Breakout Strategy (ทะลุ)",
            "description": "Buy เมื่อ breakout resistance, Sell เมื่อ breakdown support",
            "entry": "ราคาทะลุ resistance + volume สูง + close เหนือ level",
            "stop": "กลับมาใต้ breakout level",
            "target": "Next resistance level หรือ measured move",
            "best_for": "Trending markets, after consolidation",
        },
        "retest": {
            "name": "Retest Strategy (ทดสอบซ้ำ)",
            "description": "รอ breakout → รอ retest → entry ที่ retest",
            "entry": "ราคา breakout resistance → pullback มา test (resistance → support) → buy",
            "stop": "ใต้ retest level",
            "target": "Measured move = distance of consolidation range",
            "best_for": "High-probability entries, patient traders",
        },
    }

    RISK_MANAGEMENT = {
        "stop_loss": "วาง stop ใต้/เหนือ S/R level — ไม่วางที่ level พอดี (ถูก stop hunt)",
        "position_size": "Risk 1-2% ของ account ต่อ trade",
        "risk_reward": "ขั้นต่ำ 1:2 — entry ถึง stop loss : entry ถึง target",
        "multiple_levels": "ใช้ S/R หลาย levels — partial take profit ที่แต่ละ level",
    }

    def show_strategies(self):
        print("=== S/R Trading Strategies ===\n")
        for key, s in self.STRATEGIES.items():
            print(f"[{s['name']}]")
            print(f"  Entry: {s['entry']}")
            print(f"  Stop: {s['stop']}")
            print(f"  Target: {s['target']}")
            print()

    def show_risk(self):
        print("=== Risk Management ===")
        for rule, desc in self.RISK_MANAGEMENT.items():
            print(f"  [{rule}] {desc}")

strategies = SRStrategies()
strategies.show_strategies()
strategies.show_risk()

Common Mistakes

# mistakes.py — Common S/R mistakes
import json

class CommonMistakes:
    MISTAKES = {
        "exact_price": {
            "name": "ใช้ราคาที่แม่นยำเกินไป",
            "wrong": "Support อยู่ที่ 100.00 พอดี → ตั้ง buy ที่ 100.00",
            "right": "S/R เป็น zone ไม่ใช่เส้น — ใช้ zone 98-102 แทน",
        },
        "ignore_timeframe": {
            "name": "ไม่ดู timeframe ที่ใหญ่กว่า",
            "wrong": "ดูแค่ chart 5 นาที → พลาด S/R ที่สำคัญบน Daily",
            "right": "เริ่มจาก Weekly → Daily → 4H → 1H — S/R ใหญ่สำคัญกว่า",
        },
        "too_many_lines": {
            "name": "วาดเส้นเยอะเกินไป",
            "wrong": "วาด S/R ทุก swing point → chart รก ตัดสินใจไม่ได้",
            "right": "เลือกเฉพาะ S/R ที่มี 2+ touches + volume สูง + timeframe ใหญ่",
        },
        "no_confirmation": {
            "name": "ไม่รอ confirmation",
            "wrong": "ราคาแตะ support → buy เลย → support หัก → ขาดทุน",
            "right": "รอ bullish candle pattern + volume + RSI confirmation ก่อน entry",
        },
    }

    def show_mistakes(self):
        print("=== Common Mistakes ===\n")
        for key, m in self.MISTAKES.items():
            print(f"[{m['name']}]")
            print(f"  Wrong: {m['wrong']}")
            print(f"  Right: {m['right']}")
            print()

mistakes = CommonMistakes()
mistakes.show_mistakes()

FAQ - คำถามที่พบบ่อย

Q: Support/Resistance ใช้กับหุ้นไทยได้ไหม?

A: ได้ — S/R ใช้ได้กับทุกตลาดที่มี chart หุ้นไทย (SET): ใช้ได้ดีกับ large-cap (SET50) — volume สูง, institutional activity Timeframe: Daily และ Weekly ดีที่สุดสำหรับหุ้นไทย Round numbers สำคัญ: ราคาหุ้น 100, 500, SET Index ที่ 1400, 1500 เครื่องมือ: Settrade streaming, TradingView — รองรับหุ้นไทย

Q: S/R หักแล้วจะเกิดอะไร?

A: Role reversal: Support หัก → กลายเป็น Resistance ใหม่ Resistance หัก → กลายเป็น Support ใหม่ เหตุผล: คนที่ซื้อที่ support แล้วราคาหัก → อยากขายคืนทุนเมื่อราคากลับมา = resistance ใช้: รอ retest ที่ level เดิมหลัง break → entry ในทิศทาง break

Q: ใช้ timeframe ไหนดีที่สุด?

A: ขึ้นกับ style: Day trading: 15min-1H S/R + Daily สำหรับ key levels Swing trading: Daily-4H S/R + Weekly สำหรับ key levels Position trading: Weekly-Monthly S/R กฎ: เริ่มจาก timeframe ใหญ่ → ลงมา timeframe เล็ก S/R ที่ตรงกันหลาย timeframes = very strong (confluence)

Q: S/R กับ Supply/Demand Zone ต่างกันอย่างไร?

A: S/R: เส้นหรือ level ที่ราคาเคยหยุด — based on historical price levels Supply/Demand Zone: area/zone ที่มี institutional orders — based on order flow S/R: ง่ายกว่า เรียนรู้เร็ว เหมาะ beginners Supply/Demand: ลึกกว่า precise กว่า เหมาะ advanced traders ใช้ร่วมกัน: S/R เป็น overview + Supply/Demand สำหรับ precise entries

📖 บทความที่เกี่ยวข้อง

xauusd support resistance levels may 1 2025อ่านบทความ → stocks resistance and supportอ่านบทความ → stock support and resistance levelsอ่านบทความ → indicator for support and resistanceอ่านบทความ → metatrader support and resistance indicatorอ่านบทความ →

📚 ดูบทความทั้งหมด →