NS
LME Trade Planning
New Solutions Thailand
{{ t.label }} {{ fmt(t.price, t.dp) }} {{ t.pct >= 0 ? '▲' : '▼' }} {{ Math.abs(t.pct).toFixed(2) }}%
{{ m.label }}
{{ m.unit }}
{{ m.signal.replace('_',' ').toUpperCase() }}
{{ fmt(m.price, m.dp) }}
{{ m.pct >= 0 ? '▲' : '▼' }} {{ Math.abs(m.pct).toFixed(2) }}%
1D
{{ (m.pct_1d>=0?'+':'') }}{{ m.pct_1d.toFixed(2) }}%
1W
{{ (m.pct_1w>=0?'+':'') }}{{ m.pct_1w.toFixed(2) }}%
1M
{{ (m.pct_1m>=0?'+':'') }}{{ m.pct_1m.toFixed(2) }}%
Trend
{{ m.trend === 'bullish' ? '📈' : m.trend === 'bearish' ? '📉' : '➡️' }} {{ m.trend.toUpperCase() }}
ต้นทุนวันนี้ (Base Case)
{{ fmt(m.cost_thb, 2) }} บาท/กก.
{{ m.cost_delta >= 0 ? '▲' : '▼' }} {{ Math.abs(m.cost_delta).toFixed(2) }} บาท vs เมื่อวาน
📊 Market Snapshot
7-day price action — 3 markets overlaid
🤖 {{ plan.metal === 'copper' ? '🟠 Copper' : '⚪ Aluminium' }} Action Plan
{{ plan.urgency }}
{{ plan.headline_th }}
{{ line }}
{{ plan.signal.replace('_',' ').toUpperCase() }} 🏆 Best: {{ plan.best_product_code }} #{{ t }} Conf {{ Math.round(plan.ai_confidence * 100) }}%
💭 ดูเหตุผลประกอบ
{{ plan.reasoning_th }}
📰 ข่าวสำคัญวันนี้ (impact ≥ 3)
{{ n.impact_score }}
/5
{{ n.title }}
{{ n.summary_th }}
#{{ t }}
CU: {{ n.impact_copper }} AL: {{ n.impact_aluminium }}
{{ activeTab === 'copper' ? '🟠 LME Copper 3M' : '⚪ LME Aluminium 3M' }}
Candlestick + Indicators
{{ s.label }}
{{ s.value }}
{{ s.sub }}
⚙️ Cost Inputs
% เทียบ LME (ต่อเกรดนี้)
💰 ราคารับซื้อ
{{ fmt(calc.buyPrice, 2) }}
บาท/กก. · {{ calc.buyPct }}% ของ LME
📤 ขายส่งออก
{{ fmt(calc.exportPrice, 2) }}
บาท/กก. · {{ calc.exportPct }}% ของ LME
🇹🇭 ขายในประเทศ
{{ fmt(calc.domesticPrice, 2) }}
บาท/กก. · {{ calc.domesticPct }}% ของ LME
📊 Margin Breakdown (ต่อ 1 กก. รับซื้อ)
รายการ Export Domestic
ราคาขาย (บาท/กก.) {{ fmt(calc.exportPrice, 2) }} {{ fmt(calc.domesticPrice, 2) }}
− ราคาซื้อ −{{ fmt(calc.buyPrice, 2) }} −{{ fmt(calc.buyPrice, 2) }}
× Yield {{ calc.yieldPct }}% ×{{ (calc.yieldPct/100).toFixed(2) }} ×{{ (calc.yieldPct/100).toFixed(2) }}
− Processing + Freight + Handling −{{ fmt(calc.processing + calc.freight + calc.handling, 2) }} −{{ fmt(calc.processing + calc.handling, 2) }}
Margin สุทธิ {{ calc.marginExport >= 0 ? '+' : '' }}{{ fmt(calc.marginExport, 2) }} {{ calc.marginDomestic >= 0 ? '+' : '' }}{{ fmt(calc.marginDomestic, 2) }}
Margin % {{ ((calc.marginExport/calc.buyPrice)*100).toFixed(1) }}% {{ ((calc.marginDomestic/calc.buyPrice)*100).toFixed(1) }}%
🏆 Top Margin Ranking (Export)
เกรด ซื้อ ขาย Export Margin %
{{ p.code }}
{{ p.name_th }}
{{ fmt(p.buy_price_thb_per_kg, 2) }} {{ fmt(p.sell_export_thb_per_kg, 2) }} {{ p.margin_export_thb_per_kg >= 0 ? '+' : '' }}{{ fmt(p.margin_export_thb_per_kg, 2) }} {{ ((p.margin_export_thb_per_kg/p.buy_price_thb_per_kg)*100).toFixed(1) }}%
📈 ต้นทุน-มาร์จิ้นย้อนหลัง 30 วัน
📰 News Impact Engine
AI สรุปข่าวเป็นไทย + คะแนน impact 1-5
{{ n.impact_score }}
IMPACT
{{ n.source }} · {{ relTime(n.ts) }}
{{ n.title }}
{{ n.summary_th }}
#{{ t }}
🟠 CU: {{ n.impact_copper }} ⚪ AL: {{ n.impact_aluminium }} 💵 FX: {{ n.impact_usdthb }}
🔔 Alert Rules
{{ r.name }}
{{ r.metric }} {{ r.operator }} {{ r.threshold }}
{{ r.message_template }}
{{ r.severity }} cooldown {{ r.cooldown_minutes }}m
📋 Alert Log (24h)
{{ l.severity === 'critical' ? '🚨' : l.severity === 'warning' ? '⚠️' : '💬' }}
{{ l.message }}
{{ l.rule_name }} · {{ relTime(l.ts) }}
{{ l.status }}
⚙️ Default Premium & Cost
📨 LINE Bot Config
{{ t }}
📦 Product Master Data — เกรดสินค้า + % เทียบ LME
จัดการเกรด ราคา % รับซื้อ-ส่งออก-ในประเทศ ของแต่ละสินค้า
Code ชื่อสินค้า Metal % ซื้อ % ส่งออก % ในปท. Yield Process Active
{{ p.code }}
🔑 API Documentation
GET /rest/v1/v_latest_prices — ราคาล่าสุดทุก symbol
GET /rest/v1/v_latest_indicators?timeframe=eq.1d — indicators
GET /rest/v1/v_latest_cost — ต้นทุนล่าสุด
GET /rest/v1/v_top_news_today — ข่าว impact ≥3 วันนี้
POST /functions/v1/fetch_market — pull market manually
POST /functions/v1/push_line — body: {"slot":"morning"}
POST /rpc/calc_cost_thb_per_kg — params: p_lme_usd, p_usd_thb, ...
GET /rest/v1/products — รายการเกรดสินค้า
GET /rest/v1/v_product_margin — มาร์จิ้นล่าสุดทุกเกรด (live)
GET /rest/v1/v_latest_action_plan — AI action plan ล่าสุด
POST /functions/v1/generate_action_plan — รัน AI วิเคราะห์ทันที