47 Commits
Author SHA1 Message Date
mika@stocksharp.com ac5c13b11c Mark the blocking wrappers obsolete
Connector.SendOutError, StrategyEngine.OnMessage, CodeInfo.Compile and both
TraderHelper.Compile overloads only wait for their async forms, so they are
obsolete in favour of SendOutErrorAsync, OnMessageAsync and CompileAsync.

IFitnessFormulaProvider compiles through CompileAsync and the genetic
optimizer awaits it; Compile stays as an obsolete extension.

A state property, an expression property, two formula parameters and a
lazily compiled candle condition cannot wait, so they call the obsolete forms
under a pragma. The MultiConnect sample awaits its storages instead of
blocking on them.
2026-10-04 11:28:26 +03:00
mika@stocksharp.com 6e7a7dae22 Move instrument lookups and persistence to async
Instrument lookups, configuration, credentials, CSV entities, snapshots and
the alert processing service are read and written asynchronously; the
blocking synchronous forms are obsolete wrappers.

IAsyncPersistable replaces IPersistable: every type that saves and loads its
settings has LoadAsync and SaveAsync only, and nested objects are read with
GetValueAsync, LoadEntireAsync and LoadAllAsync. The synchronous Load and Save
are the obsolete Ecng extensions. The MultiConnect sample keeps IPersistable
for two settings classes, because the settings window of the published
StockSharp.Xaml package takes it.

Copies that were made by saving and loading are made asynchronously.
IMessageAdapter, IIndicator, the risk, commission, PnL, latency, slippage and
position managers, IStorageBuffer, Strategy, DiagramElement, ICompositionModel
and its nodes get CloneAsync and no longer implement ICloneable; Clone is an
obsolete blocking wrapper. A strategy copy keeps every security and portfolio
parameter the original holds. Messages, FieldMapping, BankDetails and
WithdrawInfo are copied in memory. A CommissionRuleMessage shares its rule and
the emulator takes a copy of it. Envelope gets a constructor that takes all
three lines and CreateAsync.

ToBruteForce and ToBruteForceRandom become ToBruteForceAsync and
ToBruteForceRandomAsync and return IAsyncEnumerable; BruteForceOptimizer runs
over it and takes the next strategy through an asynchronous delegate.

Diagram elements keep their own state in SaveState, OnLoading and LoadState.
Undo restores an in-memory snapshot; a chart element holds its series and
axes in it by reference. An alert rule keeps its value in the form a message
carries it. A diagram strategy applies composition settings that were loaded
before the composition was set in SetCompositionAsync or at the start, and
saves them while they wait.

Strategies get an OnStartedAsync hook; diagram strategies resolve securities,
underlyings and strikes before the start so value processing never looks up
instruments. Paths.Serialize, SerializeInvariant, AppStartSettings.TrySave,
ICredentialsProvider.Save, ISnapshotSerializer.Serialize and the composition
registry gain async forms.

ICredentialsProvider.Delete becomes DeleteAsync, so loading, saving and
deleting the credentials wait for one another. Paths.InstalledVersion and
AppNameWithVersion are obsolete in favour of GetInstalledVersionAsync and
GetAppNameWithVersionAsync.

A file is opened for writing only after the last cancellation check, because
opening it empties it; a cancelled read reports the cancellation instead of
an empty result. A snapshot flush that failed leaves what it took due for the
next one.

