Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MeowBot
OQAllInOne
Commits
7f43aa06
Commit
7f43aa06
authored
Feb 17, 2020
by
hetao
Browse files
upgrade package
parent
5fff693c
Changes
10
Hide whitespace changes
Inline
Side-by-side
IntradayDataServer/DatabaseService.cs
View file @
7f43aa06
...
...
@@ -76,10 +76,12 @@ namespace QuantBox.Servers
var
insts
=
new
Dictionary
<
string
,
StoreInstrument
>();
foreach
(
var
item
in
list
)
{
if
(
insts
.
ContainsKey
(
item
.
Symbol
))
if
(
insts
.
TryGetValue
(
item
.
Symbol
,
out
var
exists
))
{
// var exist
return
(
null
,
true
);
if
(
exists
.
TradingDay
<
item
.
TradingDay
)
{
insts
[
item
.
Symbol
]
=
item
;
}
}
else
{
...
...
IntradayDataServer/IntradayDataServer.csproj
View file @
7f43aa06
...
...
@@ -18,13 +18,12 @@
<ItemGroup>
<PackageReference Include="CSharpHdf" Version="1.0.2" />
<PackageReference Include="Hocon" Version="2.0.0" />
<PackageReference Include="LmdbMarketDatabase" Version="1.0.
8
" />
<PackageReference Include="LmdbMarketDatabase" Version="1.0.
10
" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NLog.Config" Version="4.6.8" />
<PackageReference Include="QuantBox.Tushare" Version="1.4.1" />
<PackageReference Include="Squid-Box.SevenZipSharp" Version="1.2.242" />
<PackageReference Include="TickSerializer" Version="1.0.48" />
<PackageReference Include="XApiSharp" Version="1.0.9" />
...
...
IntradayDataServer/server.conf
View file @
7f43aa06
...
...
@@ -6,8 +6,8 @@ calendar_url = "http://data.quantbox.cn/trading_dates?start_date={0}&end_date={1
# 刷新数据库的间隔时间
db_refresh_interval
=
60
# 数据库目录
db_path
=
'
d
:\\temp\\database\\'
db_output_path
=
'
d
:\\temp\\database\\tickzip\\'
db_path
=
'
f
:\\temp\\database\\'
db_output_path
=
'
f
:\\temp\\database\\tickzip\\'
db_file_count
=
9
#
tushare
.
token
=
'f700ceaa188e30e9f11f592b5f7b0e2a55740476dcb68f4804f5495f'
...
...
TickSaver2/TickSaver.cs
View file @
7f43aa06
...
...
@@ -34,7 +34,7 @@ namespace OpenQuant
}
}
public
IList
<
StoreInstrument
>
InitDatabase
(
int
interval
)
public
IList
<
StoreInstrument
>
InitDatabase
(
int
interval
,
DateTime
tradingDay
)
{
var
info
=
Instruments
.
Select
(
n
=>
new
StoreInstrument
{
Id
=
n
.
Id
,
...
...
@@ -46,7 +46,8 @@ namespace OpenQuant
CallOrPut
=
n
.
PutCall
==
PutCall
.
Call
?
(
byte
)
1
:
(
byte
)
0
,
TickSize
=
n
.
TickSize
,
Factor
=
n
.
Factor
,
ExpireDate
=
n
.
Maturity
ExpireDate
=
n
.
Maturity
,
TradingDay
=
tradingDay
}).
ToArray
();
_databases
=
LmdbMarketDatabase
.
CreateStores
(
info
,
TickPath
,
(
item
)
=>
item
.
SetFlushInterval
(
TimeSpan
.
FromSeconds
(
interval
)));
...
...
TickSaver2/TickSaver2.csproj
View file @
7f43aa06
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>
Win
Exe</OutputType>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<StartupObject></StartupObject>
<RootNamespace>OpenQuant</RootNamespace>
...
...
@@ -18,10 +18,9 @@
<ItemGroup>
<PackageReference Include="CSharpHdf" Version="1.0.2" />
<PackageReference Include="Hocon" Version="2.0.0" />
<PackageReference Include="LmdbMarketDatabase" Version="1.0.
8
" />
<PackageReference Include="LmdbMarketDatabase" Version="1.0.
10
" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="QuantBox.Tushare" Version="1.4.1" />
<PackageReference Include="SkylineStandard" Version="1.0.23" />
<PackageReference Include="Squid-Box.SevenZipSharp" Version="1.2.242" />
<PackageReference Include="TickSerializer" Version="1.0.48" />
...
...
TickSaver2/TickSaverScenario.cs
View file @
7f43aa06
...
...
@@ -102,7 +102,7 @@ namespace OpenQuant
_logger
.
Info
(
$"subscription
{
item
.
Symbol
}
"
);
}
}
saver
.
InitDatabase
(
config
.
GetInt
(
"db_flush_interval"
));
saver
.
InitDatabase
(
config
.
GetInt
(
"db_flush_interval"
)
,
tradingDay
);
static
bool
IsContinuous
(
Instrument
inst
)
{
...
...
@@ -123,7 +123,7 @@ namespace OpenQuant
}
}
return
Parser
.
Parse
(
File
.
ReadAllText
(
name
),
ConfigResolver
);
return
Hocon
Parser
.
Parse
(
File
.
ReadAllText
(
name
),
ConfigResolver
);
}
public
static
bool
Do
(
string
name
)
...
...
tick_saver/TickSaver.cs
View file @
7f43aa06
...
...
@@ -34,7 +34,7 @@ namespace OpenQuant
}
}
public
IList
<
StoreInstrument
>
InitDatabase
(
int
interval
)
public
IList
<
StoreInstrument
>
InitDatabase
(
int
interval
,
DateTime
tradingDay
)
{
var
info
=
Instruments
.
Select
(
n
=>
new
StoreInstrument
{
Id
=
n
.
Id
,
...
...
@@ -46,7 +46,8 @@ namespace OpenQuant
CallOrPut
=
n
.
PutCall
==
PutCall
.
Call
?
(
byte
)
1
:
(
byte
)
0
,
TickSize
=
n
.
TickSize
,
Factor
=
n
.
Factor
,
ExpireDate
=
n
.
Maturity
ExpireDate
=
n
.
Maturity
,
TradingDay
=
tradingDay
}).
ToArray
();
_databases
=
LmdbMarketDatabase
.
CreateStores
(
info
,
TickPath
,
(
item
)
=>
item
.
SetFlushInterval
(
TimeSpan
.
FromSeconds
(
interval
)));
...
...
tick_saver/TickSaverScenario.cs
View file @
7f43aa06
...
...
@@ -102,7 +102,7 @@ namespace OpenQuant
_logger
.
Info
(
$"subscription
{
item
.
Symbol
}
"
);
}
}
saver
.
InitDatabase
(
config
.
GetInt
(
"db_flush_interval"
));
saver
.
InitDatabase
(
config
.
GetInt
(
"db_flush_interval"
)
,
tradingDay
);
static
bool
IsContinuous
(
Instrument
inst
)
{
...
...
@@ -202,7 +202,7 @@ namespace OpenQuant
}
else
if
(
time
>=
nightOpenTime
)
{
RunTickSaver
(
config
,
date
.
AddDays
(
1
).
Add
(
nightCloseTime
),
calendar
.
GetNextTradingDay
(
date
),
fals
e
);
RunTickSaver
(
config
,
date
.
AddDays
(
1
).
Add
(
nightCloseTime
),
calendar
.
GetNextTradingDay
(
date
),
tru
e
);
}
}
framework
.
StrategyManager
.
StartStrategy
(
strategy
,
StrategyMode
.
Live
);
...
...
tick_saver/tick_saver.conf
View file @
7f43aa06
ctp_server
=
'天风电信'
ctp_user
=
'008112'
ctp_pwd
=
'123456'
tick_path
=
'
d
:\\temp\\database\\
yinhe
\\'
tick_path
=
'
f
:\\temp\\database\\
xml_db
\\'
include
required
(
file
(
"common.conf"
))
\ No newline at end of file
tick_saver/tick_saver.csproj
View file @
7f43aa06
...
...
@@ -17,35 +17,35 @@
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="CSharpHdf" Version="1.0.2" />
<PackageReference Include="Hocon" Version="2.0.0" />
<PackageReference Include="LmdbMarketDatabase" Version="1.0.
8
" />
<PackageReference Include="LmdbMarketDatabase" Version="1.0.
10
" />
<PackageReference Include="FileServer" Version="1.0.1" />
</ItemGroup>
<ItemGroup>
<None Update="common.conf">
<CopyToOutputDirectory>
Always
</CopyToOutputDirectory>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</None>
<None Update="TickSaver.conf">
<CopyToOutputDirectory>
Always
</CopyToOutputDirectory>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</None>
<None Update="tick_saver.conf">
<CopyToOutputDirectory>
Always
</CopyToOutputDirectory>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="./openquant/config/*.*">
<CopyToOutputDirectory>
Always
</CopyToOutputDirectory>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</Content>
<Content Include="./openquant/config/quantbox/*.*">
<CopyToOutputDirectory>
Always
</CopyToOutputDirectory>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</Content>
<Content Include="./openquant/logs/*.*">
<CopyToOutputDirectory>
Always
</CopyToOutputDirectory>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</Content>
<Content Include="./openquant/data/*.*">
<CopyToOutputDirectory>
Always
</CopyToOutputDirectory>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment