Spot light
- エキスパート
- Kazuya Koizumi
- バージョン: 9.0
- アップデート済み: 8 4月 2026
- アクティベーション: 10
// [Overview]
// XAUUSD M3 EA with independent BUY and SELL entries.
// Scores the probability of a price move from candlestick shape and
// scales lots accordingly. BUY positions are NOT closed on a SELL
// signal; each direction is managed independently.
// Compatible with both hedge and netting accounts.
//
// [Lot Sizing Formula]
// When AutoLot=false (default):
// Lot = BaseLots + (MinLot * N)
// BaseLots : DefaultLots input (fixed base size)
// MinLot : broker SYMBOL_VOLUME_MIN
// N : BuyLotAdd<score> or SellLotAdd<score> (integer, 0 at Score=0)
// Example with DefaultLots=0.01 and MinLot=0.01:
// Score 0 -> 0.01 + 0.01*0 = 0.01
// Score 1 -> 0.01 + 0.01*1 = 0.02
// Score 2 -> 0.01 + 0.01*2 = 0.03
// Score 3 -> 0.01 + 0.01*3 = 0.04
// Score 4 -> 0.01 + 0.01*4 = 0.05
//
// When AutoLot=true:
// The base lot is dynamically calculated from free margin using
// AutoLots(), and the score-based add-on (MinLot * N) is then
// applied on top of that auto-calculated base.
//
// [Trailing Stop]
// TrailStartPoints : profit threshold (in points) to activate trailing
// TrailBufferPoints: trail distance behind current price (in points)
// Effective trail distance = max(StopsLevel+1, TrailBufferPoints) * _Point
// BUY SL ratchets up only (never moves down)
// SELL SL ratchets down only (never moves up)
// Profit is measured price-based ((bid-open)/_Point) for symbol-agnostic
// accuracy across all instruments including XAUJPY, EURJPY, etc.
//
// [Target Profit Resume Modes]
// NupTime=RESUME_WEEKLY (default):
// Pauses until the nearest upcoming NupResumeDay at 00:00.
// If that day is still ahead in the current week, resumes this week;
// otherwise resumes on the same day of next week.
// NupTime=RESUME_DAILY:
// Pauses for NupDays calendar days (resumes at 00:00 of that day).
// NupTime=RESUME_MONTHLY:
// Pauses until the 1st day of the next month at 00:00.
// NupTime=RESUME_NONE:
// EA stops permanently when the target is reached.
//
// [Loss Cut Resume Modes]
// LcNupTime=RESUME_WEEKLY (default):
// Pauses until the nearest upcoming LcNupResumeDay at 00:00.
// If that day is still ahead in the current week, resumes this week;
// otherwise resumes on the same day of next week.
// On resume, InitialBalance and Target Profit target are reset.
// LcNupTime=RESUME_DAILY:
// Pauses for LcNupDays calendar days (resumes at 00:00 of that day).
// LcNupTime=RESUME_MONTHLY:
// Pauses until the 1st day of the next month at 00:00.
// LcNupTime=RESUME_NONE:
// EA stops permanently when the loss cut triggers.