The indicator templates for C#, F# and Python override LoadAsync and
SaveAsync.
2026-10-04 11:28:17 +03:00
mikasoukhov fd5ba4208f Code cleanup. 2025-12-22 22:16:17 +03:00
mikasoukhov 57a4834460 Fix commit 24bd79151f 2025-08-30 19:09:46 +03:00
mikasoukhov 5cd81e098c Small changes. 2025-08-30 18:10:33 +03:00
mikasoukhov 0e11f63fb9 CodeInfo. Auto-remove BOM. 2025-08-15 14:43:55 +03:00
mikasoukhov ec53696a8d Code cleanup. 2025-02-13 12:20:13 +03:00
mikasoukhov 9ca1129ac0 Fix commit 1c5e8a63ef 2025-02-04 20:02:47 +03:00
mikasoukhov ac96aadfae CodeInfo. Remove cache in case of invalid assembly loading. 2025-01-22 11:21:11 +03:00
mikasoukhov 7b2120dddd Fix commit f5de9d3d1d 2025-01-21 18:57:32 +03:00
mikasoukhov b7be22f12a CodeInfo. ModuleName property. 2025-01-21 17:31:56 +03:00
mikasoukhov ecb6b97ebb Fix commit cd9cec1ff1 2025-01-21 17:26:53 +03:00
mikasoukhov cd9cec1ff1 Build fix. 2025-01-21 16:57:52 +03:00
mikasoukhov fcebe1e3bd Build fix. 2025-01-17 20:41:46 +03:00
mikasoukhov 9d4232edf8 Code cleanup. 2025-01-14 15:59:31 +03:00
mikasoukhov 76dc1fb69e Fix commit 04e5a7e727 2025-01-14 11:42:57 +03:00
mikasoukhov 5d479bf369 Fix commit 24bd79151f 2025-01-12 17:47:02 +03:00
mikasoukhov 24bd79151f Build fix. 2025-01-12 16:51:14 +03:00
mikasoukhov 2650fe6cf5 Fix commit a67f926a23 2025-01-10 20:27:30 +03:00
mikasoukhov d657649bc6 Code cleanup. 2025-01-10 13:33:56 +03:00
mikasoukhov e44e126fa8 CompilationLanguages enum removed. 2025-01-10 13:22:25 +03:00
mikasoukhov a67f926a23 RoslynCompiler -> CSharpCompiler.
Compile made async.
CodeInfo. Language property added.
2025-01-09 17:46:58 +03:00
mikasoukhov 0d7c80bc1c Fix commit 2d05170c38 2024-11-07 23:24:45 +03:00
mikasoukhov 2d05170c38 CodeInfo. NuGet references. 2024-11-07 22:47:20 +03:00
mikasoukhov f3b9300d02 CodeInfo. References -> AssemblyReferences + ProjectReferences. 2024-11-07 22:42:59 +03:00
mikasoukhov 3d565dca80 Code extensions moved to Ecng 2024-11-01 21:00:20 +03:00
mikasoukhov 0a49e1e91e CodeExtensions. TryFindType 2024-10-31 13:27:50 +03:00
mikasoukhov 13fe4a9a98 CodeInfo. Dispose own asm context. 2024-10-31 12:49:04 +03:00
mikasoukhov 61a10201c9 Code cleanup. 2024-10-21 18:38:14 +03:00
mikasoukhov 7e67bd3d10 Fix commit 7e489ea565 2024-09-19 13:19:58 +03:00
mikasoukhov 7e489ea565 ChartIndicatorDrawStyles moved to Ecng.Drawing 2024-09-14 10:20:50 +03:00
mikasoukhov 5ff7e5e296 Code cleanup 2024-08-19 00:30:24 +03:00
mikasoukhov 6b3165ad96 Code cleanup 2024-08-19 00:08:27 +03:00
mikasoukhov a2a793fbca CodeInfo. IsCompilable 2023-12-17 22:43:26 +03:00
mikasoukhov 4d7d3bba35 CodeInfo. Assembly property 2023-11-06 19:10:39 +03:00
mikasoukhov 119a0563b2 Fix commit 602ce45ec8 2023-10-22 18:29:36 +03:00
mikasoukhov de32f3b870 Fix commit 04e5a7e727 2023-10-03 20:26:11 +03:00
mikasoukhov 602ce45ec8 CodeInfo inherits from NotifiableObject 2023-09-30 15:47:01 +03:00
mikasoukhov 9c6cefd62a Code cleanup. 2023-09-26 06:56:23 +03:00
mikasoukhov f2feb66ef1 Code cleanup. 2023-09-22 10:23:59 +03:00
mikasoukhov f5de9d3d1d ICompilerCache usage, Assembly unloading supported. 2023-09-08 17:43:19 +03:00
mikasoukhov cfb3923102 Build fix. 2023-09-08 11:10:41 +03:00
mikasoukhov 8d5dc77f5b CodeInfo supports global usings. 2023-03-12 18:48:42 +03:00
mikasoukhov c6a5edfdf4 Fix commit 04e5a7e727 2023-03-12 11:02:08 +03:00
mikasoukhov 175cb405c6 CodeInfo. NameChanged event. 2023-03-05 19:28:17 +03:00
mikasoukhov 04e5a7e727 Fix commit 533384e809 2023-03-05 17:54:37 +03:00
mikasoukhov d10fe6a501 Fix commit 533384e809 2023-03-05 01:12:10 +03:00