Settings :
This EA is designed to be highly flexible. You can adjust its trading strategy by configuring the following parameters:
This section is the heart of the risk management (MM) for the entire portfolio.
CapitalPerTotal_L_Lot
Name: Capital per Total Buy-Side Lot
Meaning: This number defines the primary risk level of the EA. A higher value results in smaller lot sizes (lower risk), while a lower value results in larger lot sizes (higher risk).
Recommendation: This is the most critical parameter. You should start with the default value (35,000) or higher for safety. This value is used to calculate the "Total Lot Budget" that the EA can use for all buy-side orders (e.g., with a $10,000 capital / 35,000 = the EA will limit the total buy-side lots to 0.28).
Max_Account_Drawdown_Percent
Name: Maximum Acceptable Account Drawdown %
Meaning: This acts as the ultimate stop loss for the entire account. If the account's floating loss reaches this specified percentage, the EA will immediately close all orders and cease trading to prevent a margin call.
Recommendation: The default value of 99.0 effectively disables this feature. For enhanced safety, you might set this to 20.0 or 30.0.
This section controls all buy-side order placements.
L_Lot_Multiplier
Name: Lot Multiplier for Subsequent Buy Orders
Meaning: When the EA opens the 2nd, 3rd, etc., buy order (L2, L3,...), the lot size will be equal to the previous order's lot size multiplied by this number (Martingale system).
Recommendation: 1.0 = all orders have the same lot size; > 1.0 = subsequent lots are larger (increases risk and reward); < 1.0 = subsequent lots are smaller. A value of 1.12 is a relatively small and safe increase.
L1_Budget_Usage_Percent
Name: Budget Usage Percentage for the First Order (L1)
Meaning: This determines what percentage of the "Total Lot Budget" (calculated in Section 1) will be used for the very first order (L1).
Recommendation: The default value of 5.0 means the initial lot size uses only 5% of the total budget, leaving the remaining 95% of your 'ammunition' to open counter-trend orders at lower prices. This is a safe setting.
L_Pyramid_Min_Distance_Dollars
Name: Minimum Distance to Open Next Buy Order
Meaning: After the S-Grid is fully opened, the EA will start opening additional Buy orders (L2, L3...) only when the price drops below the last Buy order by this distance.
Recommendation: A larger number will result in wider spacing between orders (safer). A smaller number will result in more frequent orders (riskier).
This section controls the opening of Sell orders to hedge the risk of each individual Buy order.
SHedge_L1_Lot_Ratio
Name: Lot Ratio of S-Hedge compared to L
Meaning: The lot size of an S-Hedge order will be equal to the lot size of the L-order it is hedging, multiplied by this value.
Recommendation: A value of 0.25 means it will hedge with a lot size that is 25% of the corresponding losing order.
L_to_S_Hedge_Dollars
Name: Minimum Distance to Open S-Hedge
Meaning: The price must drop by this distance from an L-order before the corresponding S-Hedge for that order is activated.
Recommendation: This determines the sensitivity of the hedge. A smaller value = faster hedge; a larger value = slower hedge.
SHedge_Max_Open_Distance_Dollars
Name: Maximum Distance to Open S-Hedge
Meaning: This defines the "zone" for hedge activation and, most importantly, serves as the trigger point for the entire S-Grid system.
Recommendation: Crucial! This must always be a positive value and greater than L_to_S_Hedge_Dollars. If set to 0, the S-Grid system will not function at all. If you want the hedge to be active continuously as the price drops, set this to a very high number like 9999. However, if you want the S-Grid to activate relatively quickly, set this to an appropriate value, such as 20.0.
This section controls the grid system, which begins to operate once the price breaches the SHedge_Max_Open_Distance_Dollars threshold.
SGrid_Total_Ratio
Name: Total Lot Ratio of S-Grid
Meaning: The "Total Lot Budget" for all S-Grid orders will not exceed the total lot size of all buy-side orders multiplied by this value.
Recommendation: 0.25 means the total defensive power of the entire grid will be 25% of the buy-side risk.
SGrid_Levels
Name: Number of S-Grid Levels
Meaning: The maximum number of S-Grid orders that the EA can open.
Recommendation: 5 is the standard value. The lot budget will be averaged across these levels.
S_Grid_Distance_Dollars
Name: Distance Between S-Grid Levels
Meaning: The distance the price must move (up or down) from the existing grid's range to trigger the next grid order.
Recommendation: Smaller value = more frequent grid orders; larger value = wider-spaced grid orders.
S_Close_Dollars
Name: Profit Target for S-Grid (TP)
Meaning: Each S-Grid order will have its Take Profit set at this distance.
Recommendation: Avoid setting this value too low (e.g., 1.0), as orders might be closed prematurely by the spread. A starting value of 3.0 or 5.0 is recommended.
MagicNumber
Name: Order Identifier Number
Meaning: A unique number for this EA to prevent its orders from being confused with orders from other EAs or manual trades.
Recommendation: If you run multiple EAs in the same account, you must ensure this number is unique for each one.
Symbol_Name
Name: Symbol Name
Meaning: Restricts the EA to operate only on this specific currency pair.
Recommendation: This should match your broker's symbol name exactly, e.g., XAUUSD, GOLD, XAUUSD.m, etc.
This is a special mode designed to resolve situations where the price is caught in the middle.
Enable_Middle_Scalp
Name: Enable Corrective Scalp Mode
Meaning: If set to true, when the S-Grid is fully open and the price is moving sideways between the Buy and Sell levels, the EA will begin short-term trading (scalping) within that range to reduce drawdown.
Recommendation: This is an advanced function. It is recommended to keep this set to false for normal use.
(Other parameters in this section are for adjusting the scalping strategy, using indicators like RSI and ATR, and should be left at their default values if you are not familiar with them.)
--TH--
คำอธิบายตัวแปรแต่ละตัวในหน้าต่าง Input ของ EA สำหรับลูกค้าเพื่อทำความเข้าใจและปรับค่าต่างๆ ได้ด้วยตัวเอง
EA ตัวนี้ถูกออกแบบมาให้มีความยืดหยุ่นสูง ท่านสามารถปรับกลยุทธ์การเทรดได้ผ่านการตั้งค่าตัวแปรต่างๆ ดังนี้:
ส่วนนี้คือหัวใจของการบริหารความเสี่ยง (MM) ของพอร์ตทั้งหมด
CapitalPerTotal_L_Lot
ชื่อ: เงินทุนต่อ Lot รวมของฝั่ง Buy
ความหมาย: ตัวเลขนี้กำหนดความเสี่ยงหลักของ EA ยิ่งค่านี้สูง Lot ที่เปิดจะยิ่งน้อยลง (ความเสี่ยงต่ำ) ยิ่งค่านี้ต่ำ Lot ที่เปิดจะยิ่งสูงขึ้น (ความเสี่ยงสูง)
คำแนะนำ: เป็นค่าที่สำคัญที่สุด ควรเริ่มต้นด้วยค่ามาตรฐาน (35000) หรือสูงกว่าเพื่อความปลอดภัย ค่านี้จะถูกใช้คำนวณ "งบประมาณ Lot รวม" ที่ EA จะใช้ได้สำหรับฝั่ง Buy ทั้งหมด (เช่น ทุน $10,000 / 35,000 = EA จะจำกัด Lot รวมฝั่ง Buy ไว้ที่ 0.28 lot)
Max_Account_Drawdown_Percent
ชื่อ: % Drawdown สูงสุดที่จะยอมรับได้
ความหมาย: เปรียบเสมือน Stop Loss สุดท้ายของบัญชี หากบัญชีเกิดการขาดทุนลอย (Floating Loss) ถึงเปอร์เซ็นต์ที่กำหนดนี้ EA จะทำการปิดทุกออเดอร์และหยุดการทำงานทันทีเพื่อป้องกันการล้างพอร์ต
คำแนะนำ: ค่าเริ่มต้น 99.0 คือแทบจะปิดการใช้งาน หากต้องการความปลอดภัยสูง อาจตั้งไว้ที่ 20.0 หรือ 30.0
ส่วนนี้ควบคุมการเปิดออเดอร์ฝั่ง Buy ทั้งหมด
L_Lot_Multiplier
ชื่อ: ตัวคูณ Lot ของไม้ Buy ถัดไป
ความหมาย: เมื่อ EA เปิดไม้ Buy ที่ 2, 3,... (L2, L3,...) ขนาด Lot จะเท่ากับ Lot ของไม้ก่อนหน้าคูณด้วยตัวเลขนี้ (ระบบ Martingale)
คำแนะนำ: 1.0 = ทุกไม้ Lot เท่ากัน, > 1.0 = ไม้ต่อไป Lot ใหญ่ขึ้น (เพิ่มความเสี่ยงและผลตอบแทน), < 1.0 = ไม้ต่อไป Lot เล็กลง ค่า 1.12 เป็นการเพิ่มที่ค่อนข้างน้อยและปลอดภัย
L1_Budget_Usage_Percent
ชื่อ: % การใช้งานงบประมาณสำหรับไม้แรก (L1)
ความหมาย: กำหนดว่าไม้แรก (L1) จะใช้ขนาด Lot กี่เปอร์เซ็นต์จาก "งบประมาณ Lot รวม" ที่คำนวณได้จากข้อ 1
คำแนะนำ: ค่าเริ่มต้น 5.0 หมายถึงใช้ Lot เริ่มต้นเพียง 5% ของงบทั้งหมด ทำให้เหลือกระสุนอีก 95% ไว้สำหรับเปิดไม้แก้ในราคาที่ต่ำลง เป็นการตั้งค่าที่ปลอดภัย
L_Pyramid_Min_Distance_Dollars
ชื่อ: ระยะห่างขั้นต่ำในการเปิดไม้ Buy ถัดไป
ความหมาย: หลังจากที่ S-Grid เปิดเต็มจำนวนแล้ว EA จะเริ่มเปิดไม้ Buy เพิ่ม (L2, L3,...) ก็ต่อเมื่อราคาลงมาต่ำกว่าไม้ Buy ล่าสุดเป็นระยะทางนี้
คำแนะนำ: ตัวเลขมากจะทำให้การเปิดไม้แก้ห่างขึ้น (ปลอดภัย) ตัวเลขน้อยจะทำให้เปิดไม้แก้ถี่ขึ้น (เสี่ยงขึ้น)
ส่วนนี้ควบคุมการเปิดออเดอร์ Sell เพื่อป้องกันความเสี่ยงของไม้ Buy แต่ละตัว
SHedge_L1_Lot_Ratio
ชื่อ: อัตราส่วน Lot ของ S-Hedge เทียบกับ L
ความหมาย: ขนาด Lot ของไม้ S-Hedge จะเท่ากับขนาด Lot ของไม้ L ที่มันเข้าไปป้องกัน คูณด้วยค่านี้
คำแนะนำ: 0.25 หมายถึง Hedge ด้วย Lot ขนาด 25% ของไม้ที่ติดลบอยู่
L_to_S_Hedge_Dollars
ชื่อ: ระยะห่างขั้นต่ำในการเปิด S-Hedge
ความหมาย: ราคาจะต้องลงมาห่างจากไม้ L เป็นระยะทางนี้ก่อน S-Hedge ของไม้นั้นๆ ถึงจะเปิดทำงาน
คำแนะนำ: เป็นตัวกำหนดความไวในการ Hedge ค่าน้อย = Hedge เร็ว, ค่ามาก = Hedge ช้า
SHedge_Max_Open_Distance_Dollars
ชื่อ: ระยะห่างสูงสุดในการเปิด S-Hedge
ความหมาย: เป็นการกำหนด "โซน" ในการเปิด Hedge และที่สำคัญที่สุดคือ เป็นตัวกำหนดจุดเริ่มต้นของระบบ S-Grid ทั้งหมด
คำแนะนำ: สำคัญมาก! ต้องตั้งค่านี้ให้เป็นบวกและมากกว่า L_to_S_Hedge_Dollars เสมอ หากตั้งเป็น 0 ระบบ S-Grid จะไม่ทำงานเลย หากต้องการให้ Hedge ทำงานตลอดเวลาที่ราคาลง ให้ตั้งค่านี้ให้สูงมากๆ เช่น 9999 แต่ถ้าต้องการให้ S-Grid เริ่มทำงานเร็ว ก็ตั้งค่านี้ให้เหมาะสม เช่น 20.0
ส่วนนี้ควบคุมระบบกริด ซึ่งจะเริ่มทำงานเมื่อราคาลดลงทะลุ SHedge_Max_Open_Distance_Dollars
SGrid_Total_Ratio
ชื่อ: อัตราส่วน Lot รวมของ S-Grid
ความหมาย: "งบประมาณ Lot รวม" ของ S-Grid ทั้งหมด จะไม่เกินผลรวม Lot ของฝั่ง Buy ทั้งหมดคูณด้วยค่านี้
คำแนะนำ: 0.25 หมายความว่าพลังป้องกันของกริดทั้งหมดจะอยู่ที่ 25% ของความเสี่ยงฝั่ง Buy
SGrid_Levels
ชื่อ: จำนวนชั้นของ S-Grid
ความหมาย: จำนวนออเดอร์ S-Grid สูงสุดที่ EA จะเปิดได้
คำแนะนำ: 5 คือค่ามาตรฐาน งบประมาณ Lot จะถูกหารเฉลี่ยตามจำนวนชั้นนี้
S_Grid_Distance_Dollars
ชื่อ: ระยะห่างระหว่างชั้น S-Grid
ความหมาย: ระยะห่างที่ราคาจะต้องขยับ (ขึ้นหรือลง) จากกรอบของ Grid เดิม เพื่อเปิด Grid ไม้ถัดไป
คำแนะนำ: ค่าน้อย = Grid เปิดถี่ขึ้น, ค่ามาก = Grid เปิดห่างขึ้น
S_Close_Dollars
ชื่อ: ระยะทำกำไรของ S-Grid (TP)
ความหมาย: ออเดอร์ S-Grid แต่ละไม้จะถูกตั้ง Take Profit ที่ระยะห่างนี้
คำแนะนำ: ไม่ควรตั้งค่าน้อยเกินไป (เช่น 1.0) เพราะอาจปิดเร็วจาก Spread แนะนำเริ่มต้นที่ 3.0 หรือ 5.0
MagicNumber
ชื่อ: เลขกำกับออเดอร์
ความหมาย: ตัวเลขเฉพาะของ EA ตัวนี้ เพื่อไม่ให้ออเดอร์สับสนกับ EA ตัวอื่นหรือการเทรดมือ
คำแนะนำ: หากรัน EA หลายตัวในบัญชีเดียว ต้องตั้งค่านี้ไม่ให้ซ้ำกันเด็ดขาด
Symbol_Name
ชื่อ: ชื่อสัญลักษณ์
ความหมาย: กำหนดให้ EA ทำงานกับคู่เงินนี้เท่านั้น
คำแนะนำ: ควรตั้งให้ตรงกับชื่อย่อของโบรกเกอร์ เช่น XAUUSD, GOLD, XAUUSD.m เป็นต้น
ส่วนนี้เป็นโหมดพิเศษสำหรับแก้สถานการณ์ที่ติดอยู่ตรงกลาง
Enable_Middle_Scalp
ชื่อ: เปิดใช้งานโหมด Scalp แก้ไข
ความหมาย: หากตั้งเป็น true เมื่อ S-Grid เปิดเต็มจำนวนและราคาวิ่ง Sideways อยู่ระหว่าง Buy และ Sell, EA จะเริ่มเทรดสั้นๆ (Scalping) ในกรอบนั้นเพื่อลด Drawdown
คำแนะนำ: เป็นฟังก์ชันสำหรับผู้ใช้ขั้นสูง แนะนำให้ตั้งเป็น false ในการใช้งานปกติ
(ตัวแปรอื่นๆ ในส่วนนี้ใช้สำหรับปรับกลยุทธ์การ Scalping เช่น RSI, ATR ซึ่งควรใช้ค่ามาตรฐานหากไม่คุ้นเคย)