пятница, 25 декабря 2015 г.
четверг, 24 декабря 2015 г.
GS.Web.Mvc.Evl01
D:\VC\1303\GS.EventLog\GS.EventLog2\GS.EventLog2.sln
D:\VC\1303\GS.EventLog\GS.EventLog2\GS.Web.Mvc.Evl01\ - project
1. Paging
Install-Package PagedList.Mvc
2. Stats use StatsAsync method in EventLogsAsyncController
public IQueryable<EventLogView> GetEventLogItemsGroupedQ() - groupe Statistics
D:\VC\1303\GS.EventLog\GS.EventLog2\GS.Web.Mvc.Evl01\ - project
1. Paging
Install-Package PagedList.Mvc
2. Stats use StatsAsync method in EventLogsAsyncController
public IQueryable<EventLogView> GetEventLogItemsGroupedQ() - groupe Statistics
среда, 23 декабря 2015 г.
GS.EventLog2
Solution:
D:\VC\1303\GS.EventLog\GS.EventLog2\GS.EventLog2.sln
DbEventLog2:
without Init in Client by Sending EventLog
withoot EventLogID
<Code>WebEventLog</Code>
<Name>Web EventLog</Name>
<EventLogKey>GS.Trade.EventLog</EventLogKey>
<BaseAddress>http://localhost:8082/</BaseAddress>
<RequestHeader>application/xml</RequestHeader>
<ApiEventLogs>api/eventlogs/</ApiEventLogs>
<!--<ApiEventLogItems>api/eventlogitems/</ApiEventLogItems>-->
<ApiEventLogItems>api/eventlogitemsasync/</ApiEventLogItems>
<ErrorPostTimeOut>15</ErrorPostTimeOut>
<IsEnabled>true</IsEnabled>
<IsAsync>false</IsAsync>
<IsPrimary>false</IsPrimary>
<IsSaveEnabled>true</IsSaveEnabled>
<IsUIEnabled>false</IsUIEnabled>
</WebEventLog2>
<DbEventLog1 enabled = "true">
<Code>GS.Web.Api.EventLog.Server</Code>
<Name>GS.Web.Api.EventLog.Server</Name>
<EventLogKey>GS.Web.Api.EventLog.Server</EventLogKey>
<Description>GS.Trade.EventLog in DataBase.EventLog</Description>
<DataBaseName>EventLog1</DataBaseName>
<TimeOut>300</TimeOut>
<IsEnabled>true</IsEnabled>
<IsQueueEnabled>false</IsQueueEnabled>
<IsPrimary>false</IsPrimary>
<IsAsync>false</IsAsync>
<IsSaveEnabled>true</IsSaveEnabled>
<IsUIEnabled>false</IsUIEnabled>
</DbEventLog1>
<DbEventLog2 enabled = "false">
<Code>GS.Web.Api.EventLog.Server</Code>
<Name>GS.Web.Api.EventLog.Server</Name>
<EventLogKey>GS.Web.Api.EventLog.Server</EventLogKey>
<Description>GS.Trade.EventLog in DataBase.EventLog</Description>
<DataBaseName>EventLog1</DataBaseName>
<TimeOut>300</TimeOut>
<IsEnabled>true</IsEnabled>
<IsQueueEnabled>true</IsQueueEnabled>
<IsPrimary>false</IsPrimary>
<IsAsync>false</IsAsync>
<IsSaveEnabled>true</IsSaveEnabled>
<IsUIEnabled>false</IsUIEnabled> <ErrorRecoveryTimeOut>60</ErrorRecoveryTimeOut>
<ErrorCntToStop>15</ErrorCntToStop>
</DbEventLog2>
<ServerDef>
<Code>EventLog.WebServer</Code>
<Name>EventLog.WebServer</Name>
<Url>http://localhost:8082</Url>
</ServerDef>
Old VErsion of DataBase EventLog with EventLogID Init() :
<DbEventLog enabled = "false">
<Name>DataBase.EventLog</Name>
<DataBaseName>EventLog</DataBaseName>
<!--
<EventLogKey>GS.Trade.EventLog</EventLogKey>
<Code>GS.Trade.EventLog</Code>
-->
<!--<EventLogKey>QuikFinamReal</EventLogKey>
<Code>QuikFinamReal</Code>-->
<EventLogKey>RenFortsOpenSim</EventLogKey>
<Code>RenFortsOpenSim</Code>
<!--
<EventLogKey>Quik.Open.Sim</EventLogKey>
<Code>Quik.Vtb.Sim</Code>
-->
<!--
<EventLogKey>Quik.Fin.BkStandard</EventLogKey>
<Code>Quik.Fin.BkStandard</Code>
-->
<TimeOut>300</TimeOut>
<IsEnabled>true</IsEnabled>
<IsPrimary>false</IsPrimary>
<IsAsync>false</IsAsync>
<IsSaveEnabled>true</IsSaveEnabled>
<IsUIEnabled>false</IsUIEnabled>
</DbEventLog>
D:\VC\1303\GS.EventLog\GS.EventLog2\GS.EventLog2.sln
DbEventLog2:
without Init in Client by Sending EventLog
withoot EventLogID
private void NewEventLogItemToAdd(object sender, EventLogItemDto dto)
{
Console.WriteLine("Item to Add: " + dto.ToString());
//AddItem(dto);
if(IsEnabled)
AddItem1(dto); // Write EventLogDto with EventLog.HasValue
}
WebEventLog:
<WebEventLog2 enabled = "true"><Code>WebEventLog</Code>
<Name>Web EventLog</Name>
<EventLogKey>GS.Trade.EventLog</EventLogKey>
<BaseAddress>http://localhost:8082/</BaseAddress>
<RequestHeader>application/xml</RequestHeader>
<ApiEventLogs>api/eventlogs/</ApiEventLogs>
<!--<ApiEventLogItems>api/eventlogitems/</ApiEventLogItems>-->
<ApiEventLogItems>api/eventlogitemsasync/</ApiEventLogItems>
<ErrorPostTimeOut>15</ErrorPostTimeOut>
<IsEnabled>true</IsEnabled>
<IsAsync>false</IsAsync>
<IsPrimary>false</IsPrimary>
<IsSaveEnabled>true</IsSaveEnabled>
<IsUIEnabled>false</IsUIEnabled>
</WebEventLog2>
<DbEventLog1 enabled = "true">
<Code>GS.Web.Api.EventLog.Server</Code>
<Name>GS.Web.Api.EventLog.Server</Name>
<EventLogKey>GS.Web.Api.EventLog.Server</EventLogKey>
<Description>GS.Trade.EventLog in DataBase.EventLog</Description>
<DataBaseName>EventLog1</DataBaseName>
<TimeOut>300</TimeOut>
<IsEnabled>true</IsEnabled>
<IsQueueEnabled>false</IsQueueEnabled>
<IsPrimary>false</IsPrimary>
<IsAsync>false</IsAsync>
<IsSaveEnabled>true</IsSaveEnabled>
<IsUIEnabled>false</IsUIEnabled>
</DbEventLog1>
<DbEventLog2 enabled = "false">
<Code>GS.Web.Api.EventLog.Server</Code>
<Name>GS.Web.Api.EventLog.Server</Name>
<EventLogKey>GS.Web.Api.EventLog.Server</EventLogKey>
<Description>GS.Trade.EventLog in DataBase.EventLog</Description>
<DataBaseName>EventLog1</DataBaseName>
<TimeOut>300</TimeOut>
<IsEnabled>true</IsEnabled>
<IsQueueEnabled>true</IsQueueEnabled>
<IsPrimary>false</IsPrimary>
<IsAsync>false</IsAsync>
<IsSaveEnabled>true</IsSaveEnabled>
<IsUIEnabled>false</IsUIEnabled> <ErrorRecoveryTimeOut>60</ErrorRecoveryTimeOut>
<ErrorCntToStop>15</ErrorCntToStop>
</DbEventLog2>
<ServerDef>
<Code>EventLog.WebServer</Code>
<Name>EventLog.WebServer</Name>
<Url>http://localhost:8082</Url>
</ServerDef>
Old VErsion of DataBase EventLog with EventLogID Init() :
<DbEventLog enabled = "false">
<Name>DataBase.EventLog</Name>
<DataBaseName>EventLog</DataBaseName>
<!--
<EventLogKey>GS.Trade.EventLog</EventLogKey>
<Code>GS.Trade.EventLog</Code>
-->
<!--<EventLogKey>QuikFinamReal</EventLogKey>
<Code>QuikFinamReal</Code>-->
<EventLogKey>RenFortsOpenSim</EventLogKey>
<Code>RenFortsOpenSim</Code>
<!--
<EventLogKey>Quik.Open.Sim</EventLogKey>
<Code>Quik.Vtb.Sim</Code>
-->
<!--
<EventLogKey>Quik.Fin.BkStandard</EventLogKey>
<Code>Quik.Fin.BkStandard</Code>
-->
<TimeOut>300</TimeOut>
<IsEnabled>true</IsEnabled>
<IsPrimary>false</IsPrimary>
<IsAsync>false</IsAsync>
<IsSaveEnabled>true</IsSaveEnabled>
<IsUIEnabled>false</IsUIEnabled>
</DbEventLog>
среда, 16 декабря 2015 г.
Element33
Element3 = Element1 + Queue + Work
public abstract class Element33<TKey, TInput, TEventArgs> : Element1<TKey>
where TEventArgs : IEventArgs
public abstract class Element33<TKey, TInput, TEventArgs> : Element1<TKey>
where TEventArgs : IEventArgs
вторник, 15 декабря 2015 г.
Projects EventLog
First Porject with EvlContext1 after impotratnt changes
Arch: 151217_01.Zip - Last Projects with EventLog = EvlContext1
Warning:
Solution: D:\VC\1303\GS.EventLog\GS.EventLog2\GS.EventLog2.sln
Project: D:\VC\1303\GS.EventLog\GS.EventLog2\GS.EventLog\
Arch: 151216_01.Zip - Last Projects with EventLog = EvlContext.
New EventLog = EvlContext1 with WebApi Async Add.
Target: Work only with WebApi handling and Remove all References to EventLogDB from others Projects
Arch: 151217_01.Zip - Last Projects with EventLog = EvlContext1
Warning:
Solution: D:\VC\1303\GS.EventLog\GS.EventLog2\GS.EventLog2.sln
Project: D:\VC\1303\GS.EventLog\GS.EventLog2\GS.EventLog\
Arch: 151216_01.Zip - Last Projects with EventLog = EvlContext.
New EventLog = EvlContext1 with WebApi Async Add.
Target: Work only with WebApi handling and Remove all References to EventLogDB from others Projects
среда, 9 декабря 2015 г.
Element3 Queue + Work
Element3 with Queue + Work
Need to override:
public abstract void DeQueueProcess();
Tickers3:
public override void DeQueueProcess()
{
if (Queue.IsEmpty)
return;
var items = Queue.GetItems();
foreach (var i in items.Where(i=>i.Key == "QUOTES.QUOTE"))
{
PutDdeQuote3(i.Object.ToString());
}
}
EventHub3:
public override void DeQueueProcess()
{
if (Queue.IsEmpty)
return;
var items = Queue.GetItems();
foreach (var i in items)
{
// Exception Handling inside FireEvent()
FireEventOperation(i.Sender, i);
}
}
Need to override:
public abstract void DeQueueProcess();
Tickers3:
public override void DeQueueProcess()
{
if (Queue.IsEmpty)
return;
var items = Queue.GetItems();
foreach (var i in items.Where(i=>i.Key == "QUOTES.QUOTE"))
{
PutDdeQuote3(i.Object.ToString());
}
}
EventHub3:
public override void DeQueueProcess()
{
if (Queue.IsEmpty)
return;
var items = Queue.GetItems();
foreach (var i in items)
{
// Exception Handling inside FireEvent()
FireEventOperation(i.Sender, i);
}
}
воскресенье, 6 декабря 2015 г.
суббота, 5 декабря 2015 г.
WebApiSelfHostServers & Client + SignalRChat Clients & Servers Examples
Web Api:
D:\VC\Web\WebApi\GS.WebApi.Samples\GS.WebApi.Samples.sln - WebApi Solution
Examples: SignalR: D:\VC\Web\SignalRChat\SignalRChat.sln - SignalR Main Examples Solution (WPFServer, WpfClient, FormsServer, FormsClient, WebClient + my CAppServer, CAppClient - work properly
Work: D:\VC\Web\GS.SignalR\GS.SignalR.sln - Client & Server - work project work properly
D:\VC\Web\WebApi\GS.WebApi.Samples\GS.WebApi.Samples.sln - WebApi Solution
Examples: SignalR: D:\VC\Web\SignalRChat\SignalRChat.sln - SignalR Main Examples Solution (WPFServer, WpfClient, FormsServer, FormsClient, WebClient + my CAppServer, CAppClient - work properly
Work: D:\VC\Web\GS.SignalR\GS.SignalR.sln - Client & Server - work project work properly
понедельник, 30 ноября 2015 г.
Builder.Build3
Работает с аттрибутами:
as="AssemblyShortName" anf="AssemblyFullName"
if( as == AssemblyFullName )
t = Type.GetType(typeName, false, true) work SUCCES for simple and dynamic Assemblies
if(as="AssemblyShortName")
t = Type.GetType(typeName, false, true)
does not work with Dynamic Assemlies
for dynamic and simple Assemblies work as="AssemblyFullName"
Dynamic Assemblies work only with AssemblyFullName
and only with
t = Type.GetType(typeFullName, name =>
AppDomain.CurrentDomain.GetAssemblies()
.FirstOrDefault(z => z.FullName == name.FullName),
as="AssemblyShortName" anf="AssemblyFullName"
if( as == AssemblyFullName )
t = Type.GetType(typeName, false, true) work SUCCES for simple and dynamic Assemblies
if(as="AssemblyShortName")
t = Type.GetType(typeName, false, true)
does not work with Dynamic Assemlies
for dynamic and simple Assemblies work as="AssemblyFullName"
Dynamic Assemblies work only with AssemblyFullName
and only with
t = Type.GetType(typeFullName, name =>
AppDomain.CurrentDomain.GetAssemblies()
.FirstOrDefault(z => z.FullName == name.FullName),
воскресенье, 29 ноября 2015 г.
GS.Configurations new project
1303_151129_01: Configurations in GS
1303_151129_02 + New Versions Configurations in new project GS.Configurations
This version to be continue
1303_151129_02 + New Versions Configurations in new project GS.Configurations
This version to be continue
суббота, 28 ноября 2015 г.
NEw async Controller BarsAsync
Solution: GS.Trade.Series2
Ticker, TimeInt:
Project: GS.Trade.Web.Api.TimeSeries01
New Web Api Async BarsAsyncController: With Parse to string to reduce transfer chars numbers
http://185.31.162.98/GS.Trade.Web.Api.TimeSeries01/api/barsasync?seriesId=20&date=20151001
MVC Application:
Ticker, TimeInt:
Only 3 Days for Test Only
http://185.31.162.98/GS.Trade.Web.Api.TimeSeries01/api/bars?ticker=SiZ5&timeint=5&dt1=20151001&dt2=20151013
SeriesId:http://185.31.162.98/GS.Trade.Web.Api.TimeSeries01/api/bars?seriesId=20&date=20151001
http://185.31.162.98/GS.Trade.Web.Api.TimeSeries01/api/bars?seriesId=20&dt1=20151001&dt2=20151013
TimeSeriesStat:
http://185.31.162.98/GS.Trade.Web.Api.TimeSeries01/api/timeSeriesStat?ticker=SiZ5&timeint=5
среда, 25 ноября 2015 г.
GS.Trade Build3, Configurations
Bulder.Buld3 используется для типов Tickers, Strategies. Portfolios
для входа используется assembly.FullName и тип загружается либо из статической сборки либо из динамической. Только благодаря FulName.
для входа используется assembly.FullName и тип загружается либо из статической сборки либо из динамической. Только благодаря FulName.
суббота, 21 ноября 2015 г.
SQL Перенос Configurations Sample
DELETE From AppDbConfig2.[dbo].[Configurations]
GO
Set IDENTITY_INSert AppDbConfig2.[dbo].[Configurations] ON
GO
Insert into AppDbConfig2.[dbo].[Configurations]
(Id,[Enabled],[Catalog],Code, Token, CreatedDT, ModifiedDT)
Select Id,[Enabled],[Catalog],Code, 0 , GetDate(), GEtDate()
from AppDbConfig.[dbo].[Configurations]
go
Set IDENTITY_INSert AppDbConfig2.[dbo].[Configurations] OFF
GO
DELETE From AppDbConfig2.[dbo].[Items]
GO
Set IDENTITY_INSert AppDbConfig2.[dbo].[Items] ON
GO
Insert into AppDbConfig2.[dbo].[Items]
(Id,ConfigurationId, [Enabled],[Catalog], Obj, TrCount, Code, CreatedDT, ModifiedDT )
Select Id,ConfigurationId, [Enabled],[Catalog], Obj, TrCount, Code, GetDate(), GEtDate()
from AppDbConfig.[dbo].[Items]
go
Set IDENTITY_INSert AppDbConfig2.[dbo].[Items] OFF
GO
GO
Set IDENTITY_INSert AppDbConfig2.[dbo].[Configurations] ON
GO
Insert into AppDbConfig2.[dbo].[Configurations]
(Id,[Enabled],[Catalog],Code, Token, CreatedDT, ModifiedDT)
Select Id,[Enabled],[Catalog],Code, 0 , GetDate(), GEtDate()
from AppDbConfig.[dbo].[Configurations]
go
Set IDENTITY_INSert AppDbConfig2.[dbo].[Configurations] OFF
GO
DELETE From AppDbConfig2.[dbo].[Items]
GO
Set IDENTITY_INSert AppDbConfig2.[dbo].[Items] ON
GO
Insert into AppDbConfig2.[dbo].[Items]
(Id,ConfigurationId, [Enabled],[Catalog], Obj, TrCount, Code, CreatedDT, ModifiedDT )
Select Id,ConfigurationId, [Enabled],[Catalog], Obj, TrCount, Code, GetDate(), GEtDate()
from AppDbConfig.[dbo].[Items]
go
Set IDENTITY_INSert AppDbConfig2.[dbo].[Items] OFF
GO
понедельник, 16 ноября 2015 г.
SingleTone Lazy Instance Sample using in GS.Trade
private static readonly Lazy<ConfigurationResourse> Lazy =
new Lazy<ConfigurationResourse>(() => CreateInstance());
public static ConfigurationResourse Instance { get { return Lazy.Value; } }
private static ConfigurationResourse CreateInstance()
{
var instance = Builder.Build2<ConfigurationResourse>(@"Init\ConfigurationResourse.xml",
"ConfigurationResourse");
if(instance==null)
throw new NullReferenceException("Build ConfigurationResource Failure");
instance.Init();
return instance;
}
new Lazy<ConfigurationResourse>(() => CreateInstance());
public static ConfigurationResourse Instance { get { return Lazy.Value; } }
private static ConfigurationResourse CreateInstance()
{
var instance = Builder.Build2<ConfigurationResourse>(@"Init\ConfigurationResourse.xml",
"ConfigurationResourse");
if(instance==null)
throw new NullReferenceException("Build ConfigurationResource Failure");
instance.Init();
return instance;
}
воскресенье, 15 ноября 2015 г.
Tfs Git Chages Conflicts
1. 151115 очередной сбой в TFS Team Project VC\1302 (это название в TFS). Не первый раз.
2. Сделал zip копию локального каталога D:\VC\1303, затем удалил все файлы
3. Сделал Clone c TFS FROM
http://localhost:8080/tfs/DefaultCollection/_git/VC1302 в тот же каталог D:\VC\1303
Каталог остался прежним D:\VC\1303
Откомпилировал, пока все работает.
2. Сделал zip копию локального каталога D:\VC\1303, затем удалил все файлы
3. Сделал Clone c TFS FROM
http://localhost:8080/tfs/DefaultCollection/_git/VC1302 в тот же каталог D:\VC\1303
Каталог остался прежним D:\VC\1303
Откомпилировал, пока все работает.
GS.Trade Load Assemblies
1. В результате усилий удалось отцепить только GS.Trade.Strategies.
Убрал из GS.Trade.Strategies зависимость от GS.Time.
Стала работать сериализация.
Но поскольку есть ссылка в References на GS.Trade.Data, то при обращении к Strategy.Init - система падает, так как в Init есть обращение к типам из GS.Trade.Data. И система пытается в соответствие с References загрузить GS.Trade.Data, которой нет в bin\Debug.
Поэтому GS.Trade.Data явно указывается в Referencуs (пункт 2)
2. GS.Trade.Data указывается в References в MainWindow
Убрал из GS.Trade.Strategies зависимость от GS.Time.
Стала работать сериализация.
Но поскольку есть ссылка в References на GS.Trade.Data, то при обращении к Strategy.Init - система падает, так как в Init есть обращение к типам из GS.Trade.Data. И система пытается в соответствие с References загрузить GS.Trade.Data, которой нет в bin\Debug.
Поэтому GS.Trade.Data явно указывается в Referencуs (пункт 2)
2. GS.Trade.Data указывается в References в MainWindow
четверг, 12 ноября 2015 г.
BadImageFormatException, x86 i x64
http://www.codeproject.com/Articles/383138/BadImageFormatException-x-i-x
GS.Trade Main App need to set x86 target platform ( NOT ANY CPU)
because Trans2Quik.dll is 32 bit .dll
CorFlags.exe - good tool.
среда, 11 ноября 2015 г.
GS.Trade 151111
Избавляемся от GS.Strategies и GS.Data
1. 151111_01
Загрузка только GS.Strategies
GS.Data объявлена в References TradeContext
Мешается GS.Data в GS.Windows - задействованы в Charts, OrderPlane
2. 15.11.11_02
Загрузка только GS.Strategies
GS.Data объявлена в TradeContext
Мешается GS.Data в GS.Windows - задействованы только в OrderPlane, из Charts - убрал зависимость от GS.Trade.Data
3. 15.11.11_03
Загрузка только GS.Strategies
Исправил WIndows Charts, OrderPlane - удалил, чтобы уьрать зависимость от GS.Data
В результате GS.Data и WebClients не появляются в bin\Debug
Пришлось включить их (WebClient GS.Data) в GS.Trade.MainWindow - надо подумать, что лучше, может быть вернуть их в Windows
или вручную переписывать в bin\Debug
Так как Strategies имеет зависимость от GS,Trade.Data при ее динамической загрузке Strategies грузятся динамически, а Strategy - ошибку Десереализации
Необходимо тщательно проверять состав Сборок в \bin\Debig
151111_01 _02 _03 сделаны существенные изменения. Главное - убрал зависимости от GS.Trade.Data и GS.Strategies убрал локально. Необходимо понаблюдать как будет работать.
Good Bye
1. 151111_01
Загрузка только GS.Strategies
GS.Data объявлена в References TradeContext
Мешается GS.Data в GS.Windows - задействованы в Charts, OrderPlane
2. 15.11.11_02
Загрузка только GS.Strategies
GS.Data объявлена в TradeContext
Мешается GS.Data в GS.Windows - задействованы только в OrderPlane, из Charts - убрал зависимость от GS.Trade.Data
3. 15.11.11_03
Загрузка только GS.Strategies
Исправил WIndows Charts, OrderPlane - удалил, чтобы уьрать зависимость от GS.Data
В результате GS.Data и WebClients не появляются в bin\Debug
Пришлось включить их (WebClient GS.Data) в GS.Trade.MainWindow - надо подумать, что лучше, может быть вернуть их в Windows
или вручную переписывать в bin\Debug
Так как Strategies имеет зависимость от GS,Trade.Data при ее динамической загрузке Strategies грузятся динамически, а Strategy - ошибку Десереализации
Необходимо тщательно проверять состав Сборок в \bin\Debig
151111_01 _02 _03 сделаны существенные изменения. Главное - убрал зависимости от GS.Trade.Data и GS.Strategies убрал локально. Необходимо понаблюдать как будет работать.
Good Bye
При загрузке дин.сборки используется BULID3 - использует хитрый Type,GetType c Assembly.Resolver http://gs-sft.blogspot.ru/2015/11/assemblyload.html
понедельник, 9 ноября 2015 г.
Sql,TimeSeries01
Частично восстановлен после потери в результате сбоя
USE TimeSeries01
Declare @dt1 as DateTime, @dt2 as DateTime
SET @dt1 = GETDATE()
Select @dt1 as 'Start DateTIme'
delete from Bars
where id In
(
Select b.Id
FROM dbo.Bars b
INNER JOIN TimeSeries ts on b.BarSeriesId = ts.Id
INNER JOIN Tickers t on ts.TickerId = t.Id
inner join TradeBoards tb on t.TradeBoardId = tb.Id
Where (tb.Id = 2 Or tb.Id = 3) AND
(cast(Dt as Time) < '10:00:00' OR cast(DT as Time) > '23:50:00')
)
SET @dt2 = GETDATE()
Select @dt2 as 'Finish DateTIme'
Select cast((@dt2 - @dt1) as Time) as 'ElapsedTime'
go
USE TimeSeries01
Declare @dt1 as DateTime, @dt2 as DateTime
SET @dt1 = GETDATE()
Select @dt1 as 'Start DateTIme'
delete from Bars
where id In
(
Select b.Id
FROM dbo.Bars b
INNER JOIN TimeSeries ts on b.BarSeriesId = ts.Id
INNER JOIN Tickers t on ts.TickerId = t.Id
inner join TradeBoards tb on t.TradeBoardId = tb.Id
Where (tb.Id = 2 Or tb.Id = 3) AND
(cast(Dt as Time) < '10:00:00' OR cast(DT as Time) > '23:50:00')
)
SET @dt2 = GETDATE()
Select @dt2 as 'Finish DateTIme'
Select cast((@dt2 - @dt1) as Time) as 'ElapsedTime'
go
SQL in DbTrade2
После потери нескольких важных запросов в результате сбоя, буду хранить и постепенно восстанавливать запросы здесь.
Clear Orders & Trades & EventLogItem (восстановлен частично)
use DbTrade2
-- ORDERS
Select 'Orders To Delete' as Operation, Count(*) as Cnt,
Min(Cast( Modified as Date)) as Dt1, Max(Cast( Modified as Date)) as Dt2
From Orders
Go
DELETE from Orders
where Cast( Created as Date) NOT IN
(
select top 2 Cast( o.Created as Date) dt
from Orders o
Group by Cast( o.Created as Date)
Order by Cast( o.Created as Date) DESC
)
GO
select Cast( o.Created as Date) DT, Count(*) OrdersCount
from Orders o
Group by Cast( o.Created as Date)
Order by Cast( o.Created as Date) DESC
GO
Select 'Orders After Delete' as Operation, Count(*) as Cnt,
Min(Cast( Modified as Date)) as Dt1, Max(Cast( Modified as Date)) as Dt2
From Orders
Go
-- TRADES
Select 'Trades To Delete' as Operation, Count(*) as Cnt,
Min(Cast( DT as Date)) as Dt1, Max(Cast( DT as Date)) as Dt2
From Trades
Go
DELETE from Trades
where Cast( DT as Date) NOT IN
(
select top 2 Cast( DT as Date) DT
from Trades o
Group by Cast( DT as Date)
Order by Cast( DT as Date) DESC
)
GO
select Cast( DT as Date) dt, Count(*) TradesCount
from Trades o
Group by Cast( DT as Date)
Order by Cast( DT as Date) DESC
GO
Select 'Trades After Delete' as Operation, Count(*) as Cnt,
Min(Cast( DT as Date)) as Dt1, Max(Cast( DT as Date)) as Dt2
From Trades
Go
-- DEALS
--Select 'Deals Count' as Operation
Select 'Deals Count' as Operation, Count(*) as Cnt,
Min(Cast( DT as Date)) as Dt1, Max(Cast( DT as Date)) as Dt2
from Deals
go
--select Cast( DT as Date) dt, Count(*) DealsCount
--FROM Deals
--Group by Cast( DT as Date)
--Order by Cast( DT as Date) DESC
--Select 'Deals Delete' as Operation
--DELETE from Deals
--where Cast( DT as Date) NOT IN
--(
--select top 3 Cast( DT as Date) dt
--from Deals o
--Group by Cast( DT as Date)
--Order by Cast( DT as Date) DESC
--)
--GO
--select Cast( DT as Date) dt, Count(*) DealsCount
--from Deals o
--Group by Cast( DT as Date)
--Order by Cast( DT as Date) DESC
--GO
-- EventLogs --
Use EventLog
Select 'EventLog To Delete' as Operation, Count(*) as Cnt,
Min(Cast( DT as Date)) as Dt1, Max(Cast( DT as Date)) as Dt2
From EventLogItems
Go
DELETE from EventLogItems
where Cast( DT as Date) NOT IN
(
select top 2 Cast( DT as Date) dt
from EventLogItems o
Group by Cast( DT as Date)
Order by Cast( DT as Date) DESC
)
GO
select Cast( DT as Date) dt, Count(*) as EvliCount
from EventLogItems o
Group by Cast( DT as Date)
Order by Cast( DT as Date) DESC
GO
Select 'EventLog After Delete' as Operation, Count(*) as Cnt,
Min(Cast( DT as Date)) as Dt1, Max(Cast( DT as Date)) as Dt2
From EventLogItems
Go
Clear Orders & Trades & EventLogItem (восстановлен частично)
use DbTrade2
-- ORDERS
Select 'Orders To Delete' as Operation, Count(*) as Cnt,
Min(Cast( Modified as Date)) as Dt1, Max(Cast( Modified as Date)) as Dt2
From Orders
Go
DELETE from Orders
where Cast( Created as Date) NOT IN
(
select top 2 Cast( o.Created as Date) dt
from Orders o
Group by Cast( o.Created as Date)
Order by Cast( o.Created as Date) DESC
)
GO
select Cast( o.Created as Date) DT, Count(*) OrdersCount
from Orders o
Group by Cast( o.Created as Date)
Order by Cast( o.Created as Date) DESC
GO
Select 'Orders After Delete' as Operation, Count(*) as Cnt,
Min(Cast( Modified as Date)) as Dt1, Max(Cast( Modified as Date)) as Dt2
From Orders
Go
-- TRADES
Select 'Trades To Delete' as Operation, Count(*) as Cnt,
Min(Cast( DT as Date)) as Dt1, Max(Cast( DT as Date)) as Dt2
From Trades
Go
DELETE from Trades
where Cast( DT as Date) NOT IN
(
select top 2 Cast( DT as Date) DT
from Trades o
Group by Cast( DT as Date)
Order by Cast( DT as Date) DESC
)
GO
select Cast( DT as Date) dt, Count(*) TradesCount
from Trades o
Group by Cast( DT as Date)
Order by Cast( DT as Date) DESC
GO
Select 'Trades After Delete' as Operation, Count(*) as Cnt,
Min(Cast( DT as Date)) as Dt1, Max(Cast( DT as Date)) as Dt2
From Trades
Go
-- DEALS
--Select 'Deals Count' as Operation
Select 'Deals Count' as Operation, Count(*) as Cnt,
Min(Cast( DT as Date)) as Dt1, Max(Cast( DT as Date)) as Dt2
from Deals
go
--select Cast( DT as Date) dt, Count(*) DealsCount
--FROM Deals
--Group by Cast( DT as Date)
--Order by Cast( DT as Date) DESC
--Select 'Deals Delete' as Operation
--DELETE from Deals
--where Cast( DT as Date) NOT IN
--(
--select top 3 Cast( DT as Date) dt
--from Deals o
--Group by Cast( DT as Date)
--Order by Cast( DT as Date) DESC
--)
--GO
--select Cast( DT as Date) dt, Count(*) DealsCount
--from Deals o
--Group by Cast( DT as Date)
--Order by Cast( DT as Date) DESC
--GO
-- EventLogs --
Use EventLog
Select 'EventLog To Delete' as Operation, Count(*) as Cnt,
Min(Cast( DT as Date)) as Dt1, Max(Cast( DT as Date)) as Dt2
From EventLogItems
Go
DELETE from EventLogItems
where Cast( DT as Date) NOT IN
(
select top 2 Cast( DT as Date) dt
from EventLogItems o
Group by Cast( DT as Date)
Order by Cast( DT as Date) DESC
)
GO
select Cast( DT as Date) dt, Count(*) as EvliCount
from EventLogItems o
Group by Cast( DT as Date)
Order by Cast( DT as Date) DESC
GO
Select 'EventLog After Delete' as Operation, Count(*) as Cnt,
Min(Cast( DT as Date)) as Dt1, Max(Cast( DT as Date)) as Dt2
From EventLogItems
Go
GS.Configurations
Test request: BController
http://localhost/GS.Trade.Web.Mvc.Cfg_01/api/x?cnf=ren.sim&item=assemlies&obj=D:/VC/1303/GS.Trade.Strategies/bin/Debug/GS.Trade.Strategies.dll
XBCController
пятница, 30 октября 2015 г.
Element21
public abstract class Element21<TKey, TItem, TList> : Element1<TKey>,
IElement21<TKey,TItem>,
IHaveUri
where TItem : class, IElement1<TKey>, IHaveKey<TKey> , IHaveInit
where TList : IContainer<TKey, TItem>
//where TList : ICollection<TItem>
Отличается от Element2 тем. что сериализация происходит в Builder, а не в Init() как в Element2
public static T Build2<T, TKey, TItem>(XDocument xdoc, string root)
where T : class
where TItem : class, IHaveKey<TKey>
{}
IElement21<TKey,TItem>,
IHaveUri
where TItem : class, IElement1<TKey>, IHaveKey<TKey> , IHaveInit
where TList : IContainer<TKey, TItem>
//where TList : ICollection<TItem>
Отличается от Element2 тем. что сериализация происходит в Builder, а не в Init() как в Element2
public static T Build2<T, TKey, TItem>(XDocument xdoc, string root)
where T : class
where TItem : class, IHaveKey<TKey>
{}
среда, 28 октября 2015 г.
TradeStorage
public abstract class Storage<TKey, TItem> : Element1<TKey>, IHaveUri
where TItem : IElement1<TKey>, IHaveKey<TKey>, IHaveInit
//where TList : Containers5.Container<TList, TItem, TKey> //where TList : ICollection<TItem>
public class TradeStorage : GS.Storages.Storage<string, ITradeStorage>, ITradeStorage //, IHaveQueue
where TItem : IElement1<TKey>, IHaveKey<TKey>, IHaveInit
//where TList : Containers5.Container<TList, TItem, TKey> //where TList : ICollection<TItem>
public class TradeStorage : GS.Storages.Storage<string, ITradeStorage>, ITradeStorage //, IHaveQueue
Elements2, 3 Implementations
Element1:
public interface IElement1<TKey> : Containers5.IHaveKey<TKey>
abstract public class Element1<TKey> : Containers5.IHaveKey<TKey>, IHaveInit, IElement1<TKey>
----------------------------------------------------------------------------------------------------------------
Element2: Element1 + Collecttion
public interface IElement2<TKey, TItem> : IElement1<TKey>
public abstract class Element2<TKey, TItem, TList> : Element1<TKey> , IElement2<TKey,TItem>, IHaveUri
where TItem : class, IElement1<TKey>, IHaveKey<TKey>, IHaveInit
where TList : IContainer<TKey, TItem>
public class Portfolio : Element2<string, IStrategy, Containers5.ListContainer<string, IStrategy>> , IPortfolio
public class Portfolios : Element2<string, IPortfolio, Containers5.ListContainer<string, IPortfolio>> , IPortfolios
public class Dde2 : Element2<string, TopicItem, Containers5.DictionaryContainer<string, TopicItem>>, IDde
public class Test : Element2<string, TestItem , Containers5.DictionaryContainer<string, TestItem>>
public class Works : Element2<string, IWorkBase, DictionaryContainer<string, IWorkBase>>, IWorks
public class WorkTasks : Element2<string, IWorkTask3, Containers5.DictionaryContainer<string, IWorkTask3>>
-----------------------------------------------------------------------------------------------------------------
Element3: Element3 = Element1 + Queue + Work
public interface IElement3<TKey, in TQueueInput> :
IElement1<TKey>,
IHaveQueue3<TQueueInput>,
IHaveWork<TQueueInput> { }
public abstract class Element3<TKey, TEventArgs> : Element1<TKey>, IElement3<TKey,TEventArgs>
where TEventArgs : IEventArgs
public class Tickers3 : Element3<string,IEventArgs>, ITickers //, IHaveQueue<string>
public abstract class TradeBaseRepository35<TContext, TKey, TValueExt, TValueInt, TValueIntOut> :
Element3<string, IEventArgs>,
ITradeBaseRepository3<TKey, TValueExt, TValueIntOut>, INeedDataBaseName
where TValueExt : class, IHaveKey<TKey> //, IHaveId<TId>
where TValueInt : class, IHaveKey<TKey>, TValueIntOut //, IHaveId<TId>
where TValueIntOut : class, IHaveKey<TKey> //, IHaveId<TId>
where TContext : IDisposable
public abstract class Context : Element3<string, IEventArgs>, IContext
public class ConsoleWriter : Element3<string,IEventArgs>
public class BarRand : Element3<string, IEventArgs>
-----------------------------------------------------------------------------------------------------------------------
Element32: Element3 + Collection
public interface IElement32<TKey, TItem> : IElement1<TKey>
{
IEnumerable<TItem> Items { get; }
TItem Register(TItem item);
TItem GetByKey(TKey key);
}
public abstract class Element32<TKey, TEventArgs, TList, TItem> : Element3<TKey, TEventArgs> , IElement2<TKey, TItem>, IHaveUri
where TItem : class, IElement1<TKey>, IHaveKey<TKey> //, IHaveInit
// where TItem : class, IHaveKey<TKey> // , IHaveInit
where TList : IContainer<TKey, TItem>
where TEventArgs : IEventArgs
//where TList : ICollection<TItem>
public class EventHub3 : Element32<string, IEventArgs, DictionaryContainer<string, EventHubItem3>, EventHubItem3>
public interface IElement1<TKey> : Containers5.IHaveKey<TKey>
abstract public class Element1<TKey> : Containers5.IHaveKey<TKey>, IHaveInit, IElement1<TKey>
----------------------------------------------------------------------------------------------------------------
Element2: Element1 + Collecttion
public interface IElement2<TKey, TItem> : IElement1<TKey>
public abstract class Element2<TKey, TItem, TList> : Element1<TKey> , IElement2<TKey,TItem>, IHaveUri
where TItem : class, IElement1<TKey>, IHaveKey<TKey>, IHaveInit
where TList : IContainer<TKey, TItem>
public class Portfolio : Element2<string, IStrategy, Containers5.ListContainer<string, IStrategy>> , IPortfolio
public class Portfolios : Element2<string, IPortfolio, Containers5.ListContainer<string, IPortfolio>> , IPortfolios
public class Dde2 : Element2<string, TopicItem, Containers5.DictionaryContainer<string, TopicItem>>, IDde
public class Test : Element2<string, TestItem , Containers5.DictionaryContainer<string, TestItem>>
public class Works : Element2<string, IWorkBase, DictionaryContainer<string, IWorkBase>>, IWorks
public class WorkTasks : Element2<string, IWorkTask3, Containers5.DictionaryContainer<string, IWorkTask3>>
-----------------------------------------------------------------------------------------------------------------
Element3: Element3 = Element1 + Queue + Work
public interface IElement3<TKey, in TQueueInput> :
IElement1<TKey>,
IHaveQueue3<TQueueInput>,
IHaveWork<TQueueInput> { }
public abstract class Element3<TKey, TEventArgs> : Element1<TKey>, IElement3<TKey,TEventArgs>
where TEventArgs : IEventArgs
public class Tickers3 : Element3<string,IEventArgs>, ITickers //, IHaveQueue<string>
public abstract class TradeBaseRepository35<TContext, TKey, TValueExt, TValueInt, TValueIntOut> :
Element3<string, IEventArgs>,
ITradeBaseRepository3<TKey, TValueExt, TValueIntOut>, INeedDataBaseName
where TValueExt : class, IHaveKey<TKey> //, IHaveId<TId>
where TValueInt : class, IHaveKey<TKey>, TValueIntOut //, IHaveId<TId>
where TValueIntOut : class, IHaveKey<TKey> //, IHaveId<TId>
where TContext : IDisposable
public abstract class Context : Element3<string, IEventArgs>, IContext
public class ConsoleWriter : Element3<string,IEventArgs>
public class BarRand : Element3<string, IEventArgs>
-----------------------------------------------------------------------------------------------------------------------
Element32: Element3 + Collection
public interface IElement32<TKey, TItem> : IElement1<TKey>
{
IEnumerable<TItem> Items { get; }
TItem Register(TItem item);
TItem GetByKey(TKey key);
}
public abstract class Element32<TKey, TEventArgs, TList, TItem> : Element3<TKey, TEventArgs> , IElement2<TKey, TItem>, IHaveUri
where TItem : class, IElement1<TKey>, IHaveKey<TKey> //, IHaveInit
// where TItem : class, IHaveKey<TKey> // , IHaveInit
where TList : IContainer<TKey, TItem>
where TEventArgs : IEventArgs
//where TList : ICollection<TItem>
public class EventHub3 : Element32<string, IEventArgs, DictionaryContainer<string, EventHubItem3>, EventHubItem3>
суббота, 24 октября 2015 г.
воскресенье, 18 октября 2015 г.
понедельник, 12 октября 2015 г.
Web Api Interface TimeSeries
Solution: GS.Trade.Series2
Ticker, TimeInt:
Project: GS.Trade.Web.Api.TimeSeries01
Ticker, TimeInt:
Only 3 Days for Test Only
http://185.31.162.98/GS.Trade.Web.Api.TimeSeries01/api/bars?ticker=SiZ5&timeint=5&dt1=20151001&dt2=20151013
SeriesId:http://185.31.162.98/GS.Trade.Web.Api.TimeSeries01/api/bars?seriesId=20&date=20151001
http://185.31.162.98/GS.Trade.Web.Api.TimeSeries01/api/bars?seriesId=20&dt1=20151001&dt2=20151013
TimeSeriesStat:
http://185.31.162.98/GS.Trade.Web.Api.TimeSeries01/api/timeSeriesStat?ticker=SiZ5&timeint=5
Tickers:
понедельник, 5 октября 2015 г.
вторник, 4 августа 2015 г.
Переход на VC\1303
1. На GSSFT2 произошел сбой в репозитарии VC/1302 - ошибка в файле /remote/origin/master.
2. Создал новый репозитарий на D:/VC/1303/
3. Сделал Clone из http://localhost:8080/tfs/DefaultCollection/_git/VC1302
4. Исправил ошибки СonsoleAsync to ConsoleAS в GS.WorkTask
5. Work<T> был определен и в GS и в GS.WorkTask
2. Создал новый репозитарий на D:/VC/1303/
3. Сделал Clone из http://localhost:8080/tfs/DefaultCollection/_git/VC1302
4. Исправил ошибки СonsoleAsync to ConsoleAS в GS.WorkTask
5. Work<T> был определен и в GS и в GS.WorkTask
воскресенье, 17 мая 2015 г.
QR Format txt
QR Format .txt
L,EUR,GBP,CHF,JPY,EURGBP,EURCHF,EURJPY,GBPCHF,GBPJPY,CHFJPY,CAD,EURCAD,AUD,AUDJPY,NZD,NZDJPY,XAU,XAG,CZK,DKK,EURRUB,HUF,NOK,PLN,RUB,SEK,SGD,ZAR,HKD,MXN,TRY,EURHKD,EURMXN,EURTRY,EURAUD,EURNZD,EURSGD,EURZAR,XAUEUR,XAGEUR,GBPCAD,GBPAUD,GBPNZD,AUDCHF,AUDCAD,AUDNZD,NZDCHF,NZDCAD,CADCHF,CADJPY
S,EUR
D,36894
1,0.9507,0.9507,0.9507,0.9507
2,0.9506,0.9506,0.9505,0.9505
3,0.9505,0.9507,0.9505,0.9506
4,0.9506,0.9506,0.9506,0.9506
...
1431,0.9268,0.9268,0.9266,0.9266
1432,0.9267,0.9269,0.9267,0.9269
1433,0.9269,0.9270,0.9269,0.9270
1434,0.9270,0.9270,0.9270,0.9270
1435,0.9270,0.9271,0.9270,0.9271
1436,0.9271,0.9271,0.9271,0.9271
1437,0.9271,0.9271,0.9271,0.9271
1438,0.9271,0.9272,0.9271,0.9271
1439,0.9271,0.9271,0.9271,0.9271
D,36895
1,0.9271,0.9271,0.9271,0.9271
2,0.9271,0.9273,0.9271,0.9272
3,0.9272,0.9272,0.9272,0.9272
4,0.9272,0.9272,0.9272,0.9272
5,0.9272,0.9273,0.9271,0.9272
6,0.9271,0.9271,0.9270,0.9271
7,0.9271,0.9271,0.9269,0.9270
8,0.9270,0.9270,0.9269,0.9269
9,0.9269,0.9269,0.9269,0.9269
10,0.9269,0.9269,0.9269,0.9269
среда, 22 апреля 2015 г.
воскресенье, 5 апреля 2015 г.
tfs
1. Наличие конфликта при фиксации изменений в файле
D:\VC\1302\GS.Trade.Web\packages\EntityFramework.6.1.1\tools\EntityFramework.psd1 в решении GS.Trade.Web
Решение: Отправил этот файл в игнор.
Также не передался на tfs один файл из каталога Migration
D:\VC\1302\GS.Trade.Web\packages\EntityFramework.6.1.1\tools\EntityFramework.psd1 в решении GS.Trade.Web
Решение: Отправил этот файл в игнор.
Также не передался на tfs один файл из каталога Migration
воскресенье, 29 марта 2015 г.
Charts - new Pro with WebCharts Demo ChartDirector Added
1. New Team Project
D:/VC/Charts
2.Demo
http://localhost:8080/tfs/DefaultCollection/_git/Charts
Local RepoD:/VC/Charts
2.Demo
http://localhost/Chartdirector/index.htm
3. Mvc
http://localhost/GS.Trade.Web.Charts.Mvc_02/Charts/getchartimage
воскресенье, 22 марта 2015 г.
EventLogReferences
Решение: D:\VC\1302\GS.EventLog\GS.EventLog2\GS.EventLog2.sln
Mvc - version
http://localhost/evlhtmlClient_01/htmlpage13.html
Для localhosthttp://localhost/EvlHtmlClient_01/lochtmlpage13.html
Решение D:\vspr1213\GS12\GS.EventLogClients\GS.EventLogClients.sln - НЕ находится в VChttp://localhost/htmlEvlClient02/htmlpage24.html
Mvc - version
http://localhost/WebEventLog_01/
воскресенье, 25 января 2015 г.
VC.1302
На Планете завел новый командный проект: VC1302
D:/VC/1302
Туда скопировал все из GS.Trade.
По планам это будет флагманский проект с сопутствующими все в одном месте.
http://localhost:8080/tfs/DefaultCollection/_git/VC1302
D:/VC/1302
Туда скопировал все из GS.Trade.
По планам это будет флагманский проект с сопутствующими все в одном месте.
http://localhost:8080/tfs/DefaultCollection/_git/VC1302
Подписаться на:
Комментарии (Atom)