Chapter 4 — System Architecture
RAIDER ถูกสร้างขึ้นในรูปแบบของระบบเดียวที่ทำงานครบวงจรอยู่ภายในไฟล์เดียว แต่เมื่อพิจารณาในระดับสถาปัตยกรรม ระบบนี้ไม่ได้เป็นก้อนความซับซ้อนที่ไร้โครงสร้าง หากเป็นระบบที่ถูกจัดวางบทบาทภายในอย่างมีลำดับและมีขอบเขตชัดเจนตั้งแต่ต้น สิ่งที่ถูกออกแบบไม่ใช่เพื่อเพิ่มความฉลาดของระบบ แต่เพื่อจำกัดเสรีภาพในการกระทำของมันให้อยู่ภายในกรอบที่สอดคล้องกับปรัชญาและ doctrine ที่วางไว้แล้ว
ในระดับแก่น RAIDER ทำหน้าที่เพียงสิ่งเดียว แปลงตลาดที่ไม่อาจคาดเดาได้ ให้กลายเป็นพื้นที่ที่มีขอบเขตของการอยู่รอด
ระบบไม่ได้เริ่มต้นจากการตั้งคำถามว่าราคาจะไปทางใด แต่ตั้งคำถามว่าหากราคาไปในทิศทางใด ระบบจะยังสามารถคงสภาพการทำงานของตนเองไว้ได้หรือไม่ และลึกเพียงใดโดยไม่แตก สถาปัตยกรรมทั้งหมดจึงถูกจัดวางเพื่อให้ทุกการกระทำของระบบสามารถอธิบายได้ย้อนหลังว่าเกิดจากโครงสร้าง ไม่ใช่จากแรงกระตุ้น ณ ขณะนั้น
The Four-Engine View
แม้ RAIDER จะเป็น monolithic system ในเชิงการเขียนโค้ด แต่ในเชิงสถาปัตยกรรมสามารถมองได้ชัดเจนว่า ระบบนี้ประกอบด้วยกลไกหลักสี่ส่วนที่ทำงานต่อเนื่องกันเป็นลำดับตรรกะเดียวกัน
ส่วนแรกคือ Signal Engine ซึ่งมีหน้าที่ไม่ใช่การทำนายตลาด แต่เป็นการกำหนด “สิทธิ์ในการเริ่มต้น” ระบบส่วนนี้ทำหน้าที่เพียงตัดสินว่าเงื่อนไขเชิงโครงสร้างสำหรับการเริ่ม cycle ใหม่ถูกครบถ้วนแล้วหรือยัง โดยไม่สนใจความเร่งเร้าของราคาในระยะสั้น
ส่วนที่สองคือ Risk Engine ซึ่งทำหน้าที่แปลงความเสี่ยงจากแนวคิดเชิงนามธรรมให้กลายเป็นตัวเลขที่ระบบสามารถควบคุมได้ ทุกการกระทำของระบบต้องผ่านชั้นนี้ก่อนเสมอ เพื่อให้ความเสี่ยงถูกกำหนดล่วงหน้า ไม่ใช่ถูกค้นพบภายหลัง
ส่วนที่สามคือ State Engine ซึ่งทำหน้าที่ควบคุมสถานะภายในของระบบอย่างเข้มงวด กลไกนี้ทำให้ระบบรู้ว่าตนเองอยู่ในช่วงใด และในช่วงนั้น อนุญาตให้กระทำอะไรได้บ้าง State Engine คือสิ่งที่แปลง “วินัย” จากแนวคิด ให้กลายเป็นข้อจำกัดเชิงกลไก
ส่วนสุดท้ายคือ Execution Engine ซึ่งเป็นชั้นที่แปลงการตัดสินใจเชิงโครงสร้างทั้งหมดให้กลายเป็นการกระทำจริงในตลาด โดยยึดหลักว่าการกระทำต้องจบเป็นรอบ ไม่ใช่การแก้ปัญหาเฉพาะจุดแบบต่อเนื่องไร้ปลายทาง
สี่กลไกนี้ไม่ได้ถูกแยกออกเป็นไฟล์ แต่ถูกแยกออกเป็นบทบาท เพื่อให้ระบบสามารถพัฒนาไปต่อได้ในอนาคต โดยไม่ต้องรื้อถอนโครงสร้างความคิดเดิม
Signal Engine — Permission, Not Prediction
Signal Engine ของ RAIDER ถูกออกแบบมาเพื่อทำหน้าที่ “อนุญาต” ไม่ใช่ “กระตุ้น” ระบบส่วนนี้มีหน้าที่เพียงตรวจสอบว่าโครงสร้างของตลาด ณ ขณะนั้น อยู่ในสภาพที่ระบบมีสิทธิ์เริ่มต้น cycle ใหม่หรือไม่ การรับรู้สัญญาณจึงถูกแยกออกจากการกระทำอย่างชัดเจน
ด้วยกลไกนี้ ระบบสามารถรับรู้การเปลี่ยนแปลงของตลาดได้โดยไม่จำเป็นต้องตอบสนองทันที การมีอยู่ของสถานะ pending ภายใน ทำให้ RAIDER แยกการรับรู้สถานการณ์ออกจากการลงมือ ซึ่งช่วยลดการตอบสนองที่เกินจำเป็น และทำให้การเริ่มต้นทุกครั้งเกิดขึ้นจากเงื่อนไข ไม่ใช่จากแรงกระตุ้น
Risk Engine — Risk Before Action
Risk Engine คือหัวใจเชิงโครงสร้างของ RAIDER เพราะเป็นส่วนที่ทำให้ความเสี่ยงไม่เคยเกิดขึ้นโดยไม่มีกรอบรองรับ กลไกนี้บังคับให้ทุกการเปิด position ต้องผ่านการตรวจสอบขอบเขตที่กำหนดไว้ล่วงหน้า ตั้งแต่ระดับความสมเหตุสมผลของพารามิเตอร์ ไปจนถึงข้อจำกัดด้านขนาดและสัดส่วน
การคำนวณขนาด lot ไม่ได้ถูกวางไว้เป็นรายละเอียดเชิงเทคนิค แต่เป็นเครื่องมือบังคับให้ระบบเคลื่อนไหวอยู่ภายในพื้นที่ที่ยังสามารถอยู่รอดได้ Risk Engine จึงทำหน้าที่แปลง risk/reward จากตัวเลข ให้กลายเป็นรูปทรงของพื้นที่ที่ระบบสามารถเคลื่อนไหวได้โดยไม่หลุดกรอบ
ในจุดนี้ ความเสี่ยงไม่ถูกมองเป็นเหตุการณ์ แต่ถูกมองเป็นพื้นที่
State Engine — Discipline as Structure
State Engine คือกลไกที่ทำให้ RAIDER ไม่ลังเล ระบบนี้ใช้สถานะภายในเป็นตัวกำหนดสิ่งที่อนุญาตและไม่อนุญาตให้เกิดขึ้นในแต่ละช่วงเวลา เมื่อระบบอยู่ใน cycle แล้ว การเริ่มต้นใหม่จะถูกปิดกั้นโดยอัตโนมัติ เมื่อมีตำแหน่งค้างอยู่ ระบบจะไม่เปิดพื้นที่ให้กับความคิดซ้อนทับ
การตัดสินใจของระบบถูกผูกไว้กับการเปลี่ยนสถานะ ไม่ใช่กับความถี่ของราคา สิ่งนี้ทำให้การรอคอยกลายเป็นสถานะการทำงานที่สมบูรณ์ ไม่ใช่ช่องว่างของการตัดสินใจ
State Engine จึงไม่ใช่เพียงตัวแปรควบคุม แต่เป็นรูปธรรมของวินัยที่ถูก encode ไว้ในระบบ
Execution Engine — Closure Over Reaction
Execution Engine ของ RAIDER ถูกออกแบบด้วยสมมติฐานสำคัญว่า ระบบที่ดีต้องรู้จักจบ การกระทำทุกครั้งของระบบถูกออกแบบให้มีปลายทางที่ชัดเจน เมื่อถึงเงื่อนไขจบ ระบบจะปิดทุกตำแหน่งและรีเซ็ตสถานะกลับสู่ศูนย์โดยไม่ทิ้งความค้างคาไว้ให้ตีความต่อ
นอกจากนี้ Execution Engine ยังทำหน้าที่เป็นชั้นแห่งความโปร่งใส ผ่านการบันทึกเหตุการณ์และการแสดงกรอบการทำงานบนกราฟ การกระทำของระบบจึงไม่ใช่สิ่งที่เกิดขึ้นในความมืด แต่เป็นสิ่งที่มนุษย์สามารถตรวจสอบย้อนหลังได้โดยไม่ต้องแทรกแซง
Progressive Hedging — Containment, Not Defiance
กลไก hedging ใน RAIDER ถูกจัดวางให้เป็นการประคองภายในกรอบ ไม่ใช่การดื้อกับตลาด การเพิ่มตำแหน่งทุกครั้งต้องผ่านการคำนวณที่อิงกับโครงสร้างเดิม และถูกครอบด้วยข้อจำกัดที่ไม่อนุญาตให้ระบบทะลุเพดานที่กำหนดไว้
Progressive Hedging จึงทำหน้าที่เป็นกลไกดูดซับแรงกระแทก ไม่ใช่เครื่องมือทบความเสี่ยง มันอนุญาตให้ระบบอยู่กับความผิดทางได้ แต่ไม่อนุญาตให้หลงทาง
Legacy Foundation
RAIDER อาจยังไม่ใช่ระบบแบบ Agentic ที่รับรู้บริบทและปรับตัวได้ด้วยตนเอง แต่สิ่งที่ระบบนี้มีตั้งแต่ต้น คือความสามารถในการไม่ทรยศต่อหลักการของตนเอง มันถูกสร้างมาให้มีสถานะที่บังคับวินัย มีขอบเขตความเสี่ยงที่ตรวจสอบได้ และมีวงจรการทำงานที่จบเป็นรอบอย่างชัดเจน
ด้วยเหตุนี้ RAIDER จึงไม่ถูกสร้างขึ้นเพื่อเป็นคำตอบสุดท้าย แต่เพื่อทำหน้าที่เป็นฐานรากที่มั่นคงพอสำหรับการพัฒนาในอนาคต สิ่งที่ระบบต้องเรียนรู้ต่อไปไม่ใช่การเพิ่มความซับซ้อนหรือความฉลาด หากแต่เป็นการลดโอกาสในการหลงออกนอกกรอบ ภายใต้หลักของ risk engineering ที่ถูกกำหนดไว้แล้วตั้งแต่ต้น
RAIDER — Legacy Foundation
Although implemented as a monolithic engine within a single codebase, RAIDER is architecturally layered. It is not a sequence of loosely connected functions but a structured containment system composed of distinct logical responsibilities. The purpose of this architecture is not complexity; it is separation of control. Each layer restricts the one beneath it so that exposure remains bounded under uncertainty.
At its foundation, RAIDER does not attempt to determine where price will move. It defines within what limits exposure may exist regardless of direction. The architectural question is not directional prediction but structural survivability. Every action must be explainable by rule, every transition traceable to predefined logic.
Conceptually, the system can be understood as four interacting engines, though they coexist within a unified implementation. The first governs signal authorization. The second enforces risk boundaries. The third manages state transitions. The fourth executes orders mechanically. These roles are separated to prevent any single layer from overriding structural constraint.
The Signal Engine evaluates structural configuration and determines whether initiation is permitted. It does not forecast outcomes. It assesses whether predefined conditions are satisfied. By separating observation from authorization, the architecture prevents impulsive initiation. A detected opportunity does not immediately become exposure; it becomes a candidate awaiting validation.
The Risk Engine translates structural configuration into measurable exposure boundaries. It validates Distance A thresholds, calculates proportional relationships between Distance A and Distance B, determines lot size based on equity and contract mechanics, and enforces caps. Risk is not adjusted reactively after loss. It is declared before commitment. This layer ensures that survivability overrides aggressiveness.
The State Engine governs phase progression. RAIDER operates within explicit states: idle, pending, active cycle, hedging progression, closure, and reset. Each state authorizes a limited set of actions. Transition from one state to another occurs only when rule-defined criteria are satisfied. Overlapping cycles are structurally blocked. No hedge can skip sequence. No initiation can occur while exposure remains active. Discipline is embedded in transition logic rather than assumed through intention.
The Execution Engine performs mechanical implementation. It places, modifies, and closes orders strictly according to parameters delivered from the upper layers. It does not interpret market context independently. Upon reaching Take Profit or final structural boundary, all positions close completely. After closure, a full reset returns the system to neutral state before a new cycle may begin. This guarantees finiteness. No exposure remains open-ended.
Progressive hedging functions within this architecture as containment rather than escalation. Distance A defines structural spacing between responses. Distance B defines proportional objective and outer boundary. Lot progression is recalculated from net exposure rather than cumulative order count. This ensures proportional rebalancing instead of exponential growth. Margin usage expands in a controlled gradient when geometry is aligned. When geometry is misaligned, exposure halts at predefined caps.
Architecturally, RAIDER exhibits deterministic state transitions, predefined exposure ceilings, finite cycle closure, and equity-referenced sizing. These properties are not optional enhancements; they are safeguards. The system is designed to be auditable backward. Every action must be defensible by reference to survivability logic.
In its legacy form, RAIDER does not adapt to changing regimes. It executes consistently under all conditions. This is not oversight; it is prerequisite stability. Contextual perception, if introduced, must sit above deterministic discipline rather than replacing it. An adaptive layer built on unstable core logic magnifies instability. An adaptive layer built on strict boundaries extends control.
RAIDER was not constructed to be clever. It was constructed to be difficult to destabilize. The architecture described here is not the endpoint of development. It is the necessary foundation upon which any future Agentic layer must rest. Structure precedes perception. Constraint precedes adaptation. Without this sequence, complexity becomes fragility.
