DCA Order คืออะไร
DCA Dollar Cost Averaging ซื้อเฉลี่ยต้นทุน หุ้น Bitcoin ETF กองทุน ลงทุนสม่ำเสมอ ลด Risk Timing Emotional Bias
| กลยุทธ์ | วิธี | Risk | เหมาะกับ | ผลตอบแทน |
|---|---|---|---|---|
| DCA | ซื้อเท่ากันทุกงวด | ต่ำ | มือใหม่ ไม่มีเวลา | ปานกลาง-ดี (ระยะยาว) |
| Lump Sum | ซื้อทั้งก้อนทีเดียว | สูง | มีเงินก้อน ตลาดขาขึ้น | สูงกว่า DCA 60-70% |
| Value Averaging | ซื้อมากเมื่อราคาลง น้อยเมื่อขึ้น | ปานกลาง | มีประสบการณ์ | ดีกว่า DCA เล็กน้อย |
| DCA + Technical | DCA แต่เพิ่มเมื่อ Oversold | ปานกลาง | มีความรู้ Technical | ดีกว่า DCA ธรรมดา |
DCA Calculator
# === DCA Calculator ===
from dataclasses import dataclass
@dataclass
class DCAMonth:
month: int
price: float
invest_amount: float
units_bought: float
total_units: float
total_invested: float
avg_cost: float
current_value: float
profit_loss: float
profit_pct: float
def calculate_dca(prices, monthly_invest):
results = []
total_units = 0
total_invested = 0
for i, price in enumerate(prices):
units = monthly_invest / price
total_units += units
total_invested += monthly_invest
avg_cost = total_invested / total_units
current_value = total_units * price
pl = current_value - total_invested
pl_pct = (pl / total_invested) * 100
results.append(DCAMonth(
i+1, price, monthly_invest, units,
total_units, total_invested, avg_cost,
current_value, pl, pl_pct
))
return results
# ตัวอย่าง: DCA ซื้อ BTC 5,000 บาท/เดือน
btc_prices = [1000000, 800000, 1200000, 900000,
1100000, 750000, 950000, 1050000,
1150000, 1300000, 1000000, 1400000]
results = calculate_dca(btc_prices, 5000)
print("=== DCA Bitcoin 5,000 THB/month ===")
print(f"{'Month':>5} {'Price':>10} {'Units':>10} {'Total':>10} {'Avg Cost':>10} {'P/L%':>8}")
for r in results:
print(f"{r.month:>5} {r.price:>10,.0f} {r.units_bought:>10.6f} "
f"{r.total_invested:>10,.0f} {r.avg_cost:>10,.0f} {r.profit_pct:>7.1f}%")
final = results[-1]
print(f"\nTotal Invested: {final.total_invested:,.0f} THB")
print(f"Total BTC: {final.total_units:.6f}")
print(f"Avg Cost: {final.avg_cost:,.0f} THB/BTC")
print(f"Current Value: {final.current_value:,.0f} THB")
print(f"Profit/Loss: {final.profit_loss:,.0f} THB ({final.profit_pct:.1f}%)")
DCA Bot
# === DCA Auto Bot (Conceptual) ===
# Bitkub API DCA Bot Example
# import hmac, hashlib, time, requests
#
# API_KEY = "YOUR_API_KEY"
# API_SECRET = "YOUR_API_SECRET"
# BASE_URL = "https://api.bitkub.com"
#
# def create_buy_order(symbol, amount_thb):
# ts = str(int(time.time()))
# payload = {
# "sym": symbol,
# "amt": amount_thb,
# "rat": 0, # 0 = Market Order
# "typ": "market",
# "ts": ts
# }
# sig = hmac.new(API_SECRET.encode(), json.dumps(payload).encode(), hashlib.sha256).hexdigest()
# headers = {"X-BTK-APIKEY": API_KEY, "Content-Type": "application/json"}
# payload["sig"] = sig
# response = requests.post(f"{BASE_URL}/api/market/place-bid", json=payload, headers=headers)
# return response.json()
@dataclass
class DCASchedule:
platform: str
asset: str
amount: str
frequency: str
fee: str
auto: bool
schedules = [
DCASchedule("Bitkub",
"Bitcoin (BTC)",
"5,000 THB",
"ทุกวันจันทร์",
"0.25% Maker / 0.25% Taker",
True),
DCASchedule("Binance",
"Bitcoin + Ethereum",
"$100 each",
"ทุกสัปดาห์",
"0.1% (ลดด้วย BNB)",
True),
DCASchedule("Finnomena",
"กองทุน S&P500 (TMBUS500)",
"10,000 THB",
"ทุกเดือน วันที่ 1",
"0% Front-end (บาง Fund)",
True),
DCASchedule("Settrade",
"หุ้น SET50 ETF (TDEX)",
"5,000 THB",
"ทุกเดือน วันที่ 15",
"0.15% Commission",
True),
DCASchedule("Python Bot",
"Custom (API ตาม Exchange)",
"ตั้งเอง",
"ตั้งเอง (Cron Job)",
"ตาม Exchange",
True),
]
print("=== DCA Schedules ===")
for s in schedules:
print(f" [{s.platform}] {s.asset}")
print(f" Amount: {s.amount} | Freq: {s.frequency}")
print(f" Fee: {s.fee} | Auto: {s.auto}")
DCA Strategy Tips
# === DCA Strategy Comparison ===
@dataclass
class Strategy:
name: str
method: str
when_to_use: str
expected_return: str
difficulty: str
strategies = [
Strategy("Standard DCA",
"ซื้อจำนวนเงินเท่ากันทุกงวด ไม่สนราคา",
"ทุกสถานการณ์ ตลาดขาขึ้น ขาลง Sideways",
"ปานกลาง ดีกว่า Lump Sum ในตลาดผันผวน",
"ง่ายมาก ตั้งอัตโนมัติ"),
Strategy("Enhanced DCA",
"DCA ปกติ + เพิ่ม 2x เมื่อราคาลง > 20%",
"ตลาดมี Correction/Crash บ่อย",
"ดีกว่า Standard DCA 5-15%",
"ปานกลาง ต้องดูราคาบ้าง"),
Strategy("DCA + RSI",
"DCA ปกติ + เพิ่มเมื่อ RSI < 30 (Oversold)",
"สินทรัพย์ที่มี Clear Cycle",
"ดีกว่า Standard DCA 10-20%",
"ยาก ต้องรู้ Technical"),
Strategy("Value Averaging",
"ซื้อให้ Portfolio เพิ่มเท่ากันทุกงวด ซื้อมาก/น้อยตามราคา",
"สินทรัพย์ Volatile สูง",
"ดีกว่า DCA เล็กน้อย แต่ต้องมีเงินสำรอง",
"ปานกลาง-ยาก"),
]
print("=== DCA Strategies ===")
for s in strategies:
print(f"\n [{s.name}]")
print(f" Method: {s.method}")
print(f" When: {s.when_to_use}")
print(f" Return: {s.expected_return}")
print(f" Difficulty: {s.difficulty}")
เคล็ดลับ
- อัตโนมัติ: ตั้ง DCA อัตโนมัติ อย่าพึ่งวินัยตัวเอง
- ระยะยาว: DCA ได้ผลดีที่สุดเมื่อลงทุน 3-10 ปี
- ค่า Fee: เลือกแพลตฟอร์มค่าธรรมเนียมต่ำ
- อย่าหยุด: อย่าหยุดซื้อเมื่อราคาลง นั่นคือโอกาส
- กระจาย: DCA หลายสินทรัพย์ ไม่ใส่ตะกร้าเดียว
การนำความรู้ไปประยุกต์ใช้งานจริง
แหล่งเรียนรู้ที่แนะนำ ได้แก่ Official Documentation ที่อัพเดทล่าสุดเสมอ Online Course จาก Coursera Udemy edX ช่อง YouTube คุณภาพทั้งไทยและอังกฤษ และ Community อย่าง Discord Reddit Stack Overflow ที่ช่วยแลกเปลี่ยนประสบการณ์กับนักพัฒนาทั่วโลก
เปรียบเทียบข้อดีและข้อเสีย
จากตารางเปรียบเทียบจะเห็นว่าข้อดีมีมากกว่าข้อเสียอย่างชัดเจน โดยเฉพาะในแง่ของประสิทธิภาพและความสามารถในการ Scale สำหรับข้อเสียส่วนใหญ่สามารถแก้ไขได้ด้วยการเรียนรู้อย่างเป็นระบบและวางแผนทรัพยากรให้เหมาะสม
DCA คืออะไร
Dollar Cost Averaging ซื้อเฉลี่ยต้นทุน จำนวนเงินเท่ากัน สม่ำเสมอ ไม่สนราคา ลด Risk Timing หุ้น BTC ETF กองทุน ระยะยาว
คำนวณอย่างไร
ต้นทุนเฉลี่ย = เงินรวม ÷ หน่วยรวม ราคาถูกซื้อมาก ราคาแพงซื้อน้อย เฉลี่ยต่ำกว่าค่าเฉลี่ยราคา Python Calculator Tracker
ข้อดีข้อเสียมีอะไร
ดี ไม่ต้อง Timing ลด Risk วินัย ง่าย มือใหม่ เสีย Lump Sum อาจดีกว่า Fee สะสม ไม่เหมาะ Downtrend ยาว ต้องมีวินัย
เครื่องมือมีอะไร
Bitkub Binance Auto-Invest Finnomena Settrade Jitta Python Bot Google Sheets DCA Tracker ตั้งอัตโนมัติ Fee ต่ำ ทุกสัปดาห์
สรุป
DCA Dollar Cost Averaging ซื้อเฉลี่ยต้นทุน หุ้น BTC ETF กองทุน อัตโนมัติ ลด Risk ระยะยาว Calculator Bot Strategy
