31 Commits
Author SHA1 Message Date
mika@stocksharp.com 5b9fd0bf96 Harden analytics and compilation scripts
WHAT A SCRIPT PRINTS. The Python engine writes bytes and picks where to cut them, so a multi-byte
character arrives split between two writes. Decoding each write on its own turned such a character
into replacement marks - "тест 🚀" logged as "тест ???" - so the stream now decodes through a
stateful decoder that keeps an incomplete tail until the rest of its bytes turn up, guarded by a lock
because one stream serves concurrently running scripts. The buffer it decodes into is grown to fit
and then reused rather than allocated per write: this is the sink for everything a running script
prints, a line at a time. Only what the current write decoded is read back, so what a longer earlier
write left further along is never seen.

WHAT A CANCELLED RUN DOES. Init checked no token at all, and its blanket catch around each
common-file write swallowed the cancellation the file system raised - a caller who gave up was told
the environment was ready. It now checks before it starts and before each write, and lets
cancellation leave by the door it came in. The analytics scripts did the same thing differently:
they broke out of their loops on a cancelled token and then carried on to report a result computed
from half the data. They throw instead, in every language and at every level of the loop.

THE PYTHON BRIDGE TO AN ASYNC SEQUENCE. IronPython blocked on MoveNextAsync and DisposeAsync through
GetAwaiter().GetResult(). Those ValueTasks are backed by the async iterator's own state machine
rather than by a Task, and GetResult on such a ValueTask does not wait - it throws unless the
operation has already finished, which over an in-memory storage it has not. Both now bridge through
AsTask(), and DisposeAsync is invoked through IAsyncDisposable because IronPython cannot see an
explicit interface implementation as an instance member.

CORRELATION OVER TIME RATHER THAN OVER POSITION. Pearson collected each instrument's closes into a
flat list and lined the series up by index, so a minute missing from one instrument shifted
everything after it and the answer was a correlation of two series that were never contemporaneous.
The closes are keyed by candle time and correlated over the moments the instruments share.

AND A MATRIX THAT IS NOT ONE. The numpy bridge accepted ragged input and a None row, and produced
whatever fell out. It now says which row is the wrong length instead.
2026-09-14 18:22:25 +03:00
mika@stocksharp.com bee740d946 Analytics: let the indicator script state the assembly it imports from
indicator_script imports ROC from StockSharp.Algo.Indicators but referenced only
Messages, Algo, Algo.Analytics and Ecng.Drawing. The namespace was therefore
visible to the script solely when that assembly already happened to be loaded -
.NET loads lazily, so it is there only once some other code has touched a type
from it.

On a run where nothing had, the import failed with "No module named Indicators",
which reads like a missing file and is really a missing reference. It is the only
analytics script importing from that namespace, so it is the only one affected.
2026-07-31 20:40:35 +03:00
mika@stocksharp.com 06c0e5fc57 Update README links and English wording
Localize the community links to the per-language site URLs — chat
(stocksharp.com/<lang>/chat/), documentation (doc.stocksharp.com/<lang>/...)
and the main-site links (stocksharp.com/<lang>/...), and point the old
stocksharp.ru links at stocksharp.com/ru — with <lang> matching the language
each README is written in. Also fix the grammatical errors in the English
README (introduction and the Designer/Terminal/Shell/API blurbs).
2026-07-14 17:59:53 +03:00
mikasoukhov ec48ea8419 Small fix 2026-01-29 23:36:50 +03:00
mikasoukhov 639040f268 Small fixes. 2026-01-11 19:41:41 +03:00
mikasoukhov 39f595b5bf Fix commit 47a1d0bce9 2026-01-09 13:56:41 +03:00
mikasoukhov a5f12d309b Analytics supported IAsyncEnumerable 2026-01-02 12:03:47 +03:00
mikasoukhov 2a32ec7b66 IAsyncEnumerable<T> impl refactoring. 2025-12-20 12:22:30 +03:00
mikasoukhov 80142e76b0 Storage API async mode 2025-12-19 22:59:39 +03:00
mikasoukhov 25e621a4cf DateTimeOffset -> DateTime UTC 2025-11-02 18:40:36 +03:00
mikasoukhov be44ee4c31 IAnalyticsScript. TimeSpan -> DataType 2025-10-08 12:25:20 +03:00
Mikhail 4ae3ac6b68 Clarify Hydra analytics usage 2025-07-19 22:52:17 +03:00
Mikhail df7902d682 Remove license references from READMEs 2025-07-19 19:34:17 +03:00
Mikhail ad1147c979 Add detailed README for Python analytics scripts 2025-07-19 15:45:47 +03:00
mikasoukhov 977e96dad6 Code cleanup. 2025-07-18 00:21:23 +03:00
mikasoukhov cd3a3f1336 Small changes. 2025-07-17 23:00:38 +03:00
mikasoukhov c72eadc91c Small changes. 2025-07-16 20:26:09 +03:00
mikasoukhov 0a4cbc2e60 datatype_extensions.py 2025-07-16 18:28:45 +03:00
mikasoukhov 64250ce2cf Small changes. 2025-07-16 17:40:16 +03:00
mikasoukhov 628adfcfbf Code cleanup. 2025-07-15 00:35:11 +03:00
mikasoukhov a8946d32df Fix commit 00da36c786 2025-01-26 11:37:52 +03:00
mikasoukhov 007b7e7409 Fix commit 00da36c786 2025-01-26 11:12:08 +03:00
mikasoukhov 5521e51498 Fix commit 00da36c786 2025-01-25 18:05:48 +03:00
mikasoukhov 07b9496fe5 Fix commit 00da36c786 2025-01-25 17:33:35 +03:00
mikasoukhov 2bc167ce5b Fix commit 00da36c786 2025-01-25 17:09:06 +03:00
mikasoukhov a8f8266bfa Fix commit 00da36c786 2025-01-25 12:47:22 +03:00
mikasoukhov 34aab91d76 Fix commit 00da36c786 2025-01-25 12:44:25 +03:00
mikasoukhov 6a95122ae9 ILogReceiver. LogDebug, LogError, LogInfo, LogWarning, LogVerbose methods. 2025-01-22 18:01:19 +03:00
mikasoukhov 588392e5f5 Fix commit 00da36c786 2025-01-11 12:31:18 +03:00
mikasoukhov ef60e0fbe4 Fix commit 00da36c786 2025-01-11 11:22:01 +03:00
mikasoukhov 00da36c786 Algo.Analytics. C#, F#, Python versions. 2025-01-10 20:29:02 +03:00