0145236 / Profile
Friends
Requests
Add friends via their profile or user search and you will be able to see if they are online
Outgoing
0145236
Published code VigilDesk Guard Free - restart-proof daily loss guard for MT5
An account-level daily loss guard for MetaTrader 5 whose state survives a restart.
Close the terminal, recompile, switch charts or reinstall MetaTrader: the cap does not reset. State is stored in the terminal's common folder, keyed by account number, so a crash does not quietly hand back the full day's risk.
Features: daily loss cap (default 1.5% of the balance at the start of the broker's trading day) with alert / optional close-all and day-block; per-trade risk warning against a 0.5% budget; early warning at 70% used; on-chart panel with cap used, remaining and state.
The guard uses the broker's trading day, not the local clock, and writes state after the decision. Source included, no DLLs, no external calls, strategy-agnostic. A guard, not a strategy: no signals, no recommendations, no performance claims.
0145236
Added topic Seller registration: phone confirmation code is never delivered to a China mobile number
Hi, I am trying to complete the seller registration, Step 1 "Confirm your phone number". My account is 0145236. I am in China and my mobile operator does not deliver international SMS, so the confirmation code never arrives. I have tried two
0145236
Daily loss limits that survive a restart — the short version
Almost every "daily loss guard" EA keeps its counter in a variable. Restart the terminal, recompile, switch the chart or reload the profile, and OnInit() runs again with zeroed state: the guard silently hands back the full day's risk allowance, exactly on the days you need it most.
Three lines of discipline fix it: persist the state (trading-day stamp + day-start balance + blocked flag), take the day from the broker clock (TimeTradeServer, not TimeLocal), and write the state after the decision rather than before it. If the file is missing, rebuild the counters from the account's own deal history instead of assuming a fresh day.
The test that matters: let the cap trip, then kill the terminal (not just the EA) with a position open, reopen it, and try to take another trade. If the new process happily sends the order, the state was in memory and the guard was decoration.
I wrote the long version up as an article for the MQL5 Articles section — it should appear there if the moderators accept it. A free implementation of the whole pattern (source included, no DLLs, no external calls) is available here: xuks124.github.io/vigildesk/free.html
Almost every "daily loss guard" EA keeps its counter in a variable. Restart the terminal, recompile, switch the chart or reload the profile, and OnInit() runs again with zeroed state: the guard silently hands back the full day's risk allowance, exactly on the days you need it most.
Three lines of discipline fix it: persist the state (trading-day stamp + day-start balance + blocked flag), take the day from the broker clock (TimeTradeServer, not TimeLocal), and write the state after the decision rather than before it. If the file is missing, rebuild the counters from the account's own deal history instead of assuming a fresh day.
The test that matters: let the cap trip, then kill the terminal (not just the EA) with a position open, reopen it, and try to take another trade. If the new process happily sends the order, the state was in memory and the guard was decoration.
I wrote the long version up as an article for the MQL5 Articles section — it should appear there if the moderators accept it. A free implementation of the whole pattern (source included, no DLLs, no external calls) is available here: xuks124.github.io/vigildesk/free.html
: