← Назад

[3.0.1] MarketDataSourceSettings_Create doesn't exist.

Михаил,

Создал MSSQL2008 базу trading на основе trading.sql из 3.0.1

При загрузке плагинов получил исключение

Гидра 22:53:28.7968750 System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: The stored procedure 'MarketDataSourceSettings_Create' doesn't exist.

Смею предположить, что trading.sql не соответствует сборке 3.0.1

Перед этим были аналогичная ошибка с MarketDataSourceSettings_ReadByIDSourceId, я нашел в БД процедуру с слегка отличным именем MarketDataLoaderSettings_ReadByLoaderId и переименовал.

С уважением.

Комментарии (23)

Вход или Создать аккаунт, Войдите или зарегистрируйтесь, чтобы оставить комментарий

Mikhail Sukhov
Mikhail Sukhov

pyhta4og: Смею предположить, что trading.sql не соответствует сборке 3.0.1

Так и есть.

pyhta4og
pyhta4og Автор

выложите?

pyhta4og
pyhta4og Автор

[3.0.2]

Действия: 0. Создал БД со скриптом trading.sql из 3.0.2

  1. Запустил Hydra
  2. Нажал Инструменты-Обновить
  3. Выпал диалог с SQL ошибкой. Она же записана в логи

Finam 20:46:06.1406250 Вне диапазона времени.
RTS 20:46:06.2031250 Вне диапазона времени.
Гидра 20:54:01.5156250 System.Data.SqlClient.SqlException: Error 547, Level 16, State 0, Procedure Security_UpdateById, Line 119, Message: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Security_Exchange". The conflict occurred in database "trading", table "dbo.Exchange", column 'Name'.
Error Number:        547
Line Number:        119
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Security_Exchange". The conflict occurred in database "trading", table "dbo.Exchange", column 'Name'.
....
  at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Ecng.Data.DatabaseCommand.<ExecuteNonQuery>b__5(DbCommand cmd)
   at Ecng.Data.DatabaseCommand.<>c__DisplayClass3`1.<Execute>b__0(DbConnection connection)
   at Ecng.Data.Database.GetConnection(Action`1 action)
   at Ecng.Data.DatabaseCommand.Execute[TResult](IEnumerable`1 input, Func`2 handler)
   at Ecng.Data.DatabaseCommand.ExecuteNonQuery(SerializationItemCollection input)
   at Ecng.Data.Database.Execute(DatabaseCommand command, SerializationItemCollection source, Boolean needRetVal)
   at Ecng.Data.Database.Update(DatabaseCommand command, SerializationItemCollection source, Boolean needRetVal)
   at Ecng.Data.Database.<>c__DisplayClassf`1.<Update>b__e()
   at Ecng.Data.Database.Update[TEntity](TEntity entity, FieldCollection keyFields, FieldCollection valueFields)
   at Ecng.Data.Database.Update[TEntity](TEntity entity, FieldCollection valueFields)
   at Ecng.Data.Database.Update[TEntity](TEntity entity)
   at Ecng.Serialization.RelationManyList`1.OnUpdate(TEntity entity)
   at Ecng.Data.HierarchicalPageLoadList`1.OnUpdate(TEntity entity)
   at Ecng.Serialization.RelationManyList`1.Update(TEntity entity)
   at Ecng.Trading.Algo.Storages.BaseStorageEntityList`1.Save(T entity)
   at Ecng.Trading.Hydra.Core.SecurityStorage.Save(Security security) in D:\SS\Sources\Hydra\Core\SecurityStorage.cs:line 69
   at Ecng.Trading.Hydra.Finam.FinamSecurityStorage.Save(Security security) in D:\SS\Sources\Hydra\Plugins\Finam\FinamSecurityStorage.cs:line 32
   at Ecng.Trading.Algo.History.Finam.FinamHistorySource.GetNewSecurities()
   at Ecng.Trading.Hydra.Finam.FinamTradeSource.GetNewSecurities() in 
....

В Ecng.Trading.Hydra.Finam.FinamSecurityStorage.Save(Security) поставил брекпойнт Security=TESTESSR, Exchange=Тестовая биржа

Руками создал в Exchange Тестовая биржа и ММВБ в результате Hydra скачала 3000 c чем-то security. Значит, проблема в отсутствии записей в Exchange.

Посмотрел базу получилось 314 security из ММВБ и 3304 из Тестовая биржа

Но в окне "Инструменты" они не появились, какие бы фильтры я не выбирал.

Далее, я поставил источнику "РТС" и "Finam" IsEnabled=true, working from=0:0:0, working to=23.59.59.

и нажал "Старт".

В итоге в логе получил


Finam 21:50:00.4687500 Стартовал.
Finam 21:50:00.4687500 System.NullReferenceException: Object reference not set to an instance of an object.
   at Ecng.Trading.Hydra.Finam.FinamTradeSource.Load(Security security) in D:\SS\Sources\Hydra\Plugins\Finam\FinamTradeSource.cs:line 158
at Ecng.Trading.Hydra.Worker.<Download>b__10(IMarketDataSource source) in D:\SS\Sources\Hydra\Hydra\Worker.cs:line 112

RTS 21:50:00.4843750 Стартовал.
RTS 21:51:19.0937500 System.Data.SqlClient.SqlException: Error 547, Level 16, State 0, Procedure Security_UpdateById, Line 119, Message: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Security_Exchange". The conflict occurred in database "trading", table "dbo.Exchange", column 'Name'.
Error Number:        547
Line Number:        119
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Security_Exchange". The conflict occurred in database "trading", table "dbo.Exchange", column 'Name'.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Ecng.Data.DatabaseCommand.<ExecuteNonQuery>b__5(DbCommand cmd)
   at Ecng.Data.DatabaseCommand.<>c__DisplayClass3`1.<Execute>b__0(DbConnection connection)
   at Ecng.Data.Database.GetConnection(Action`1 action)
   at Ecng.Data.DatabaseCommand.Execute[TResult](IEnumerable`1 input, Func`2 handler)
   at Ecng.Data.DatabaseCommand.ExecuteNonQuery(SerializationItemCollection input)
   at Ecng.Data.Database.Execute(DatabaseCommand command, SerializationItemCollection source, Boolean needRetVal)
   at Ecng.Data.Database.Update(DatabaseCommand command, SerializationItemCollection source, Boolean needRetVal)
   at Ecng.Data.Database.<>c__DisplayClassf`1.<Update>b__e()
   at Ecng.Data.Database.Update[TEntity](TEntity entity, FieldCollection keyFields, FieldCollection valueFields)
   at Ecng.Data.Database.Update[TEntity](TEntity entity, FieldCollection valueFields)
   at Ecng.Data.Database.Update[TEntity](TEntity entity)
   at Ecng.Serialization.RelationManyList`1.OnUpdate(TEntity entity)
   at Ecng.Data.HierarchicalPageLoadList`1.OnUpdate(TEntity entity)
   at Ecng.Serialization.RelationManyList`1.Update(TEntity entity)
   at Ecng.Trading.Algo.Storages.BaseStorageEntityList`1.Save(T entity)
   at Ecng.Trading.Hydra.Core.SecurityStorage.Save(Security security) in D:\SS\Sources\Hydra\Core\SecurityStorage.cs:line 69
   at Ecng.Trading.Algo.History.Rts.RtsHistorySource.GetTrades(DateTime time)
   at Ecng.Trading.Hydra.Rts.RtsTradeSource.Load(Security security) in D:\SS\Sources\Hydra\Plugins\Rts\RtsTradeSource.cs:line 168
   at Ecng.Trading.Hydra.Worker.<Download>b__10(IMarketDataSource source) in D:\SS\Sources\Hydra\Hydra\Worker.cs:line 112

Тут сразу две проблемы - одна с передачей null в FinamTradeSource.Load (при загрузке через Finam) вторая, видимо, снова с отсутствующей записью в Exchange (при загрузке через РТС)

После этого всего я закрыл Hydra. Когда заново запустил получил на старте


System.Data.SqlClient.SqlException: Procedure or function 'PageSelect' expects parameter '@columns', which was not supplied.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader()
   at Ecng.Data.DatabaseCommand.<ExecuteTable>b__a(DbCommand cmd)
   at Ecng.Data.DatabaseCommand.<>c__DisplayClass3`1.<Execute>b__0(DbConnection connection)
   at Ecng.Data.Database.GetConnection(Action`1 action)
   at Ecng.Data.DatabaseCommand.Execute[TResult](IEnumerable`1 input, Func`2 handler)
   at Ecng.Data.DatabaseCommand.ExecuteTable(SerializationItemCollection input)
   at Ecng.Data.Database.ReadAll[TEntity](DatabaseCommand command, SerializationItemCollection input)
   at Ecng.Data.HierarchicalDatabase.ReadAll[TEntity](DatabaseCommand command, SerializationItemCollection source)
   at Ecng.Data.Database.ReadAll[TEntity](Int64 startIndex, Int64 count, Field orderBy, SortDirection direction)
   at Ecng.Data.Database.Ecng.Serialization.IStorage.GetGroup[TEntity](Int64 startIndex, Int64 count, Field orderBy, SortDirection direction)
   at Ecng.Serialization.RelationManyList`1.OnGetGroup(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction)
   at Ecng.Data.HierarchicalPageLoadList`1.OnGetGroup(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction)
   at Ecng.Serialization.RelationManyList`1.ReadAll(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction)
   at Ecng.Serialization.RelationManyList`1.GetRange(Int64 startIndex, Int64 count, String sortExpression, SortDirection directions)
   at Ecng.Collections.BaseListEx`1.GetRange(Int64 startIndex, Int64 count)
   at Ecng.Serialization.RelationManyList`1.get_Count()
   at Ecng.Serialization.RelationManyList`1.RelationManyListEnumerator.ProcessMove(Boolean& canProcess)
   at Ecng.Collections.BaseEnumerator`2.System.Collections.IEnumerator.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at Ecng.Collections.CollectionHelper.AddRange[T](ICollection`1 source, IEnumerable`1 items)
   at Ecng.Trading.Hydra.MainWindow.FillSecurities() in D:\SS\Sources\Hydra\Hydra\MainWindow.xaml.cs:line 155
   at Ecng.Trading.Hydra.MainWindow..ctor() in D:\SS\Sources\Hydra\Hydra\MainWindow.xaml.cs:line 64
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
   at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail)
   --- End of inner exception stack trace ---
   at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
   at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
   at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException)
   at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail)
   at System.Windows.Markup.BamlRecordReader.GetElementAndFlags(BamlElementStartRecord bamlElementStartRecord, Object& element, ReaderFlags& flags, Type& delayCreatedType, Int16& delayCreatedTypeId)
   at System.Windows.Markup.BamlRecordReader.BaseReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
   at System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
   at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
   at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
   at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
   at System.Windows.Markup.TreeBuilder.Parse()
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
   at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
   at System.Windows.Application.DoStartup()
   at System.Windows.Application.<.ctor>b__0(Object unused)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

Это уже вне моего какого бы то понимания, потому что это похоже на stored procedure .net, в чем я слабо разбираюсь, особенно без исходников, но чувствуется что Ecng.Serialization и Ecng.Data вещи нетривиальные ;)

Есть догадка, что Ecng.Trading.Hydra.MainWindow.FillSecurities() загружает объекты из таблицы Exchange которые я руками добавил и скорее всего некорректно (все поля кроме Name оставил пустыми)

В общем, похоже дело в создании Exchange, но я не знаю толи они должны автоматически создаваться кодом, толи их создание должно быть в trading.sql.

Кроме того в trading.sql обнаружил в начале явный CREATE DATABASE с абсолютными путями. Мне кажется создать базу должен пользователь сам, а в скрипте должны инициализироваться все объекты БД.

С уважением.

Mikhail Sukhov
Mikhail Sukhov

Да, в PageLoad косяк. Должно выглядеть так:

CREATE PROCEDURE [dbo].[PageSelect]
	@table [nvarchar](4000),
	@startIndex [bigint],
	@count [bigint],
	@orderByColumn [nvarchar](4000) = null,
	@columns [nvarchar](4000) = null,
	@filter [nvarchar](4000) = null,
	@param1 [sql_variant] = null,
	@param2 [sql_variant] = null,
	@param3 [sql_variant] = null,
	@param4 [sql_variant] = null,
	@param5 [sql_variant] = null,
	@param6 [sql_variant] = null,
	@param7 [sql_variant] = null,
	@param8 [sql_variant] = null,
	@param9 [sql_variant] = null,
	@param10 [sql_variant] = null
AS
EXTERNAL NAME [Ecng.Data.SqlServer].[Ecng.Data.SqlServer.SqlExtendedProcedures].[PageSelect]

С биржами багу исправил.

Mikhail Sukhov
Mikhail Sukhov

pyhta4og: Но в окне "Инструменты" они не появились, какие бы фильтры я не выбирал.

Надо ввести хоть один символ из названия в поле в левом верхнем углу.

pyhta4og
pyhta4og Автор

Mikhail Sukhov: Да, в PageLoad косяк. Должно выглядеть так:

CREATE PROCEDURE [dbo].[PageSelect] @table nvarchar, @startIndex [bigint], @count [bigint], @orderByColumn nvarchar = null, @columns nvarchar = null, @filter nvarchar = null, @param1 [sql_variant] = null, @param2 [sql_variant] = null, @param3 [sql_variant] = null, @param4 [sql_variant] = null, @param5 [sql_variant] = null, @param6 [sql_variant] = null, @param7 [sql_variant] = null, @param8 [sql_variant] = null, @param9 [sql_variant] = null, @param10 [sql_variant] = null AS EXTERNAL NAME [Ecng.Data.SqlServer].[Ecng.Data.SqlServer.SqlExtendedProcedures].[PageSelect]

> 
> С биржами багу исправил.


Обновил определение процедуры.

Теперь десериализовать что-то не может. Чего я только в поля Exchange не записывал. Буду ждать обновления, которое само биржи в базу пишет.

System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res) at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) at System.Xml.Linq.XDocument.Load(XmlReader reader) at Ecng.Serialization.XmlSerializer1.Deserialize(Stream stream, FieldCollection fields, SerializationItemCollection source) at Ecng.Serialization.Serializer1.Deserialize(Stream stream, SerializationItemCollection source) at Ecng.Data.Database.GroupSource(IEnumerable1 fields, SerializationItemCollection input, IEnumerable1 innerSchemaNameOverrides) at Ecng.Data.Database.GetOrAddCache[TEntity](SerializationItemCollection input) at Ecng.Data.Database.Read[TEntity](DatabaseCommand command, SerializationItemCollection input) at Ecng.Data.Database.Read[TEntity](SerializationItemCollection by) at Ecng.Data.Database.Read[TEntity](SerializationItem by) at Ecng.Data.Database.Read[TEntity](Object id) at Ecng.Data.Database.Ecng.Serialization.IStorage.GetById[TEntity](Object id) at Ecng.Serialization.RelationSingleFieldFactory2.OnCreateInstance(ISerializer serializer, TSource source) at Ecng.Serialization.FieldFactory2.OnCreateInstance(ISerializer serializer, Object source) at Ecng.Serialization.FieldFactory.CreateInstance(ISerializer serializer, SerializationItem source) at Ecng.Serialization.Serializer1.Deserialize(SerializationItemCollection source, FieldCollection fields, T graph) at Ecng.Data.Database.<>c__DisplayClass221.<GetOrAddCacheTable>b__1d() at Ecng.Data.Database.AddCache[TEntity](TEntity entity, String key, Object id, SerializationItemCollection source, Boolean newEntry, Action action) at Ecng.Data.Database.GetOrAddCacheTable[TEntity](SerializationItemCollection table) at Ecng.Data.Database.ReadAll[TEntity](DatabaseCommand command, SerializationItemCollection input) at Ecng.Data.HierarchicalDatabase.ReadAll[TEntity](DatabaseCommand command, SerializationItemCollection source) at Ecng.Data.Database.ReadAll[TEntity](Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Data.Database.Ecng.Serialization.IStorage.GetGroup[TEntity](Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Serialization.RelationManyList1.OnGetGroup(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Data.HierarchicalPageLoadList1.OnGetGroup(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Serialization.RelationManyList1.ReadAll(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Serialization.RelationManyList1.GetRange(Int64 startIndex, Int64 count, String sortExpression, SortDirection directions) at Ecng.Collections.BaseListEx1.GetRange(Int64 startIndex, Int64 count) at Ecng.Serialization.RelationManyList1.get_Count() at Ecng.Serialization.RelationManyList1.RelationManyListEnumerator.ProcessMove(Boolean& canProcess) at Ecng.Collections.BaseEnumerator2.System.Collections.IEnumerator.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() at Ecng.Collections.CollectionHelper.AddRange[T](ICollection1 source, IEnumerable1 items) at Ecng.Trading.Hydra.MainWindow.FillSecurities() in D:\SS\Sources\Hydra\Hydra\MainWindow.xaml.cs:line 155 at Ecng.Trading.Hydra.MainWindow..ctor() in D:\SS\Sources\Hydra\Hydra\MainWindow.xaml.cs:line 64 --- End of inner exception stack trace --- at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail) --- End of inner exception stack trace --- at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType) at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException) at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException) at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail) at System.Windows.Markup.BamlRecordReader.GetElementAndFlags(BamlElementStartRecord bamlElementStartRecord, Object& element, ReaderFlags& flags, Type& delayCreatedType, Int16& delayCreatedTypeId) at System.Windows.Markup.BamlRecordReader.BaseReadElementStartRecord(BamlElementStartRecord bamlElementRecord) at System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord) at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord) at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord) at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment() at System.Windows.Markup.TreeBuilder.Parse() at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc) at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties) at System.Windows.Application.DoStartup() at System.Windows.Application.<.ctor>b__0(Object unused) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

Mikhail Sukhov
Mikhail Sukhov

pyhta4og: Обновил определение процедуры.

Теперь десериализовать что-то не может. Чего я только в поля Exchange не записывал. Буду ждать обновления, которое само биржи в базу пишет.

Ставьте это в код Гидры (главное окно, конструктор) и запустите:


_storage = ConfigManager.ServiceLocator.GetInstance<HydraStorage>();

_storage.Exchanges.Add(Exchange.Test);
_storage.Exchanges.Add(Exchange.Micex);
_storage.Exchanges.Add(Exchange.Rts);

pyhta4og
pyhta4og Автор

Теперь процедуру Exchange_Create не находит.


 System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: The stored procedure 'Exchange_Create' doesn't exist.
   at System.Data.SqlClient.SqlCommand.DeriveParameters()
   at System.Data.SqlClient.SqlCommandBuilder.DeriveParameters(SqlCommand command)
   at Ecng.Data.SqlServerDatabaseProvider.DeriveParameters(DbCommand command)
   at Ecng.Data.Database.<>c__DisplayClass7.<GetCommand>b__6(Query )
   at Ecng.Collections.CollectionHelper.SafeAdd[TKey,TValue](IDictionary`2 dictionary, TKey key, Func`2 handler)
   at Ecng.Data.Database.GetCommand(Query commandQuery, SerializationItemCollection source)
   at Ecng.Data.Database.GetCommand(Schema schema, SqlCommandTypes type, FieldCollection keyFields, FieldCollection valueFields, SerializationItemCollection source)
   at Ecng.Data.HierarchicalDatabase.GetCommand(Schema schema, SqlCommandTypes type, FieldCollection keyFields, FieldCollection valueFields, SerializationItemCollection source)
   at Ecng.Data.Database.Create[TEntity](TEntity entity)
   at Ecng.Data.Database.Ecng.Serialization.IStorage.Add[TEntity](TEntity entity)
   at Ecng.Serialization.RelationManyList`1.OnAdd(TEntity entity)
   at Ecng.Data.HierarchicalPageLoadList`1.OnAdd(TEntity entity)
   at Ecng.Serialization.RelationManyList`1.Add(TEntity item)
   at Ecng.Trading.Hydra.MainWindow..ctor() in 

Mikhail Sukhov
Mikhail Sukhov

pyhta4og: Теперь процедуру Exchange_Create не находит.

Сорри, описался:

_storage = ConfigManager.ServiceLocator.GetInstance<HydraStorage>();

_storage.Exchanges.Save(Exchange.Test);
_storage.Exchanges.Save(Exchange.Micex);
_storage.Exchanges.Save(Exchange.Rts);
pyhta4og
pyhta4og Автор

[3.0.2]

Пробовал загрузить Security из хранилища


           IStorage storage = new HierarchicalDatabase("Hydra", "Server=(local);Database=Trading;User ID=trading;Password=trading;");
            ITradingStorage tradingStorage = new TradingStorage(storage);

            IEnumerable<Security> securities = tradingStorage.Securities;
            foreach (Security s in securities)
            {
               Console.WriteLine(s.Name);
            }

получил Procedure or function 'Security_ReadAll' expects parameter '@StartIndex', which was not supplied.


   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader()
   at Ecng.Data.DatabaseCommand.&amp;lt;ExecuteTable&amp;gt;b__a(DbCommand cmd)
   at Ecng.Data.DatabaseCommand.&amp;lt;&amp;gt;c__DisplayClass3`1.&amp;lt;Execute&amp;gt;b__0(DbConnection connection)
   at Ecng.Data.Database.GetConnection(Action`1 action)
   at Ecng.Data.DatabaseCommand.Execute[TResult](IEnumerable`1 input, Func`2 handler)
   at Ecng.Data.DatabaseCommand.ExecuteTable(SerializationItemCollection input)
   at Ecng.Data.Database.ReadAll[TEntity](DatabaseCommand command, SerializationItemCollection input)
   at Ecng.Data.HierarchicalDatabase.ReadAll[TEntity](DatabaseCommand command, SerializationItemCollection source)
   at Ecng.Data.Database.ReadAll[TEntity](Int64 startIndex, Int64 count, Field orderBy, SortDirection direction)
   at Ecng.Data.Database.Ecng.Serialization.IStorage.GetGroup[TEntity](Int64 startIndex, Int64 count, Field orderBy, SortDirection direction)
   at Ecng.Serialization.RelationManyList`1.OnGetGroup(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction)
   at Ecng.Data.HierarchicalPageLoadList`1.OnGetGroup(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction)
   at Ecng.Serialization.RelationManyList`1.ReadAll(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction)
   at Ecng.Serialization.RelationManyList`1.GetRange(Int64 startIndex, Int64 count, String sortExpression, SortDirection directions)
   at Ecng.Collections.BaseListEx`1.GetRange(Int64 startIndex, Int64 count)
   at Ecng.Serialization.RelationManyList`1.get_Count()
   at Ecng.Serialization.RelationManyList`1.RelationManyListEnumerator.ProcessMove(Boolean&amp;amp; canProcess)
   at Ecng.Collections.BaseEnumerator`2.System.Collections.IEnumerator.MoveNext()
   at Tests.Program.Main(String[] args) in D:\SS\Sources\Tests\Program.cs:line 23
   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()</StackTrace><ExceptionString>System.Data.SqlClient.SqlException: Procedure or function 'Security_ReadAll' expects parameter '@StartIndex', which was not supplied.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader()
   at Ecng.Data.DatabaseCommand.&amp;lt;ExecuteTable&amp;gt;b__a(DbCommand cmd)
   at Ecng.Data.DatabaseCommand.&amp;lt;&amp;gt;c__DisplayClass3`1.&amp;lt;Execute&amp;gt;b__0(DbConnection connection)
   at Ecng.Data.Database.GetConnection(Action`1 action)
   at Ecng.Data.DatabaseCommand.Execute[TResult](IEnumerable`1 input, Func`2 handler)
   at Ecng.Data.DatabaseCommand.ExecuteTable(SerializationItemCollection input)
   at Ecng.Data.Database.ReadAll[TEntity](DatabaseCommand command, SerializationItemCollection input)
   at Ecng.Data.HierarchicalDatabase.ReadAll[TEntity](DatabaseCommand command, SerializationItemCollection source)
   at Ecng.Data.Database.ReadAll[TEntity](Int64 startIndex, Int64 count, Field orderBy, SortDirection direction)
   at Ecng.Data.Database.Ecng.Serialization.IStorage.GetGroup[TEntity](Int64 startIndex, Int64 count, Field orderBy, SortDirection direction)
   at Ecng.Serialization.RelationManyList`1.OnGetGroup(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction)
   at Ecng.Data.HierarchicalPageLoadList`1.OnGetGroup(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction)
   at Ecng.Serialization.RelationManyList`1.ReadAll(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction)
   at Ecng.Serialization.RelationManyList`1.GetRange(Int64 startIndex, Int64 count, String sortExpression, SortDirection directions)
   at Ecng.Collections.BaseListEx`1.GetRange(Int64 startIndex, Int64 count)
   at Ecng.Serialization.RelationManyList`1.get_Count()
   at Ecng.Serialization.RelationManyList`1.RelationManyListEnumerator.ProcessMove(Boolean&amp;amp; canProcess)
   at Ecng.Collections.BaseEnumerator`2.System.Collections.IEnumerator.MoveNext()
   at Tests.Program.Main(String[] args) in D:\SS\Sources\Tests\Program.cs:line 23
   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()</ExceptionString><DataItems><Data><Key>HelpLink.ProdName</Key><Value>Microsoft SQL Server</Value></Data><Data><Key>HelpLink.ProdVer</Key><Value>10.50.1600</Value></Data><Data><Key>HelpLink.EvtSrc</Key><Value>MSSQLServer</Value></Data><Data><Key>HelpLink.EvtID</Key><Value>201</Value></Data><Data><Key>HelpLink.BaseHelpUrl</Key><Value>http://go.microsoft.com/fwlink</Value></Data><Data><Key>HelpLink.LinkId</Key><Value>20476</Value></Data></DataItems></Exception></TraceRecord>
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll

Additional information: Procedure or function 'Security_ReadAll' expects parameter '@StartIndex', which was not supplied.


Странно тк, в гидре похожая вещь в FillSecurities проходит успешно


		private void FillSecurities()
		{
			this.SecuritiesCtrl.Securities.Clear();
			this.SecuritiesCtrl.Securities.AddRange(_storage.Securities.Select(s => new VisualSecurity(s)).Where(s => s.IsSelected));
		}

В чем может быть дело?

Mikhail Sukhov
Mikhail Sukhov

pyhta4og: [3.0.2]

Пробовал загрузить Security из хранилища

       IStorage storage = new HierarchicalDatabase("Hydra", "Server=(local);Database=Trading;User ID=trading;Password=trading;");
        ITradingStorage tradingStorage = new TradingStorage(storage);

        IEnumerable<Security> securities = tradingStorage.Securities;
        foreach (Security s in securities)
        {
           Console.WriteLine(s.Name);
        }
> 
> получил
> Procedure or function 'Security_ReadAll' expects parameter '@StartIndex', which was not supplied.

Вставил код прямо в конструктор Гидры - все сработало. app.config правильно оформлен, как в Гидре?
pyhta4og
pyhta4og Автор

[3.0.3]

Хочу загрузить все трейды из ITradingSource.

А какой диапазон дат ставить?

Никакого API определяющего диапазон дат для загруженных в хранилище данных нет

Предлагаю добавить метод ITradingSource.GetTradesHistoryRange(Security s) который вернет Range<DateTime> c минимальной и максимальной датами загруженных данных.

Mikhail Sukhov
Mikhail Sukhov

pyhta4og: [3.0.3]

Хочу загрузить все трейды из ITradingSource.

А какой диапазон дат ставить?

Никакого API определяющего диапазон дат для загруженных в хранилище данных нет

Есть, прочитайте документацию про Storage API.

pyhta4og
pyhta4og Автор

Михаил,

Наверноя слепой ;)

Подскажите пожалуйста класс и метод?

Я смотрел в ITradingStorage, TradingStorage и в Security но ничего похожего на MinDataDate/MaxDataDate не нашел :(

C уважением.

Mikhail Sukhov
Mikhail Sukhov

pyhta4og: Михаил,

Наверноя слепой ;)

Подскажите пожалуйста класс и метод?

Я смотрел в ITradingStorage, TradingStorage и в Security но ничего похожего на MinDataDate/MaxDataDate не нашел :(

C уважением.

Я не увидел что нужны границы... Вообще так ITradingStorage.LoadTrades(Date,Date). А чтобы максимум и минимум. Я такое не делал.

pyhta4og
pyhta4og Автор

Mikhail Sukhov: Я не увидел что нужны границы... Вообще так ITradingStorage.LoadTrades(Date,Date). А чтобы максимум и минимум. Я такое не делал.

Было бы неплохо иметь такие функции чтобы знать сколько данных загружено.

Еще попытался тестировать гидру со SmartCom

инструменты обновились нормально. выставил RIH1 чтобы сделки и стаканы грузились через Smart. Нажал Старт получил


Гидра 22:15:34.5490722 System.NullReferenceException: Object reference not set to an instance of an object.
   at StClientLib.StServerClass.ListenBidAsks(String symbol)
   at Ecng.Trading.Smart.SmartComWrapper.#=qAYx9wRCrRwCsEvMIqJuSgRgxHhTzoVKynXCwY29J47g=.#=qQWM2BZ4kU_vIQoUdCvvwLYBvgw2GJTRY3CURu521YsA=(StServer #=qk3EKmsV5YhpTL_gnGQeRnQ==)
   at Ecng.Trading.Smart.SmartComWrapper.#=qUkHEOz9HdRARjxQqM_waXQ==(Action`1 #=q$iWVMFQ9Wr$U1L3LRTs2ug==)
   at Ecng.Trading.Smart.SmartComWrapper.RegisterQuotes(String securityId)
   at Ecng.Trading.Smart.SmartTrader.RegisterQuotes(Security security)
   at Ecng.Collections.CollectionHelper.ForEach[T](IEnumerable`1 source, Action`1 action)
   at Ecng.Trading.Hydra.Smart.SmartDepthSource.Start(IEnumerable`1 securities) in D:\SS\Sources\Hydra\Plugins\Smart\SmartDepthSource.cs:line 156
   at Ecng.Trading.Hydra.Worker.<Start>b__5(IMarketDataSource source) in D:\SS\Sources\Hydra\Hydra\Worker.cs:line 58
   at Ecng.Collections.CollectionHelper.ForEach[T](IEnumerable`1 source, Action`1 action)
   at Ecng.Trading.Hydra.Worker.Start(IEnumerable`1 securities) in D:\SS\Sources\Hydra\Hydra\Worker.cs:line 58
   at Ecng.Trading.Hydra.MainWindow.StartStop_Click(Object sender, RoutedEventArgs e) in D:\SS\Sources\Hydra\Hydra\MainWindow.xaml.cs:line 148
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
Гидра 22:16:18.2488408 System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
   at StClientLib.StServerClass.connect(String ip, Int16 port, String login, String password)
   at Ecng.Trading.Smart.SmartComWrapper.#=qmUYt5ip9xuNsbQGGjewvRg==(StServer #=qVZ7ybW$vfy1UI6xv7Nw9MQ==)
   at Ecng.Trading.Smart.SmartComWrapper.#=qUkHEOz9HdRARjxQqM_waXQ==(Action`1 #=q$iWVMFQ9Wr$U1L3LRTs2ug==)
   at Ecng.Trading.Smart.SmartComWrapper.Connect()
   at Ecng.Trading.Smart.SmartTrader.OnConnect()
   at Ecng.Trading.Algo.BaseTrader.Connect()
   at Ecng.Trading.Hydra.Core.MarketDataTrader.Start() in D:\SS\Sources\Hydra\Core\MarketDataTrader.cs:line 124
   at Ecng.Trading.Hydra.Smart.SmartDepthSource.Start(IEnumerable`1 securities) in D:\SS\Sources\Hydra\Plugins\Smart\SmartDepthSource.cs:line 155
   at Ecng.Trading.Hydra.Worker.<Start>b__5(IMarketDataSource source) in D:\SS\Sources\Hydra\Hydra\Worker.cs:line 58
   at Ecng.Collections.CollectionHelper.ForEach[T](IEnumerable`1 source, Action`1 action)
   at Ecng.Trading.Hydra.Worker.Start(IEnumerable`1 securities) in D:\SS\Sources\Hydra\Hydra\Worker.cs:line 58
   at Ecng.Trading.Hydra.MainWindow.StartStop_Click(Object sender, RoutedEventArgs e) in D:\SS\Sources\Hydra\Hydra\MainWindow.xaml.cs:line 148
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
Гидра 22:16:36.9349056 System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
   at StClientLib.StServerClass.connect(String ip, Int16 port, String login, String password)
   at Ecng.Trading.Smart.SmartComWrapper.#=qmUYt5ip9xuNsbQGGjewvRg==(StServer #=qVZ7ybW$vfy1UI6xv7Nw9MQ==)
   at Ecng.Trading.Smart.SmartComWrapper.#=qUkHEOz9HdRARjxQqM_waXQ==(Action`1 #=q$iWVMFQ9Wr$U1L3LRTs2ug==)
   at Ecng.Trading.Smart.SmartComWrapper.Connect()
   at Ecng.Trading.Smart.SmartTrader.OnConnect()
   at Ecng.Trading.Algo.BaseTrader.Connect()
   at Ecng.Trading.Hydra.Core.MarketDataTrader.Start() in D:\SS\Sources\Hydra\Core\MarketDataTrader.cs:line 124
   at Ecng.Trading.Hydra.Smart.SmartDepthSource.Start(IEnumerable`1 securities) in D:\SS\Sources\Hydra\Plugins\Smart\SmartDepthSource.cs:line 155
   at Ecng.Trading.Hydra.Worker.<Start>b__5(IMarketDataSource source) in D:\SS\Sources\Hydra\Hydra\Worker.cs:line 58
   at Ecng.Collections.CollectionHelper.ForEach[T](IEnumerable`1 source, Action`1 action)
   at Ecng.Trading.Hydra.Worker.Start(IEnumerable`1 securities) in D:\SS\Sources\Hydra\Hydra\Worker.cs:line 58
   at Ecng.Trading.Hydra.MainWindow.StartStop_Click(Object sender, RoutedEventArgs e) in D:\SS\Sources\Hydra\Hydra\MainWindow.xaml.cs:line 148
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
Гидра 22:16:58.9488398 System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
   at StClientLib.StServerClass.connect(String ip, Int16 port, String login, String password)
   at Ecng.Trading.Smart.SmartComWrapper.#=qmUYt5ip9xuNsbQGGjewvRg==(StServer #=qVZ7ybW$vfy1UI6xv7Nw9MQ==)
   at Ecng.Trading.Smart.SmartComWrapper.#=qUkHEOz9HdRARjxQqM_waXQ==(Action`1 #=q$iWVMFQ9Wr$U1L3LRTs2ug==)
   at Ecng.Trading.Smart.SmartComWrapper.Connect()
   at Ecng.Trading.Smart.SmartTrader.OnConnect()
   at Ecng.Trading.Algo.BaseTrader.Connect()
   at Ecng.Trading.Hydra.Core.MarketDataTrader.Start() in D:\SS\Sources\Hydra\Core\MarketDataTrader.cs:line 124
   at Ecng.Trading.Hydra.Smart.SmartDepthSource.Start(IEnumerable`1 securities) in D:\SS\Sources\Hydra\Plugins\Smart\SmartDepthSource.cs:line 155
   at Ecng.Trading.Hydra.Worker.<Start>b__5(IMarketDataSource source) in D:\SS\Sources\Hydra\Hydra\Worker.cs:line 58
   at Ecng.Collections.CollectionHelper.ForEach[T](IEnumerable`1 source, Action`1 action)
   at Ecng.Trading.Hydra.Worker.Start(IEnumerable`1 securities) in D:\SS\Sources\Hydra\Hydra\Worker.cs:line 58
   at Ecng.Trading.Hydra.MainWindow.StartStop_Click(Object sender, RoutedEventArgs e) in D:\SS\Sources\Hydra\Hydra\MainWindow.xaml.cs:line 148
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
Гидра 22:19:45.9203904 System.NullReferenceException: Object reference not set to an instance of an object.
   at StClientLib.StServerClass.ListenBidAsks(String symbol)
   at Ecng.Trading.Smart.SmartComWrapper.#=qAYx9wRCrRwCsEvMIqJuSgRgxHhTzoVKynXCwY29J47g=.#=qQWM2BZ4kU_vIQoUdCvvwLYBvgw2GJTRY3CURu521YsA=(StServer #=qk3EKmsV5YhpTL_gnGQeRnQ==)
   at Ecng.Trading.Smart.SmartComWrapper.#=qUkHEOz9HdRARjxQqM_waXQ==(Action`1 #=q$iWVMFQ9Wr$U1L3LRTs2ug==)
   at Ecng.Trading.Smart.SmartComWrapper.RegisterQuotes(String securityId)
   at Ecng.Trading.Smart.SmartTrader.RegisterQuotes(Security security)
   at Ecng.Collections.CollectionHelper.ForEach[T](IEnumerable`1 source, Action`1 action)
   at Ecng.Trading.Hydra.Smart.SmartDepthSource.Start(IEnumerable`1 securities) in D:\SS\Sources\Hydra\Plugins\Smart\SmartDepthSource.cs:line 156
   at Ecng.Trading.Hydra.Worker.<Start>b__5(IMarketDataSource source) in D:\SS\Sources\Hydra\Hydra\Worker.cs:line 58
   at Ecng.Collections.CollectionHelper.ForEach[T](IEnumerable`1 source, Action`1 action)
   at Ecng.Trading.Hydra.Worker.Start(IEnumerable`1 securities) in D:\SS\Sources\Hydra\Hydra\Worker.cs:line 58
   at Ecng.Trading.Hydra.MainWindow.StartStop_Click(Object sender, RoutedEventArgs e) in D:\SS\Sources\Hydra\Hydra\MainWindow.xaml.cs:line 148
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
Гидра 22:36:18.0004428 System.NullReferenceException: Object reference not set to an instance of an object.
   at StClientLib.StServerClass.ListenBidAsks(String symbol)
   at Ecng.Trading.Smart.SmartComWrapper.#=qAYx9wRCrRwCsEvMIqJuSgRgxHhTzoVKynXCwY29J47g=.#=qQWM2BZ4kU_vIQoUdCvvwLYBvgw2GJTRY3CURu521YsA=(StServer #=qk3EKmsV5YhpTL_gnGQeRnQ==)
   at Ecng.Trading.Smart.SmartComWrapper.#=qUkHEOz9HdRARjxQqM_waXQ==(Action`1 #=q$iWVMFQ9Wr$U1L3LRTs2ug==)
   at Ecng.Trading.Smart.SmartComWrapper.RegisterQuotes(String securityId)
   at Ecng.Trading.Smart.SmartTrader.RegisterQuotes(Security security)
   at Ecng.Collections.CollectionHelper.ForEach[T](IEnumerable`1 source, Action`1 action)
   at Ecng.Trading.Hydra.Smart.SmartDepthSource.Start(IEnumerable`1 securities) in D:\SS\Sources\Hydra\Plugins\Smart\SmartDepthSource.cs:line 156
   at Ecng.Trading.Hydra.Worker.<Start>b__5(IMarketDataSource source) in D:\SS\Sources\Hydra\Hydra\Worker.cs:line 58
   at Ecng.Collections.CollectionHelper.ForEach[T](IEnumerable`1 source, Action`1 action)
   at Ecng.Trading.Hydra.Worker.Start(IEnumerable`1 securities) in D:\SS\Sources\Hydra\Hydra\Worker.cs:line 58
   at Ecng.Trading.Hydra.MainWindow.StartStop_Click(Object sender, RoutedEventArgs e) in D:\SS\Sources\Hydra\Hydra\MainWindow.xaml.cs:line 148
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)


Mikhail Sukhov
Mikhail Sukhov

pyhta4og: инструменты обновились нормально. выставил RIH1 чтобы сделки и стаканы грузились через Smart. Нажал Старт получил

А идентификатор точно Смартовский у инструмента?

pyhta4og
pyhta4og Автор

Идентфкатор был финамовский похоже. С пустой базой наполненной инструментами из смарта загрузка стакана пошла.

Вообще, как предполагается данные из разных источников совмещать?

В базе после обновления с РТС и со Смарта есть такие вот записи

Id, Name, Code, Class RTS-12.10_FT, RTS-12.10, RIZ0, RTS_FUT - фьючерс загружен из смарта

RTS-12.10, RIZ0, RTS-12.10, пусто - фьючерс загружен из РТС

из квика не пробовал. Там будет может третий идентификатор.

Однако на лицо то, что Name и Code в смарте и РТСе перепутаны. Я полагаю должно быть Code=RIZ0, Name=RTS-12.10

еще я могу ошибаться, но идентификатор Id у Security может совпадать для смартовских даннх и РТСовских (финамовских). ТОгда загруженные через эти разные источники данные могут перепутаться (они же запишутся в одну и ту же директорию) Я думаю это неправильно (перепутывание данных)

В идеале (для меня) в таблице Security не должно быть повторов одного инструмента под разными псевдонимами (в данном случае RTS-12.10_FT и RTS-12.10). Это бы упрощало в стратегии жизнь. А вот данных для одного инструмента может быть несколько вариантов - с финама, со смарта, еще откуда-то. Т.е. каждый источник - свои данные. И хранятся они в разных папках, например FINAM/RTS-12.10/дата и SMART/RTS-12.10/дата.

Сразу вознкает вопрос, а какие данные использовать при прогоне стратегии? Оптимальным мне кажется сделать специальный алгоритм DataSelectionAlgorithm который будет выбирать для конкретной Security и конкретного дня, какие данные использовать.

Например алгоритм мог бы действовать так:

КакиеДанныеПоТиковымСделкамИспользовать(RIZ0, 1 апреля 2010г) if(есть_накопленные_данные_Смарта(RIZ0, 1 апреля 2010г) return использовать данные смарта if(есть_данные_РТС(RIZ0, 1 апреля 2010г)) return использовать данные РТС.

КакиеДанныеПоСтакануИспользовать(RIZ0, 1 апреля 2010г) if(есть_накопленные_данные_Смарта(riz0, 1 апреля 2010г) return использовать_стакан_смарта if(нет никаких данных) return использовать_генератор_стакана.

Тут есть еще одна идея - в данных может быть мусор. Можно озаботиться алгоритмом проверки-фильтрации данных. Это будет как бы еще один MarketDataSource.

Что скажете?

Mikhail Sukhov
Mikhail Sukhov

pyhta4og: Однако на лицо то, что Name и Code в смарте и РТСе перепутаны. Я полагаю должно быть Code=RIZ0, Name=RTS-12.10

Да, поменял местами в коде. В БД надо так же будет заменить после обновления.

pyhta4og: еще я могу ошибаться, но идентификатор Id у Security может совпадать для смартовских даннх и РТСовских (финамовских). ТОгда загруженные через эти разные источники данные могут перепутаться (они же запишутся в одну и ту же директорию) Я думаю это неправильно (перепутывание данных)

Это как раз правильно, когда инструменты едины для разных источников. Не логично, когда одни и те же маркет данные грузятся по разным источникам.

pyhta4og: В идеале (для меня) в таблице Security не должно быть повторов одного инструмента под разными псевдонимами (в данном случае RTS-12.10_FT и RTS-12.10). Это бы упрощало в стратегии жизнь.

Согласен. Варианты решения?

pyhta4og: А вот данных для одного инструмента может быть несколько вариантов - с финама, со смарта, еще откуда-то. Т.е. каждый источник - свои данные. И хранятся они в разных папках, например FINAM/RTS-12.10/дата и SMART/RTS-12.10/дата.

А вот тут не согласен. Я понимаю, когда стаканы и тики грузятся для одного инструмента по разным источникам. Тогда они просто в одну и ту же папку попадают. Но зачем делать еще группировку по источникам?

pyhta4og: Сразу вознкает вопрос, а какие данные использовать при прогоне стратегии?

Вот поэтому, понятие источника не должно вылезать дальше Гидры. ITradingStorage глубоко наплевать откуда данные накачали. Все что она должна делать, отдавать данные когда у нее просят. Хотят тики за период такой-то - получите. Стаканы - да бога ради.

Mikhail Sukhov
Mikhail Sukhov

Mikhail Sukhov:

pyhta4og: Однако на лицо то, что Name и Code в смарте и РТСе перепутаны. Я полагаю должно быть Code=RIZ0, Name=RTS-12.10

Да, поменял местами в коде. В БД надо так же будет заменить после обновления.

У Смарта код и имя расположена правильно.

pyhta4og
pyhta4og Автор

pyhta4og: еще я могу ошибаться, но идентификатор Id у Security может совпадать для смартовских даннх и РТСовских (финамовских). ТОгда загруженные через эти разные источники данные могут перепутаться (они же запишутся в одну и ту же директорию) Я думаю это неправильно (перепутывание данных)

Это как раз правильно, когда инструменты едины для разных источников. Не логично, когда одни и те же маркет данные грузятся по разным источникам. (1) У нас для LKOH например есть два разных источника данных - финам, смарт в реальном времени. У каждого источника может быть сбой. Допустим разрыв соединения в смарте. Или у финама дыра в час в данных. Если данные будут сохранятся из всех источников а потом можно будет выбирать какой использовать за конкретный день это более гибко.

Допустим ситуация. С 1 апреля по 1 мая я скачивал LKOH финамом. С 1 мая поставил его на скачивание смартом. 1 июня я пропустил день скачивания данных смартом. хочу финамом подгрузить данные. Поставлю инструменту источник финам. Гидра посмотрит что по LKOH финамом скачивали последний раз 30 апреля. И скачает месяц данных с 1 мая по 1 июня перезаписав все смартовские данные. А я хотел всего то 1 день скачать.

pyhta4og: В идеале (для меня) в таблице Security не должно быть повторов одного инструмента под разными псевдонимами (в данном случае RTS-12.10_FT и RTS-12.10). Это бы упрощало в стратегии жизнь.

Согласен. Варианты решения? Нужно выбрать стандартное именование инструментов. Для фьючерсов допустим принять что это ID=RTS-12.10 CODE=RIZ0, Class=SPBFUT. И сделать в смарт-адаптере трансляцию в стандартное наименование, т.е. RTS-12.10_FT -> RTS-12.10, RTS_FUT->SPBFUT . Судя по ветке http://stocksharp.com/forum/1096/ такая трансляция еще РТС стандарт должна учитывать...

pyhta4og: А вот данных для одного инструмента может быть несколько вариантов - с финама, со смарта, еще откуда-то. Т.е. каждый источник - свои данные. И хранятся они в разных папках, например FINAM/RTS-12.10/дата и SMART/RTS-12.10/дата. А вот тут не согласен. Я понимаю, когда стаканы и тики грузятся для одного инструмента по разным источникам. Тогда они просто в одну и ту же папку попадают. Но зачем делать еще группировку по источникам? См комментарий (1). Для надежности. И чтобы иметь возможность сравнить качество данных. Качеству данных при тестировании придают большую роль. вот обзор http://www.tickdata.com/pdf/Tick_Data_Filtering_White_Paper.pdf.

pyhta4og: Сразу вознкает вопрос, а какие данные использовать при прогоне стратегии?

Вот поэтому, понятие источника не должно вылезать дальше Гидры. ITradingStorage глубоко наплевать откуда данные накачали. Все что она должна делать, отдавать данные когда у нее просят. Хотят тики за период такой-то - получите. Стаканы - да бога ради.

Я приводил пример алгоритма выбора данных который могла бы использовать ITradingStorage для выбора данных из нескольких источников.

Mikhail Sukhov
Mikhail Sukhov

pyhta4og: Допустим ситуация. С 1 апреля по 1 мая я скачивал LKOH финамом. С 1 мая поставил его на скачивание смартом. 1 июня я пропустил день скачивания данных смартом. хочу финамом подгрузить данные. Поставлю инструменту источник финам. Гидра посмотрит что по LKOH финамом скачивали последний раз 30 апреля. И скачает месяц данных с 1 мая по 1 июня перезаписав все смартовские данные. А я хотел всего то 1 день скачать.

Напишите доп настройки для ограничения по датам. Гидра не умеет скачивать за конкретные период и только.

pyhta4og: Нужно выбрать стандартное именование инструментов. Для фьючерсов допустим принять что это ID=RTS-12.10 CODE=RIZ0, Class=SPBFUT. И сделать в смарт-адаптере трансляцию в стандартное наименование, т.е. RTS-12.10_FT -> RTS-12.10, RTS_FUT->SPBFUT .

Да, наверное так и сделаю. Надо у Смарта в Security.Extension положить его идентификатор.

pyhta4og: Судя по ветке http://stocksharp.com/forum/1096/ такая трансляция еще РТС стандарт должна учитывать...

Там же про код клиента речь идет.

pyhta4og: См комментарий (1). Для надежности. И чтобы иметь возможность сравнить качество данных. Качеству данных при тестировании придают большую роль. вот обзор http://www.tickdata.com/pdf/Tick_Data_Filtering_White_Paper.pdf.

Качество данных нужно анализировать до скачивания. Для этого можно гидрой накачать в разные директории тики и потом сравнить, какой в итоге источник лучше. Или нет?

Mikhail Sukhov
Mikhail Sukhov

Закончил с идентификаторами, чтобы схема была единой. Малой кровью обойти не удалось - для Гидры нужно будет менять все идентификаторы. А следовательно, и сами папки. Теперь схема такая. Security.Id == Code@RTS для РТС биржи, и Code@Class для всего остального. Соответственно, и папки теперь будут называться к примеру не RTS-3.11 а RIH1@RTS, не LKOH, а LKOH@EQBR. И так для всего - QuikTrader, SmartTrader, Hydra... Выложу в понедельник, надо проверить на реале. По Гидре наверное будет проще все грохнуть (БД + файлы). Скаченные данные только не нужно удалять. По идее, Гидра за день пару лет по всей бирже успевает обрабатывать.