Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d0c0716fa | ||
|
|
f39464287c | ||
|
|
2bde52e43b | ||
|
|
0e2409bfcf | ||
|
|
dbc6eb1671 | ||
|
|
e72a2ea5c4 | ||
|
|
e2fbe0d01d | ||
|
|
342069ac98 | ||
|
|
d308697fd3 | ||
|
|
f6120214ab | ||
|
|
8f60e362c5 | ||
|
|
29baa17897 | ||
|
|
0175a6edff | ||
|
|
bae25d07eb | ||
|
|
1db72f6885 | ||
|
|
3d6a0df209 |
Executable
+1703
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,68 @@
|
||||
; === OrdersEA_Smart_Grid_BO - AUDNZD ===
|
||||
; Slow-moving cross — BO fires on RBA/RBNZ policy divergence
|
||||
; Timeframe: H1
|
||||
|
||||
; === Grid / BO Settings ===
|
||||
UseAutoPivots=true
|
||||
InpManualHigh=0
|
||||
InpManualLow=0
|
||||
Entry=10
|
||||
TP=1000
|
||||
Lots=1.00
|
||||
MaxLevels=3
|
||||
|
||||
; === Range Filters ===
|
||||
UseRSIFilter=false
|
||||
RSIPeriod=14
|
||||
RSILower=40
|
||||
RSIUpper=60
|
||||
UseADXFilter=true
|
||||
ADXPeriod=14
|
||||
ADXMax=22
|
||||
UseATRFilter=true
|
||||
ATRPeriod=14
|
||||
ATRMultiplier=1.2
|
||||
|
||||
; === Stop Loss ===
|
||||
InpUseStopLoss=true
|
||||
StopLoss=180
|
||||
|
||||
; === Trailing Stop ===
|
||||
InpUseTrailingStop=true
|
||||
InpTrailStartPoints=500
|
||||
InpTrailStop=500
|
||||
|
||||
; === Risk Management ===
|
||||
TRADE_RANGE=40
|
||||
LongLimit=0
|
||||
ShortLimit=0
|
||||
GetOut=N
|
||||
OpenNewTrades=Y
|
||||
TakeProfitLevelPercent=0
|
||||
TakeProfitLevelDollarAmount=0
|
||||
EquityFactorPercent=0
|
||||
LotsFactorPercent=0
|
||||
BaseEquity=10000
|
||||
Master=false
|
||||
DiagnosticModeOn=false
|
||||
InpMaxDailyDrawdown=2.0
|
||||
InpMaxWeeklyDrawdown=5.0
|
||||
|
||||
; === Weekend Protection ===
|
||||
InpCloseBeforeWeekend=true
|
||||
InpWeekendCloseHour=7
|
||||
InpCancelPendingBeforeWeekend=true
|
||||
InpMondayStartHour=7
|
||||
|
||||
; === Thursday Wind-Down ===
|
||||
InpUseWinddown=true
|
||||
InpWinddownStartHour=19
|
||||
InpWinddownTrailStart=200
|
||||
InpWinddownTrailStop=150
|
||||
|
||||
; === EA Settings ===
|
||||
MagicNum=444012
|
||||
|
||||
; === Session Notes ===
|
||||
; Very slow pair — BO events are rare but can be strong when they occur
|
||||
; Both central banks are commodity-linked; global risk-off affects both equally
|
||||
@@ -0,0 +1,68 @@
|
||||
; === OrdersEA_Smart_Grid_BO - AUDUSD ===
|
||||
; Commodity-linked pair — trends on China/risk data
|
||||
; Timeframe: H1
|
||||
|
||||
; === Grid / BO Settings ===
|
||||
UseAutoPivots=true
|
||||
InpManualHigh=0
|
||||
InpManualLow=0
|
||||
Entry=20
|
||||
TP=2000
|
||||
Lots=1.00
|
||||
MaxLevels=3
|
||||
|
||||
; === Range Filters ===
|
||||
UseRSIFilter=false
|
||||
RSIPeriod=14
|
||||
RSILower=40
|
||||
RSIUpper=60
|
||||
UseADXFilter=true
|
||||
ADXPeriod=14
|
||||
ADXMax=25
|
||||
UseATRFilter=true
|
||||
ATRPeriod=14
|
||||
ATRMultiplier=1.5
|
||||
|
||||
; === Stop Loss ===
|
||||
InpUseStopLoss=true
|
||||
StopLoss=300
|
||||
|
||||
; === Trailing Stop ===
|
||||
InpUseTrailingStop=true
|
||||
InpTrailStartPoints=500
|
||||
InpTrailStop=500
|
||||
|
||||
; === Risk Management ===
|
||||
TRADE_RANGE=60
|
||||
LongLimit=0
|
||||
ShortLimit=0
|
||||
GetOut=N
|
||||
OpenNewTrades=Y
|
||||
TakeProfitLevelPercent=0
|
||||
TakeProfitLevelDollarAmount=0
|
||||
EquityFactorPercent=0
|
||||
LotsFactorPercent=0
|
||||
BaseEquity=10000
|
||||
Master=false
|
||||
DiagnosticModeOn=false
|
||||
InpMaxDailyDrawdown=3.0
|
||||
InpMaxWeeklyDrawdown=7.0
|
||||
|
||||
; === Weekend Protection ===
|
||||
InpCloseBeforeWeekend=true
|
||||
InpWeekendCloseHour=7
|
||||
InpCancelPendingBeforeWeekend=true
|
||||
InpMondayStartHour=7
|
||||
|
||||
; === Thursday Wind-Down ===
|
||||
InpUseWinddown=true
|
||||
InpWinddownStartHour=19
|
||||
InpWinddownTrailStart=200
|
||||
InpWinddownTrailStop=150
|
||||
|
||||
; === EA Settings ===
|
||||
MagicNum=444005
|
||||
|
||||
; === Session Notes ===
|
||||
; Strong moves on RBA decisions, Chinese PMI, iron ore price swings
|
||||
; Asia session active for this pair
|
||||
@@ -0,0 +1,71 @@
|
||||
; === OrdersEA_Smart_Grid_BO - EURCHF ===
|
||||
; Historically low-volatility pair — BO only fires on genuine regime breaks
|
||||
; Timeframe: H1
|
||||
; WARNING: SNB surprise interventions can produce 500+ pt moves instantly
|
||||
; BO with SL is safer than Grid for this pair during intervention events
|
||||
|
||||
; === Grid / BO Settings ===
|
||||
UseAutoPivots=true
|
||||
InpManualHigh=0
|
||||
InpManualLow=0
|
||||
Entry=10
|
||||
TP=1000
|
||||
Lots=1.00
|
||||
MaxLevels=2
|
||||
|
||||
; === Range Filters ===
|
||||
UseRSIFilter=false
|
||||
RSIPeriod=14
|
||||
RSILower=40
|
||||
RSIUpper=60
|
||||
UseADXFilter=true
|
||||
ADXPeriod=14
|
||||
ADXMax=20
|
||||
UseATRFilter=true
|
||||
ATRPeriod=14
|
||||
ATRMultiplier=1.2
|
||||
|
||||
; === Stop Loss (especially important here — SNB events are catastrophic without it) ===
|
||||
InpUseStopLoss=true
|
||||
StopLoss=200
|
||||
|
||||
; === Trailing Stop ===
|
||||
InpUseTrailingStop=true
|
||||
InpTrailStartPoints=500
|
||||
InpTrailStop=500
|
||||
|
||||
; === Risk Management ===
|
||||
TRADE_RANGE=40
|
||||
LongLimit=0
|
||||
ShortLimit=0
|
||||
GetOut=N
|
||||
OpenNewTrades=Y
|
||||
TakeProfitLevelPercent=0
|
||||
TakeProfitLevelDollarAmount=0
|
||||
EquityFactorPercent=0
|
||||
LotsFactorPercent=0
|
||||
BaseEquity=10000
|
||||
Master=false
|
||||
DiagnosticModeOn=false
|
||||
InpMaxDailyDrawdown=2.0
|
||||
InpMaxWeeklyDrawdown=5.0
|
||||
|
||||
; === Weekend Protection ===
|
||||
InpCloseBeforeWeekend=true
|
||||
InpWeekendCloseHour=7
|
||||
InpCancelPendingBeforeWeekend=true
|
||||
InpMondayStartHour=7
|
||||
|
||||
; === Thursday Wind-Down ===
|
||||
InpUseWinddown=true
|
||||
InpWinddownStartHour=19
|
||||
InpWinddownTrailStart=200
|
||||
InpWinddownTrailStop=150
|
||||
|
||||
; === EA Settings ===
|
||||
MagicNum=444010
|
||||
|
||||
; === Session Notes ===
|
||||
; Low daily range — BO will fire rarely, only on real breakout events
|
||||
; SNB quarterly assessments: use GetOut=A before each one
|
||||
; DO NOT run overnight without SL — 2015 CHF event removed 20% in seconds
|
||||
@@ -0,0 +1,68 @@
|
||||
; === OrdersEA_Smart_Grid_BO - EURGBP ===
|
||||
; Low-range pair except on UK/EU political divergence events
|
||||
; Timeframe: H1
|
||||
|
||||
; === Grid / BO Settings ===
|
||||
UseAutoPivots=true
|
||||
InpManualHigh=0
|
||||
InpManualLow=0
|
||||
Entry=10
|
||||
TP=1000
|
||||
Lots=1.00
|
||||
MaxLevels=3
|
||||
|
||||
; === Range Filters ===
|
||||
UseRSIFilter=false
|
||||
RSIPeriod=14
|
||||
RSILower=40
|
||||
RSIUpper=60
|
||||
UseADXFilter=true
|
||||
ADXPeriod=14
|
||||
ADXMax=22
|
||||
UseATRFilter=true
|
||||
ATRPeriod=14
|
||||
ATRMultiplier=1.2
|
||||
|
||||
; === Stop Loss ===
|
||||
InpUseStopLoss=true
|
||||
StopLoss=200
|
||||
|
||||
; === Trailing Stop ===
|
||||
InpUseTrailingStop=true
|
||||
InpTrailStartPoints=500
|
||||
InpTrailStop=500
|
||||
|
||||
; === Risk Management ===
|
||||
TRADE_RANGE=40
|
||||
LongLimit=0
|
||||
ShortLimit=0
|
||||
GetOut=N
|
||||
OpenNewTrades=Y
|
||||
TakeProfitLevelPercent=0
|
||||
TakeProfitLevelDollarAmount=0
|
||||
EquityFactorPercent=0
|
||||
LotsFactorPercent=0
|
||||
BaseEquity=10000
|
||||
Master=false
|
||||
DiagnosticModeOn=false
|
||||
InpMaxDailyDrawdown=2.0
|
||||
InpMaxWeeklyDrawdown=5.0
|
||||
|
||||
; === Weekend Protection ===
|
||||
InpCloseBeforeWeekend=true
|
||||
InpWeekendCloseHour=7
|
||||
InpCancelPendingBeforeWeekend=true
|
||||
InpMondayStartHour=7
|
||||
|
||||
; === Thursday Wind-Down ===
|
||||
InpUseWinddown=true
|
||||
InpWinddownStartHour=19
|
||||
InpWinddownTrailStart=200
|
||||
InpWinddownTrailStop=150
|
||||
|
||||
; === EA Settings ===
|
||||
MagicNum=444011
|
||||
|
||||
; === Session Notes ===
|
||||
; Best BO opportunities: UK/EU trade data, BOE vs ECB policy divergence
|
||||
; Generally quiet — expect infrequent fills
|
||||
@@ -0,0 +1,68 @@
|
||||
; === OrdersEA_Smart_Grid_BO - EURJPY ===
|
||||
; Risk proxy pair — trends sharply on risk sentiment shifts
|
||||
; Timeframe: H1
|
||||
|
||||
; === Grid / BO Settings ===
|
||||
UseAutoPivots=true
|
||||
InpManualHigh=0
|
||||
InpManualLow=0
|
||||
Entry=25
|
||||
TP=2000
|
||||
Lots=1.00
|
||||
MaxLevels=3
|
||||
|
||||
; === Range Filters ===
|
||||
UseRSIFilter=false
|
||||
RSIPeriod=14
|
||||
RSILower=40
|
||||
RSIUpper=60
|
||||
UseADXFilter=true
|
||||
ADXPeriod=14
|
||||
ADXMax=25
|
||||
UseATRFilter=true
|
||||
ATRPeriod=14
|
||||
ATRMultiplier=1.7
|
||||
|
||||
; === Stop Loss ===
|
||||
InpUseStopLoss=true
|
||||
StopLoss=400
|
||||
|
||||
; === Trailing Stop ===
|
||||
InpUseTrailingStop=true
|
||||
InpTrailStartPoints=500
|
||||
InpTrailStop=500
|
||||
|
||||
; === Risk Management ===
|
||||
TRADE_RANGE=70
|
||||
LongLimit=0
|
||||
ShortLimit=0
|
||||
GetOut=N
|
||||
OpenNewTrades=Y
|
||||
TakeProfitLevelPercent=0
|
||||
TakeProfitLevelDollarAmount=0
|
||||
EquityFactorPercent=0
|
||||
LotsFactorPercent=0
|
||||
BaseEquity=10000
|
||||
Master=false
|
||||
DiagnosticModeOn=false
|
||||
InpMaxDailyDrawdown=3.0
|
||||
InpMaxWeeklyDrawdown=7.0
|
||||
|
||||
; === Weekend Protection ===
|
||||
InpCloseBeforeWeekend=true
|
||||
InpWeekendCloseHour=7
|
||||
InpCancelPendingBeforeWeekend=true
|
||||
InpMondayStartHour=7
|
||||
|
||||
; === Thursday Wind-Down ===
|
||||
InpUseWinddown=true
|
||||
InpWinddownStartHour=19
|
||||
InpWinddownTrailStart=200
|
||||
InpWinddownTrailStop=150
|
||||
|
||||
; === EA Settings ===
|
||||
MagicNum=444009
|
||||
|
||||
; === Session Notes ===
|
||||
; Strong during European session when risk appetite shifts
|
||||
; BOJ intervention risk — monitor JPY pairs across the board
|
||||
@@ -0,0 +1,68 @@
|
||||
; === OrdersEA_Smart_Grid_BO - EURUSD ===
|
||||
; Most liquid pair, tight spreads, clean technical moves
|
||||
; Timeframe: H1
|
||||
|
||||
; === Grid / BO Settings ===
|
||||
UseAutoPivots=true
|
||||
InpManualHigh=0
|
||||
InpManualLow=0
|
||||
Entry=20
|
||||
TP=2000
|
||||
Lots=1.00
|
||||
MaxLevels=3
|
||||
|
||||
; === Range Filters ===
|
||||
UseRSIFilter=false
|
||||
RSIPeriod=14
|
||||
RSILower=40
|
||||
RSIUpper=60
|
||||
UseADXFilter=true
|
||||
ADXPeriod=14
|
||||
ADXMax=25
|
||||
UseATRFilter=true
|
||||
ATRPeriod=14
|
||||
ATRMultiplier=1.5
|
||||
|
||||
; === Stop Loss ===
|
||||
InpUseStopLoss=true
|
||||
StopLoss=300
|
||||
|
||||
; === Trailing Stop ===
|
||||
InpUseTrailingStop=true
|
||||
InpTrailStartPoints=500
|
||||
InpTrailStop=500
|
||||
|
||||
; === Risk Management ===
|
||||
TRADE_RANGE=60
|
||||
LongLimit=0
|
||||
ShortLimit=0
|
||||
GetOut=N
|
||||
OpenNewTrades=Y
|
||||
TakeProfitLevelPercent=0
|
||||
TakeProfitLevelDollarAmount=0
|
||||
EquityFactorPercent=0
|
||||
LotsFactorPercent=0
|
||||
BaseEquity=10000
|
||||
Master=false
|
||||
DiagnosticModeOn=false
|
||||
InpMaxDailyDrawdown=3.0
|
||||
InpMaxWeeklyDrawdown=7.0
|
||||
|
||||
; === Weekend Protection ===
|
||||
InpCloseBeforeWeekend=true
|
||||
InpWeekendCloseHour=7
|
||||
InpCancelPendingBeforeWeekend=true
|
||||
InpMondayStartHour=7
|
||||
|
||||
; === Thursday Wind-Down ===
|
||||
InpUseWinddown=true
|
||||
InpWinddownStartHour=19
|
||||
InpWinddownTrailStart=200
|
||||
InpWinddownTrailStop=150
|
||||
|
||||
; === EA Settings ===
|
||||
MagicNum=444001
|
||||
|
||||
; === Session Notes ===
|
||||
; Best BO windows: London open (07:00 GMT), NY open (13:30 GMT)
|
||||
; Avoid: ECB press conferences, NFP first 5 min (too much noise)
|
||||
@@ -0,0 +1,70 @@
|
||||
; === OrdersEA_Smart_Grid_BO - GBPJPY ===
|
||||
; "The Beast" — extreme volatility, excellent breakout pair
|
||||
; Timeframe: H1
|
||||
; WARNING: 200+ pt moves common; SL is non-negotiable
|
||||
|
||||
; === Grid / BO Settings ===
|
||||
UseAutoPivots=true
|
||||
InpManualHigh=0
|
||||
InpManualLow=0
|
||||
Entry=50
|
||||
TP=5000
|
||||
Lots=1.00
|
||||
MaxLevels=2
|
||||
|
||||
; === Range Filters ===
|
||||
UseRSIFilter=false
|
||||
RSIPeriod=14
|
||||
RSILower=40
|
||||
RSIUpper=60
|
||||
UseADXFilter=true
|
||||
ADXPeriod=14
|
||||
ADXMax=28
|
||||
UseATRFilter=true
|
||||
ATRPeriod=14
|
||||
ATRMultiplier=2.2
|
||||
|
||||
; === Stop Loss (MANDATORY — GBPJPY has no mercy on unprotected positions) ===
|
||||
InpUseStopLoss=true
|
||||
StopLoss=800
|
||||
|
||||
; === Trailing Stop ===
|
||||
InpUseTrailingStop=true
|
||||
InpTrailStartPoints=500
|
||||
InpTrailStop=500
|
||||
|
||||
; === Risk Management ===
|
||||
TRADE_RANGE=120
|
||||
LongLimit=0
|
||||
ShortLimit=0
|
||||
GetOut=N
|
||||
OpenNewTrades=Y
|
||||
TakeProfitLevelPercent=0
|
||||
TakeProfitLevelDollarAmount=0
|
||||
EquityFactorPercent=0
|
||||
LotsFactorPercent=0
|
||||
BaseEquity=10000
|
||||
Master=false
|
||||
DiagnosticModeOn=true
|
||||
InpMaxDailyDrawdown=3.0
|
||||
InpMaxWeeklyDrawdown=7.0
|
||||
|
||||
; === Weekend Protection ===
|
||||
InpCloseBeforeWeekend=true
|
||||
InpWeekendCloseHour=7
|
||||
InpCancelPendingBeforeWeekend=true
|
||||
InpMondayStartHour=7
|
||||
|
||||
; === Thursday Wind-Down ===
|
||||
InpUseWinddown=true
|
||||
InpWinddownStartHour=19
|
||||
InpWinddownTrailStart=200
|
||||
InpWinddownTrailStop=150
|
||||
|
||||
; === EA Settings ===
|
||||
MagicNum=444004
|
||||
|
||||
; === Session Notes ===
|
||||
; GBPJPY BO targets: London open, US session risk events
|
||||
; Avoid: BOJ + BOE same-day events (whipsaw kills BO fills)
|
||||
; Reduce Lots to 0.01 and monitor first 2 weeks closely
|
||||
@@ -0,0 +1,68 @@
|
||||
; === OrdersEA_Smart_Grid_BO - GBPUSD ===
|
||||
; Higher volatility than EURUSD — wider entry and SL
|
||||
; Timeframe: H1
|
||||
|
||||
; === Grid / BO Settings ===
|
||||
UseAutoPivots=true
|
||||
InpManualHigh=0
|
||||
InpManualLow=0
|
||||
Entry=25
|
||||
TP=2500
|
||||
Lots=1.00
|
||||
MaxLevels=3
|
||||
|
||||
; === Range Filters ===
|
||||
UseRSIFilter=false
|
||||
RSIPeriod=14
|
||||
RSILower=40
|
||||
RSIUpper=60
|
||||
UseADXFilter=true
|
||||
ADXPeriod=14
|
||||
ADXMax=25
|
||||
UseATRFilter=true
|
||||
ATRPeriod=14
|
||||
ATRMultiplier=1.6
|
||||
|
||||
; === Stop Loss ===
|
||||
InpUseStopLoss=true
|
||||
StopLoss=350
|
||||
|
||||
; === Trailing Stop ===
|
||||
InpUseTrailingStop=true
|
||||
InpTrailStartPoints=500
|
||||
InpTrailStop=500
|
||||
|
||||
; === Risk Management ===
|
||||
TRADE_RANGE=70
|
||||
LongLimit=0
|
||||
ShortLimit=0
|
||||
GetOut=N
|
||||
OpenNewTrades=Y
|
||||
TakeProfitLevelPercent=0
|
||||
TakeProfitLevelDollarAmount=0
|
||||
EquityFactorPercent=0
|
||||
LotsFactorPercent=0
|
||||
BaseEquity=10000
|
||||
Master=false
|
||||
DiagnosticModeOn=false
|
||||
InpMaxDailyDrawdown=3.0
|
||||
InpMaxWeeklyDrawdown=7.0
|
||||
|
||||
; === Weekend Protection ===
|
||||
InpCloseBeforeWeekend=true
|
||||
InpWeekendCloseHour=7
|
||||
InpCancelPendingBeforeWeekend=true
|
||||
InpMondayStartHour=7
|
||||
|
||||
; === Thursday Wind-Down ===
|
||||
InpUseWinddown=true
|
||||
InpWinddownStartHour=19
|
||||
InpWinddownTrailStart=200
|
||||
InpWinddownTrailStop=150
|
||||
|
||||
; === EA Settings ===
|
||||
MagicNum=444002
|
||||
|
||||
; === Session Notes ===
|
||||
; Cable breaks hard on UK data, BOE announcements
|
||||
; Avoid BoE rate decision days unless watching live
|
||||
@@ -0,0 +1,69 @@
|
||||
; === OrdersEA_Smart_Grid_BO - Major Pairs Template ===
|
||||
; Strategy: Breakout — buy above resistance, sell below support
|
||||
; Best for: EURUSD, GBPUSD, AUDUSD, USDJPY
|
||||
; Timeframe: H1
|
||||
; Activates when ADX > 25 (trending) and price breaks grid boundary
|
||||
|
||||
; === Grid / BO Settings ===
|
||||
UseAutoPivots=true
|
||||
InpManualHigh=0
|
||||
InpManualLow=0
|
||||
Entry=20
|
||||
TP=2000
|
||||
Lots=1.00
|
||||
MaxLevels=3
|
||||
|
||||
; === Range Filters (inverted logic in BO: low ADXMax = quick trend detection) ===
|
||||
UseRSIFilter=false
|
||||
RSIPeriod=14
|
||||
RSILower=40
|
||||
RSIUpper=60
|
||||
UseADXFilter=true
|
||||
ADXPeriod=14
|
||||
ADXMax=25
|
||||
UseATRFilter=true
|
||||
ATRPeriod=14
|
||||
ATRMultiplier=1.5
|
||||
|
||||
; === Stop Loss (mandatory for breakout) ===
|
||||
InpUseStopLoss=true
|
||||
StopLoss=300
|
||||
|
||||
; === Trailing Stop ===
|
||||
InpUseTrailingStop=true
|
||||
InpTrailStartPoints=500
|
||||
InpTrailStop=500
|
||||
|
||||
; === Risk Management ===
|
||||
TRADE_RANGE=60
|
||||
LongLimit=0
|
||||
ShortLimit=0
|
||||
GetOut=N
|
||||
OpenNewTrades=Y
|
||||
TakeProfitLevelPercent=0
|
||||
TakeProfitLevelDollarAmount=0
|
||||
EquityFactorPercent=0
|
||||
LotsFactorPercent=0
|
||||
BaseEquity=10000
|
||||
Master=false
|
||||
DiagnosticModeOn=false
|
||||
InpMaxDailyDrawdown=3.0
|
||||
InpMaxWeeklyDrawdown=7.0
|
||||
|
||||
; === Weekend Protection ===
|
||||
InpCloseBeforeWeekend=true
|
||||
InpWeekendCloseHour=7
|
||||
InpCancelPendingBeforeWeekend=true
|
||||
InpMondayStartHour=7
|
||||
|
||||
; === Thursday Wind-Down ===
|
||||
InpUseWinddown=true
|
||||
InpWinddownStartHour=19
|
||||
InpWinddownTrailStart=200
|
||||
InpWinddownTrailStop=150
|
||||
|
||||
; === Session Notes ===
|
||||
; BO fires on breakout of daily pivot range (ATR-scaled)
|
||||
; Best: London open (07:00-09:00 GMT), NY open (13:30-15:00 GMT)
|
||||
; Avoid: Low-volume overnight sessions (Asia)
|
||||
; SL should be below GridHigh for buys, above GridLow for sells
|
||||
@@ -0,0 +1,68 @@
|
||||
; === OrdersEA_Smart_Grid_BO - NZDUSD ===
|
||||
; Similar to AUDUSD, slightly lower volatility
|
||||
; Timeframe: H1
|
||||
|
||||
; === Grid / BO Settings ===
|
||||
UseAutoPivots=true
|
||||
InpManualHigh=0
|
||||
InpManualLow=0
|
||||
Entry=20
|
||||
TP=2000
|
||||
Lots=1.00
|
||||
MaxLevels=3
|
||||
|
||||
; === Range Filters ===
|
||||
UseRSIFilter=false
|
||||
RSIPeriod=14
|
||||
RSILower=40
|
||||
RSIUpper=60
|
||||
UseADXFilter=true
|
||||
ADXPeriod=14
|
||||
ADXMax=25
|
||||
UseATRFilter=true
|
||||
ATRPeriod=14
|
||||
ATRMultiplier=1.4
|
||||
|
||||
; === Stop Loss ===
|
||||
InpUseStopLoss=true
|
||||
StopLoss=280
|
||||
|
||||
; === Trailing Stop ===
|
||||
InpUseTrailingStop=true
|
||||
InpTrailStartPoints=500
|
||||
InpTrailStop=500
|
||||
|
||||
; === Risk Management ===
|
||||
TRADE_RANGE=55
|
||||
LongLimit=0
|
||||
ShortLimit=0
|
||||
GetOut=N
|
||||
OpenNewTrades=Y
|
||||
TakeProfitLevelPercent=0
|
||||
TakeProfitLevelDollarAmount=0
|
||||
EquityFactorPercent=0
|
||||
LotsFactorPercent=0
|
||||
BaseEquity=10000
|
||||
Master=false
|
||||
DiagnosticModeOn=false
|
||||
InpMaxDailyDrawdown=3.0
|
||||
InpMaxWeeklyDrawdown=7.0
|
||||
|
||||
; === Weekend Protection ===
|
||||
InpCloseBeforeWeekend=true
|
||||
InpWeekendCloseHour=7
|
||||
InpCancelPendingBeforeWeekend=true
|
||||
InpMondayStartHour=7
|
||||
|
||||
; === Thursday Wind-Down ===
|
||||
InpUseWinddown=true
|
||||
InpWinddownStartHour=19
|
||||
InpWinddownTrailStart=200
|
||||
InpWinddownTrailStop=150
|
||||
|
||||
; === EA Settings ===
|
||||
MagicNum=444006
|
||||
|
||||
; === Session Notes ===
|
||||
; RBNZ decisions can cause strong BO moves
|
||||
; Lower daily range than AUDUSD — expect fewer fills
|
||||
@@ -0,0 +1,68 @@
|
||||
; === OrdersEA_Smart_Grid_BO - Steady/Low-Vol Pairs Template ===
|
||||
; Strategy: Breakout — buy above resistance, sell below support
|
||||
; Best for: EURCHF, EURGBP, AUDNZD
|
||||
; Timeframe: H1
|
||||
; These pairs trend less — lower ADXMax catches moderate trends early
|
||||
; WARNING: EURCHF carries SNB intervention risk (see pair notes below)
|
||||
|
||||
; === Grid / BO Settings ===
|
||||
UseAutoPivots=true
|
||||
InpManualHigh=0
|
||||
InpManualLow=0
|
||||
Entry=10
|
||||
TP=1000
|
||||
Lots=1.00
|
||||
MaxLevels=3
|
||||
|
||||
; === Range Filters ===
|
||||
UseRSIFilter=false
|
||||
RSIPeriod=14
|
||||
RSILower=40
|
||||
RSIUpper=60
|
||||
UseADXFilter=true
|
||||
ADXPeriod=14
|
||||
ADXMax=22
|
||||
UseATRFilter=true
|
||||
ATRPeriod=14
|
||||
ATRMultiplier=1.2
|
||||
|
||||
; === Stop Loss (mandatory) ===
|
||||
InpUseStopLoss=true
|
||||
StopLoss=200
|
||||
|
||||
; === Trailing Stop ===
|
||||
InpUseTrailingStop=true
|
||||
InpTrailStartPoints=500
|
||||
InpTrailStop=500
|
||||
|
||||
; === Risk Management ===
|
||||
TRADE_RANGE=40
|
||||
LongLimit=0
|
||||
ShortLimit=0
|
||||
GetOut=N
|
||||
OpenNewTrades=Y
|
||||
TakeProfitLevelPercent=0
|
||||
TakeProfitLevelDollarAmount=0
|
||||
EquityFactorPercent=0
|
||||
LotsFactorPercent=0
|
||||
BaseEquity=10000
|
||||
Master=false
|
||||
DiagnosticModeOn=false
|
||||
InpMaxDailyDrawdown=2.0
|
||||
InpMaxWeeklyDrawdown=5.0
|
||||
|
||||
; === Weekend Protection ===
|
||||
InpCloseBeforeWeekend=true
|
||||
InpWeekendCloseHour=7
|
||||
InpCancelPendingBeforeWeekend=true
|
||||
InpMondayStartHour=7
|
||||
|
||||
; === Thursday Wind-Down ===
|
||||
InpUseWinddown=true
|
||||
InpWinddownStartHour=19
|
||||
InpWinddownTrailStart=200
|
||||
InpWinddownTrailStop=150
|
||||
|
||||
; === Session Notes ===
|
||||
; Lower volatility = smaller moves but more frequent breakouts of ATR range
|
||||
; Tight SL important — false breakouts common on these pairs
|
||||
@@ -0,0 +1,68 @@
|
||||
; === OrdersEA_Smart_Grid_BO - USDCAD ===
|
||||
; Oil-correlated pair — trends strongly on WTI moves and BOC events
|
||||
; Timeframe: H1
|
||||
|
||||
; === Grid / BO Settings ===
|
||||
UseAutoPivots=true
|
||||
InpManualHigh=0
|
||||
InpManualLow=0
|
||||
Entry=20
|
||||
TP=2000
|
||||
Lots=1.00
|
||||
MaxLevels=3
|
||||
|
||||
; === Range Filters ===
|
||||
UseRSIFilter=false
|
||||
RSIPeriod=14
|
||||
RSILower=40
|
||||
RSIUpper=60
|
||||
UseADXFilter=true
|
||||
ADXPeriod=14
|
||||
ADXMax=25
|
||||
UseATRFilter=true
|
||||
ATRPeriod=14
|
||||
ATRMultiplier=1.5
|
||||
|
||||
; === Stop Loss ===
|
||||
InpUseStopLoss=true
|
||||
StopLoss=300
|
||||
|
||||
; === Trailing Stop ===
|
||||
InpUseTrailingStop=true
|
||||
InpTrailStartPoints=500
|
||||
InpTrailStop=500
|
||||
|
||||
; === Risk Management ===
|
||||
TRADE_RANGE=60
|
||||
LongLimit=0
|
||||
ShortLimit=0
|
||||
GetOut=N
|
||||
OpenNewTrades=Y
|
||||
TakeProfitLevelPercent=0
|
||||
TakeProfitLevelDollarAmount=0
|
||||
EquityFactorPercent=0
|
||||
LotsFactorPercent=0
|
||||
BaseEquity=10000
|
||||
Master=false
|
||||
DiagnosticModeOn=false
|
||||
InpMaxDailyDrawdown=3.0
|
||||
InpMaxWeeklyDrawdown=7.0
|
||||
|
||||
; === Weekend Protection ===
|
||||
InpCloseBeforeWeekend=true
|
||||
InpWeekendCloseHour=7
|
||||
InpCancelPendingBeforeWeekend=true
|
||||
InpMondayStartHour=7
|
||||
|
||||
; === Thursday Wind-Down ===
|
||||
InpUseWinddown=true
|
||||
InpWinddownStartHour=19
|
||||
InpWinddownTrailStart=200
|
||||
InpWinddownTrailStop=150
|
||||
|
||||
; === EA Settings ===
|
||||
MagicNum=444007
|
||||
|
||||
; === Session Notes ===
|
||||
; Watch WTI crude oil price — USDCAD is inversely correlated
|
||||
; BOC rate announcements produce clean BO moves
|
||||
@@ -0,0 +1,69 @@
|
||||
; === OrdersEA_Smart_Grid_BO - USDCHF ===
|
||||
; Safe-haven pair — breakouts on risk-off events
|
||||
; Timeframe: H1
|
||||
; NOTE: Inversely correlated with EURUSD — avoid running both long/short simultaneously
|
||||
|
||||
; === Grid / BO Settings ===
|
||||
UseAutoPivots=true
|
||||
InpManualHigh=0
|
||||
InpManualLow=0
|
||||
Entry=20
|
||||
TP=2000
|
||||
Lots=1.00
|
||||
MaxLevels=3
|
||||
|
||||
; === Range Filters ===
|
||||
UseRSIFilter=false
|
||||
RSIPeriod=14
|
||||
RSILower=40
|
||||
RSIUpper=60
|
||||
UseADXFilter=true
|
||||
ADXPeriod=14
|
||||
ADXMax=25
|
||||
UseATRFilter=true
|
||||
ATRPeriod=14
|
||||
ATRMultiplier=1.4
|
||||
|
||||
; === Stop Loss ===
|
||||
InpUseStopLoss=true
|
||||
StopLoss=280
|
||||
|
||||
; === Trailing Stop ===
|
||||
InpUseTrailingStop=true
|
||||
InpTrailStartPoints=500
|
||||
InpTrailStop=500
|
||||
|
||||
; === Risk Management ===
|
||||
TRADE_RANGE=55
|
||||
LongLimit=0
|
||||
ShortLimit=0
|
||||
GetOut=N
|
||||
OpenNewTrades=Y
|
||||
TakeProfitLevelPercent=0
|
||||
TakeProfitLevelDollarAmount=0
|
||||
EquityFactorPercent=0
|
||||
LotsFactorPercent=0
|
||||
BaseEquity=10000
|
||||
Master=false
|
||||
DiagnosticModeOn=false
|
||||
InpMaxDailyDrawdown=3.0
|
||||
InpMaxWeeklyDrawdown=7.0
|
||||
|
||||
; === Weekend Protection ===
|
||||
InpCloseBeforeWeekend=true
|
||||
InpWeekendCloseHour=7
|
||||
InpCancelPendingBeforeWeekend=true
|
||||
InpMondayStartHour=7
|
||||
|
||||
; === Thursday Wind-Down ===
|
||||
InpUseWinddown=true
|
||||
InpWinddownStartHour=19
|
||||
InpWinddownTrailStart=200
|
||||
InpWinddownTrailStop=150
|
||||
|
||||
; === EA Settings ===
|
||||
MagicNum=444008
|
||||
|
||||
; === Session Notes ===
|
||||
; SNB intervention risk — USDCHF can gap on SNB surprise moves
|
||||
; Safe-haven demand spikes on geopolitical events
|
||||
@@ -0,0 +1,68 @@
|
||||
; === OrdersEA_Smart_Grid_BO - USDJPY ===
|
||||
; Risk-on/risk-off pair — strong trending behaviour on macro events
|
||||
; Timeframe: H1
|
||||
|
||||
; === Grid / BO Settings ===
|
||||
UseAutoPivots=true
|
||||
InpManualHigh=0
|
||||
InpManualLow=0
|
||||
Entry=20
|
||||
TP=2000
|
||||
Lots=1.00
|
||||
MaxLevels=3
|
||||
|
||||
; === Range Filters ===
|
||||
UseRSIFilter=false
|
||||
RSIPeriod=14
|
||||
RSILower=40
|
||||
RSIUpper=60
|
||||
UseADXFilter=true
|
||||
ADXPeriod=14
|
||||
ADXMax=25
|
||||
UseATRFilter=true
|
||||
ATRPeriod=14
|
||||
ATRMultiplier=1.5
|
||||
|
||||
; === Stop Loss ===
|
||||
InpUseStopLoss=true
|
||||
StopLoss=300
|
||||
|
||||
; === Trailing Stop ===
|
||||
InpUseTrailingStop=true
|
||||
InpTrailStartPoints=500
|
||||
InpTrailStop=500
|
||||
|
||||
; === Risk Management ===
|
||||
TRADE_RANGE=60
|
||||
LongLimit=0
|
||||
ShortLimit=0
|
||||
GetOut=N
|
||||
OpenNewTrades=Y
|
||||
TakeProfitLevelPercent=0
|
||||
TakeProfitLevelDollarAmount=0
|
||||
EquityFactorPercent=0
|
||||
LotsFactorPercent=0
|
||||
BaseEquity=10000
|
||||
Master=false
|
||||
DiagnosticModeOn=false
|
||||
InpMaxDailyDrawdown=3.0
|
||||
InpMaxWeeklyDrawdown=7.0
|
||||
|
||||
; === Weekend Protection ===
|
||||
InpCloseBeforeWeekend=true
|
||||
InpWeekendCloseHour=7
|
||||
InpCancelPendingBeforeWeekend=true
|
||||
InpMondayStartHour=7
|
||||
|
||||
; === Thursday Wind-Down ===
|
||||
InpUseWinddown=true
|
||||
InpWinddownStartHour=19
|
||||
InpWinddownTrailStart=200
|
||||
InpWinddownTrailStop=150
|
||||
|
||||
; === EA Settings ===
|
||||
MagicNum=444003
|
||||
|
||||
; === Session Notes ===
|
||||
; BOJ intervention risk — USDJPY can gap 200+ pts on intervention
|
||||
; Watch for BOJ announcements; use GetOut=A if intervention suspected
|
||||
@@ -0,0 +1,68 @@
|
||||
; === OrdersEA_Smart_Grid_BO - Volatile Pairs Template ===
|
||||
; Strategy: Breakout — buy above resistance, sell below support
|
||||
; Best for: GBPJPY, XAUUSD, GBPUSD (high volatility)
|
||||
; Timeframe: H1
|
||||
; WARNING: Large moves — SL is critical, size down
|
||||
|
||||
; === Grid / BO Settings ===
|
||||
UseAutoPivots=true
|
||||
InpManualHigh=0
|
||||
InpManualLow=0
|
||||
Entry=50
|
||||
TP=5000
|
||||
Lots=1.00
|
||||
MaxLevels=2
|
||||
|
||||
; === Range Filters ===
|
||||
UseRSIFilter=false
|
||||
RSIPeriod=14
|
||||
RSILower=40
|
||||
RSIUpper=60
|
||||
UseADXFilter=true
|
||||
ADXPeriod=14
|
||||
ADXMax=28
|
||||
UseATRFilter=true
|
||||
ATRPeriod=14
|
||||
ATRMultiplier=2.0
|
||||
|
||||
; === Stop Loss (mandatory) ===
|
||||
InpUseStopLoss=true
|
||||
StopLoss=800
|
||||
|
||||
; === Trailing Stop ===
|
||||
InpUseTrailingStop=true
|
||||
InpTrailStartPoints=500
|
||||
InpTrailStop=500
|
||||
|
||||
; === Risk Management ===
|
||||
TRADE_RANGE=100
|
||||
LongLimit=0
|
||||
ShortLimit=0
|
||||
GetOut=N
|
||||
OpenNewTrades=Y
|
||||
TakeProfitLevelPercent=0
|
||||
TakeProfitLevelDollarAmount=0
|
||||
EquityFactorPercent=0
|
||||
LotsFactorPercent=0
|
||||
BaseEquity=10000
|
||||
Master=false
|
||||
DiagnosticModeOn=true
|
||||
InpMaxDailyDrawdown=3.0
|
||||
InpMaxWeeklyDrawdown=7.0
|
||||
|
||||
; === Weekend Protection ===
|
||||
InpCloseBeforeWeekend=true
|
||||
InpWeekendCloseHour=7
|
||||
InpCancelPendingBeforeWeekend=true
|
||||
InpMondayStartHour=7
|
||||
|
||||
; === Thursday Wind-Down ===
|
||||
InpUseWinddown=true
|
||||
InpWinddownStartHour=19
|
||||
InpWinddownTrailStart=200
|
||||
InpWinddownTrailStop=150
|
||||
|
||||
; === Session Notes ===
|
||||
; GBPJPY/XAUUSD can gap 200+ pts — BO suits them well but cut losses fast
|
||||
; Monitor DiagnosticMode output on first few trades
|
||||
; Consider halving Lots on first live session
|
||||
@@ -0,0 +1,82 @@
|
||||
; === OrdersEA_Smart_Grid_BO - XAGUSD (Silver) ===
|
||||
; More volatile than Gold per pip — high leverage, high reward breakouts
|
||||
; Timeframe: H1
|
||||
; WARNING: Silver can move 3-4x the range of Gold in percentage terms
|
||||
|
||||
; === Grid / BO Settings ===
|
||||
UseAutoPivots=true
|
||||
InpManualHigh=0
|
||||
InpManualLow=0
|
||||
Entry=60
|
||||
TP=3000
|
||||
Lots=0.35
|
||||
MaxLevels=2
|
||||
|
||||
; === Range Filters ===
|
||||
UseRSIFilter=false
|
||||
RSIPeriod=14
|
||||
RSILower=40
|
||||
RSIUpper=60
|
||||
UseADXFilter=true
|
||||
ADXPeriod=14
|
||||
ADXMax=28
|
||||
UseATRFilter=true
|
||||
ATRPeriod=14
|
||||
ATRMultiplier=2.2
|
||||
|
||||
; === Spread Filter ===
|
||||
; Silver's live spread runs 43-53pts on MetaQuotes-Demo — the EA default
|
||||
; of 30 blocked every cycle. 60 clears normal spread, still blocks blowouts.
|
||||
InpMaxSpreadPoints=60
|
||||
|
||||
; === Range Drift ===
|
||||
; Same issue as gold — stale daily band left silver sell-only and unfilled
|
||||
; all week. Re-center intraday once price drifts ~1x hourly ATR from the
|
||||
; band's midpoint (silver ATR ~0.4-0.5 -> ~400-500pts at 0.001 point size).
|
||||
InpRangeDriftEnable=true
|
||||
InpMoveRangeTrigger=450
|
||||
|
||||
; === Stop Loss (MANDATORY) ===
|
||||
InpUseStopLoss=true
|
||||
StopLoss=1000
|
||||
|
||||
; === Trailing Stop ===
|
||||
InpUseTrailingStop=true
|
||||
InpTrailStartPoints=1000
|
||||
InpTrailStop=500
|
||||
|
||||
; === Risk Management ===
|
||||
TRADE_RANGE=150
|
||||
LongLimit=0
|
||||
ShortLimit=0
|
||||
GetOut=N
|
||||
OpenNewTrades=Y
|
||||
TakeProfitLevelPercent=0
|
||||
TakeProfitLevelDollarAmount=0
|
||||
EquityFactorPercent=0
|
||||
LotsFactorPercent=0
|
||||
BaseEquity=10000
|
||||
Master=false
|
||||
DiagnosticModeOn=true
|
||||
InpMaxDailyDrawdown=3.0
|
||||
InpMaxWeeklyDrawdown=7.0
|
||||
|
||||
; === Weekend Protection ===
|
||||
InpCloseBeforeWeekend=true
|
||||
InpWeekendCloseHour=7
|
||||
InpCancelPendingBeforeWeekend=true
|
||||
InpMondayStartHour=7
|
||||
|
||||
; === Thursday Wind-Down ===
|
||||
InpUseWinddown=true
|
||||
InpWinddownStartHour=19
|
||||
InpWinddownTrailStart=200
|
||||
InpWinddownTrailStop=150
|
||||
|
||||
; === EA Settings ===
|
||||
MagicNum=444014
|
||||
|
||||
; === Session Notes ===
|
||||
; Silver correlates with Gold but amplifies moves
|
||||
; Wider spreads than Gold — Entry=60 ensures we're past the spread cost
|
||||
; Reduce Lots further if running alongside XAUUSD (correlated exposure)
|
||||
@@ -0,0 +1,81 @@
|
||||
; === OrdersEA_Smart_Grid_BO - XAUUSD (Gold) ===
|
||||
; Strongest trending instrument — excellent BO candidate on macro events
|
||||
; Timeframe: H1
|
||||
; WARNING: 500+ pt moves on FOMC, NFP, geopolitical shocks — SL is critical
|
||||
|
||||
; === Grid / BO Settings ===
|
||||
UseAutoPivots=true
|
||||
InpManualHigh=0
|
||||
InpManualLow=0
|
||||
Entry=100
|
||||
TP=5000
|
||||
Lots=0.75
|
||||
MaxLevels=2
|
||||
|
||||
; === Range Filters ===
|
||||
UseRSIFilter=false
|
||||
RSIPeriod=14
|
||||
RSILower=40
|
||||
RSIUpper=60
|
||||
UseADXFilter=true
|
||||
ADXPeriod=14
|
||||
ADXMax=30
|
||||
UseATRFilter=true
|
||||
ATRPeriod=14
|
||||
ATRMultiplier=2.5
|
||||
|
||||
; === Range Drift ===
|
||||
; Daily pivot band only refreshes once per server day. Gold spent all of
|
||||
; Jul 20-22 sitting above that stale band (no fresh buy-stop could be
|
||||
; placed — no-trade-zone guard correctly refused one too close to price),
|
||||
; so the sell-side-only grid kept getting cancelled/re-placed without a
|
||||
; fill. Re-center intraday once price drifts ~1x hourly ATR from the
|
||||
; band's midpoint so both sides stay reachable.
|
||||
InpRangeDriftEnable=true
|
||||
InpMoveRangeTrigger=1500
|
||||
|
||||
; === Stop Loss (MANDATORY — Gold can wipe 500 pts without SL) ===
|
||||
InpUseStopLoss=true
|
||||
StopLoss=1500
|
||||
|
||||
; === Trailing Stop ===
|
||||
InpUseTrailingStop=true
|
||||
InpTrailStartPoints=1000
|
||||
InpTrailStop=500
|
||||
|
||||
; === Risk Management ===
|
||||
TRADE_RANGE=200
|
||||
LongLimit=0
|
||||
ShortLimit=0
|
||||
GetOut=N
|
||||
OpenNewTrades=Y
|
||||
TakeProfitLevelPercent=0
|
||||
TakeProfitLevelDollarAmount=0
|
||||
EquityFactorPercent=0
|
||||
LotsFactorPercent=0
|
||||
BaseEquity=10000
|
||||
Master=false
|
||||
DiagnosticModeOn=true
|
||||
InpMaxDailyDrawdown=3.0
|
||||
InpMaxWeeklyDrawdown=7.0
|
||||
|
||||
; === Weekend Protection ===
|
||||
InpCloseBeforeWeekend=true
|
||||
InpWeekendCloseHour=7
|
||||
InpCancelPendingBeforeWeekend=true
|
||||
InpMondayStartHour=7
|
||||
|
||||
; === Thursday Wind-Down ===
|
||||
InpUseWinddown=true
|
||||
InpWinddownStartHour=19
|
||||
InpWinddownTrailStart=200
|
||||
InpWinddownTrailStop=150
|
||||
|
||||
; === EA Settings ===
|
||||
MagicNum=444013
|
||||
|
||||
; === Session Notes ===
|
||||
; Best BO events: FOMC decisions, NFP, geopolitical escalation, CPI surprises
|
||||
; Gold trends very cleanly once ADX > 30
|
||||
; ADXMax=30 set higher than other pairs — Gold needs confirmed trend before BO fires
|
||||
; Avoid thin Asian overnight sessions for BO entry
|
||||
Executable
+107
@@ -0,0 +1,107 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Syncs authoritative bo-*.set preset values into MT5's actual live-session
|
||||
cache files (MQL5/Profiles/Charts/Default/chartNN.chr).
|
||||
|
||||
Root cause (found 2026-08-10): MT5's "save chart state on graceful exit"
|
||||
never actually fires under this Wine/container setup -- chartNN.chr files
|
||||
were found frozen at their 2026-08-06 23:26 mtimes despite many later
|
||||
restarts, including ones using the documented `stop_grace_period: 60s` +
|
||||
`docker compose down` "graceful" path. Every restart since Aug 6 silently
|
||||
reloads that one frozen snapshot, which is why a live GUI input edit
|
||||
(Properties/F7 -> OK) reverts after the next restart no matter how
|
||||
"gracefully" the container is stopped. This hit the XAUUSD spread filter
|
||||
(Jul 30, Aug 6/7) and the Monday A/B reversion (Aug 10) alike -- general,
|
||||
not symbol-specific.
|
||||
|
||||
Fix: don't rely on MT5 ever writing this file correctly. Treat the
|
||||
bo-*.set files (repo + Presets/) as the single source of truth and write
|
||||
them directly into chartNN.chr ourselves, every boot. chartNN.chr uses
|
||||
the exact same `Key=Value` input names as the .set files (verified), just
|
||||
UTF-16LE with a BOM and CRLF instead of the .set files' UTF-8/LF -- and
|
||||
one chart file per open chart, auto-mapped here via each file's own
|
||||
`symbol=` line rather than a hardcoded chart-number list, so this keeps
|
||||
working if charts are ever reordered.
|
||||
|
||||
Idempotent -- safe to run any time, not just at boot.
|
||||
"""
|
||||
import glob
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
PRESETS_DIR = "/config/.wine/drive_c/Program Files/MetaTrader 5/MQL5/Presets"
|
||||
CHARTS_DIR = "/config/.wine/drive_c/Program Files/MetaTrader 5/MQL5/Profiles/Charts/Default"
|
||||
|
||||
BOM = b"\xff\xfe"
|
||||
|
||||
|
||||
def load_preset(path):
|
||||
values = {}
|
||||
with open(path, "r", encoding="utf-8", errors="ignore") as f:
|
||||
for line in f:
|
||||
line = line.strip("\r\n")
|
||||
if not line or line.startswith(";") or line.startswith("#"):
|
||||
continue
|
||||
if "=" not in line:
|
||||
continue
|
||||
key, _, value = line.partition("=")
|
||||
values[key] = value
|
||||
return values
|
||||
|
||||
|
||||
def sync_chart(chart_path):
|
||||
with open(chart_path, "rb") as f:
|
||||
raw = f.read()
|
||||
|
||||
if not raw.startswith(BOM):
|
||||
return None, "no UTF-16LE BOM, skipping"
|
||||
|
||||
text = raw[len(BOM):].decode("utf-16-le", errors="replace")
|
||||
|
||||
m = re.search(r"^symbol=(\S+)\r?$", text, re.MULTILINE)
|
||||
if not m:
|
||||
return None, "no symbol= line found"
|
||||
symbol = m.group(1)
|
||||
|
||||
preset_path = os.path.join(PRESETS_DIR, f"bo-{symbol.lower()}.set")
|
||||
if not os.path.isfile(preset_path):
|
||||
return symbol, f"no matching preset {preset_path}"
|
||||
|
||||
preset_values = load_preset(preset_path)
|
||||
|
||||
lines = text.split("\n")
|
||||
changed = 0
|
||||
for i, line in enumerate(lines):
|
||||
body = line[:-1] if line.endswith("\r") else line
|
||||
if "=" not in body:
|
||||
continue
|
||||
key, _, current_value = body.partition("=")
|
||||
if key in preset_values and preset_values[key] != current_value:
|
||||
lines[i] = f"{key}={preset_values[key]}\r"
|
||||
changed += 1
|
||||
|
||||
if changed:
|
||||
new_text = "\n".join(lines)
|
||||
new_raw = BOM + new_text.encode("utf-16-le")
|
||||
tmp_path = chart_path + ".tmp"
|
||||
with open(tmp_path, "wb") as f:
|
||||
f.write(new_raw)
|
||||
os.replace(tmp_path, chart_path)
|
||||
|
||||
return symbol, f"{changed} value(s) synced from {os.path.basename(preset_path)}"
|
||||
|
||||
|
||||
def main():
|
||||
if not os.path.isdir(CHARTS_DIR):
|
||||
print(f"No charts dir at {CHARTS_DIR} -- nothing to sync yet.")
|
||||
return 0
|
||||
|
||||
for chart_path in sorted(glob.glob(os.path.join(CHARTS_DIR, "chart*.chr"))):
|
||||
symbol, msg = sync_chart(chart_path)
|
||||
label = f"[{symbol}]" if symbol else ""
|
||||
print(f" {os.path.basename(chart_path)} {label}: {msg}")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
# Thin wrapper: the linuxserver.io custom-cont-init.d runner invokes every
|
||||
# executable file directly in this directory via `sh`, ignoring shebangs,
|
||||
# so a plain .py file placed here fails outright when picked up on its
|
||||
# own. The real logic lives in lib/ (a subdirectory, which the runner
|
||||
# does not recurse into) and is invoked explicitly via python3 here.
|
||||
# Runs on every container start (before MT5 itself, per the s6 cont-init
|
||||
# ordering) -- see lib/sync-ea-inputs.py for what it does and why.
|
||||
python3 "$(dirname "$0")/lib/sync-ea-inputs.py"
|
||||
Reference in New Issue
Block a user