Article:
- rename the deployment section to "Развёртывание через config/services.ini"
- keep only first-level sections in the table of contents, drop the
archive entry
- add the warning block and the archive table in the series format
- rename screenshots to meaningful English names
Publishing helpers (docs/publish):
- build_article_html.py builds the HTML fragment for the site editor with
anchored headings, linked table of contents, captions and code blocks
- code/ holds each code block as a separate file, description.txt the
short description
Code:
- static/script.js: bump version to 0.3.0
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Article:
- edit all sections, shorten schema drift story,
drop the useful-links and warning sections, keep first-level TOC only
- add "Тестирование" with three 750 px screenshots (docs/images)
- add "Содержание архива" with file versions
Code:
- ServiceStateWriter.mq5: use TERMINAL_DATA_PATH (portable-only), replace
ExecutePragma() with DatabaseExecute(), use built-in
ERR_DATABASE_NO_MORE_DATA, align comments with the article
- deploy_service.py: skip compilation when .ex5 is newer than the source
- bump versions: main.py 0.3.0, config.py 0.2.0, static/script.js 0.2.0
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Rewrite the introduction, main loop, and the opening sections so they
no longer repeat each other, add a "Намечаем путь" plan section, and
rebuild the table of contents. Add docs/style-notes.md with the style
guidelines derived from the author's published articles.
The MetaTrader5 module now ships wheels for Python 3.14 (verified:
import, initialize and account reads work on 3.12 and 3.14); there are
none for 3.15 yet. Update the Python version note in the article,
README and notes accordingly.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Reorder states columns to match ServiceStateWriter.mq5, add the
ResetLastError() call to the transaction snippet, and qualify the
Shared Projects claim as specific to this setup.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Add the schema-drift story (CREATE TABLE IF NOT EXISTS is not a
migration, swallowed OperationalError hid it) to the first-run section,
update the read_state snippet, and describe deploy_service.py including
the unreliable headless MetaEditor compile. Update plans and notes.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Wraps the manual steps we kept redoing after every schema/service
change: sync each terminal's Shared Projects copy via git, compile the
service, and drop config/services.ini into place.
Per-terminal headless MetaEditor compilation proved unreliable in
testing - it can exit 0 without producing a log or touching the .ex5,
seemingly needing an interactive desktop session. The script compiles
once against the repo's own working tree instead and copies the
resulting .ex5 to the other terminals, verifying success by checking
the file's mtime actually changed rather than trusting the exit code.
The bare except was hiding a real bug: the deployed service's states
table predated the company/holder_name columns, so every read raised
sqlite3.OperationalError: no such column: s.company. Since it was
caught silently, the UI just stuck on "starting" forever with no
indication why. Now the error text is printed so schema drift like
this is visible immediately instead of requiring manual DB inspection.
Path()'s example kwarg is deprecated in favor of examples (list) in
the installed FastAPI version. Separately, the installed Starlette
(1.3.1) removed the old TemplateResponse(name, context) calling
convention entirely, requiring request as the first positional
argument instead of a 'request' key in the context dict - the old
form crashed index() with "unhashable type: dict" from get_template().
Add static/services.ini as a reference example, and update both the
article draft and working notes with the discovery: placing this file
in the terminal installation's config folder auto-registers the
compiled service, removing the manual Navigator step. Note explicitly
that the file is undocumented (UTF-16LE, absent from the official
config file listing) and likely the terminal's own internal
serialization of Navigator-added services.
Add a section explaining services as an MQL5 program type (single
OnStart handler, no chart binding, per-instance thread, survives
account switches) and a section on the stop grace period, tying the
documented 3-second IsStopped() timeout to the service's jittered
Sleep(). Cite official docs for DatabaseBind indexing, transaction
speedup, and DATABASE_OPEN_COMMON; add a references section.
Код для /create пока тоже просто игнорируем, дойдем до него в пятой части цикла
Код в 56-58 main.py убираем, так как эта информация будет получена главной страницей через ajax-запросы
Формат времени везде сделаем в секундах, нам не нужна милисекундная точность