Merge branch 'spark_crypto.dev' of bitbucket.org:bluetradesys/spark into spark_crypto.dev

This commit is contained in:
Taha Afzal committed 2022-12-19 17:41:38 -05:00
commit f9bba0baed
16 files changed
+120 -52

No files matched your search

+1
View File
@@ -106,6 +106,7 @@ else()
add_custom_target(server_layout ALL DEPENDS ${CMAKE_BINARY_DIR}/server)
install(DIRECTORY "${CMAKE_BINARY_DIR}/server/plugins" DESTINATION bin)
install(FILES "${CMAKE_SOURCE_DIR}/externals/linux/lib/${CMAKE_BUILD_TYPE}/libACE-5.7.5.so" DESTINATION bin)
install(FILES "${CMAKE_SOURCE_DIR}/externals/linux/lib/${CMAKE_BUILD_TYPE}/libOnixS.IceImpactMulticastPriceFeedHandlerCpp.so.3.16.0.0" DESTINATION bin)
install(FILES "${CMAKE_SOURCE_DIR}/externals/src/emumba/sparkd.lic" DESTINATION bin)
+32 -12
View File
@@ -1,10 +1,10 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30114.105
# Visual Studio Version 17
VisualStudioVersion = 17.3.32922.545
MinimumVisualStudioVersion = 15.0.26124.0
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spark_api", "src\client\spark_api\spark_api.csproj", "{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspark", "build\src\lib\libspark.vcxproj", "{9FA60215-26AF-3EB7-AB89-D4F4B126EF40}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspark", "build\src\lib\libspark.vcxproj", "{FDC3A021-386E-3A2C-A7EB-CBE94A95BE25}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spark", "src\client\spark\Spark.csproj", "{9A4D4D07-1AB6-4B2B-B111-A4F34D6C267E}"
EndProject
@@ -14,11 +14,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spark_core", "src\client\sp
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spark_sdk", "src\client\spark_sdk\spark_sdk.csproj", "{6963C314-83C4-4667-B0D0-C2F7AE208C29}"
ProjectSection(ProjectDependencies) = postProject
{9FA60215-26AF-3EB7-AB89-D4F4B126EF40} = {9FA60215-26AF-3EB7-AB89-D4F4B126EF40}
{FDC3A021-386E-3A2C-A7EB-CBE94A95BE25} = {FDC3A021-386E-3A2C-A7EB-CBE94A95BE25}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spark_test", "src\client\spark_test\spark_test.csproj", "{ECD78CC5-138F-4809-A764-2358C2AC2E82}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spark_websocket", "src\client\spark_websocket\spark_websocket.csproj", "{3201359D-C071-4089-9EDE-B04D759F1508}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spark_api_server", "src\client\spark_api_server\spark_api_server.csproj", "{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@@ -35,14 +39,14 @@ Global
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Release|x64.Build.0 = Release|x64
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.RelWithDebInfo|x64.Build.0 = Release|x64
{9FA60215-26AF-3EB7-AB89-D4F4B126EF40}.Debug|x64.ActiveCfg = Debug|x64
{9FA60215-26AF-3EB7-AB89-D4F4B126EF40}.Debug|x64.Build.0 = Debug|x64
{9FA60215-26AF-3EB7-AB89-D4F4B126EF40}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
{9FA60215-26AF-3EB7-AB89-D4F4B126EF40}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
{9FA60215-26AF-3EB7-AB89-D4F4B126EF40}.Release|x64.ActiveCfg = Release|x64
{9FA60215-26AF-3EB7-AB89-D4F4B126EF40}.Release|x64.Build.0 = Release|x64
{9FA60215-26AF-3EB7-AB89-D4F4B126EF40}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
{9FA60215-26AF-3EB7-AB89-D4F4B126EF40}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
{FDC3A021-386E-3A2C-A7EB-CBE94A95BE25}.Debug|x64.ActiveCfg = Debug|x64
{FDC3A021-386E-3A2C-A7EB-CBE94A95BE25}.Debug|x64.Build.0 = Debug|x64
{FDC3A021-386E-3A2C-A7EB-CBE94A95BE25}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
{FDC3A021-386E-3A2C-A7EB-CBE94A95BE25}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
{FDC3A021-386E-3A2C-A7EB-CBE94A95BE25}.Release|x64.ActiveCfg = Release|x64
{FDC3A021-386E-3A2C-A7EB-CBE94A95BE25}.Release|x64.Build.0 = Release|x64
{FDC3A021-386E-3A2C-A7EB-CBE94A95BE25}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
{FDC3A021-386E-3A2C-A7EB-CBE94A95BE25}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
{9A4D4D07-1AB6-4B2B-B111-A4F34D6C267E}.Debug|x64.ActiveCfg = Debug|x64
{9A4D4D07-1AB6-4B2B-B111-A4F34D6C267E}.Debug|x64.Build.0 = Debug|x64
{9A4D4D07-1AB6-4B2B-B111-A4F34D6C267E}.MinSizeRel|x64.ActiveCfg = Release|x64
@@ -83,6 +87,22 @@ Global
{ECD78CC5-138F-4809-A764-2358C2AC2E82}.Release|x64.Build.0 = Release|x64
{ECD78CC5-138F-4809-A764-2358C2AC2E82}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{ECD78CC5-138F-4809-A764-2358C2AC2E82}.RelWithDebInfo|x64.Build.0 = Release|x64
{3201359D-C071-4089-9EDE-B04D759F1508}.Debug|x64.ActiveCfg = Debug|x64
{3201359D-C071-4089-9EDE-B04D759F1508}.Debug|x64.Build.0 = Debug|x64
{3201359D-C071-4089-9EDE-B04D759F1508}.MinSizeRel|x64.ActiveCfg = Debug|x64
{3201359D-C071-4089-9EDE-B04D759F1508}.MinSizeRel|x64.Build.0 = Debug|x64
{3201359D-C071-4089-9EDE-B04D759F1508}.Release|x64.ActiveCfg = Release|x64
{3201359D-C071-4089-9EDE-B04D759F1508}.Release|x64.Build.0 = Release|x64
{3201359D-C071-4089-9EDE-B04D759F1508}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{3201359D-C071-4089-9EDE-B04D759F1508}.RelWithDebInfo|x64.Build.0 = Release|x64
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Debug|x64.ActiveCfg = Debug|x64
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Debug|x64.Build.0 = Debug|x64
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.MinSizeRel|x64.ActiveCfg = Debug|x64
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.MinSizeRel|x64.Build.0 = Debug|x64
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Release|x64.ActiveCfg = Release|x64
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Release|x64.Build.0 = Release|x64
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.RelWithDebInfo|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
+13 -11
View File
@@ -1,14 +1,10 @@
using System;
using System.Collections.Generic;
using mbts.analytics;
using bts.api;
using mbts.ui;
using MathNet.Numerics.Providers.FourierTransform;
using BCG;
using System.Windows.Automation;
using bts.collections;
namespace mbts.spark {
using bts.api;
using System;
using System.Collections.Generic;
using System.Linq;
// A lot of options data (migrated from edge) is not normalized
// on the sec_id, but rather on a combination of symbol, exp, strike.
@@ -20,6 +16,9 @@ namespace mbts.spark {
public static IDictionary<UInt32, DriverMD> normalize_drivers(
OptionDriverPriceMap driver_map, SystemContractData sc_data) {
if (driver_map is null) {
return new Dictionary<uint, DriverMD>(0);
}
Dictionary<UInt32, DriverMD> rv = new Dictionary<uint, DriverMD>();
foreach (var kv in driver_map.get_price_map()) {
var exp = kv.Key;
@@ -40,6 +39,9 @@ namespace mbts.spark {
}
public static IEnumerable<Tuple<SecurityImmutable, TheoPoint>> normalize_interp_theos(
OptionTheoInterpolationData symbol_theos, SystemContractData sc_data) {
if (symbol_theos is null) {
return Enumerable.Empty<Tuple<SecurityImmutable, TheoPoint>>();
}
var rv = new List<Tuple<SecurityImmutable, TheoPoint>>();
foreach (DateTime exp in symbol_theos.get_expirations()) {
Dictionary<double, Dictionary<double, TheoPoint>> exp_data =
@@ -65,4 +67,4 @@ namespace mbts.spark {
return rv;
}
}
}
}
@@ -44,10 +44,11 @@
<Setter Property="Margin" Value="{StaticResource PanelItem.MarginT}" />
</Style>
<Style x:Key="PanelItem.TickUpDown.Parameterless" TargetType="c:TickUpDown">
<Style x:Key="PanelItem.TickUpDown.Parameterless" TargetType="c:TickUpDown" BasedOn="{StaticResource {x:Type c:TickUpDown}}">
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Margin" Value="{StaticResource PanelItem.MarginT}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{u:BTSBrush UI.default_text}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="TickUpCommandParameter" Value="{u:True}" />
<Setter Property="TickDownCommandParameter" Value="{u:False}" />
-4
View File
@@ -61,10 +61,6 @@
<Setter Property="Background" Value="{u:BTSBrush UI.ScrollBar.background}"/>
<Setter Property="Foreground" Value="{u:BTSBrush UI.ScrollBar.foreground}"/>
</Style>
<Style TargetType="RepeatButton">
<Setter Property="Background" Value="{u:BTSBrush UI.RepeatButton.background}"/>
<Setter Property="Foreground" Value="{u:BTSBrush UI.RepeatButton.foreground}"/>
</Style>
<Style TargetType="StatusBar">
<Setter Property="Background" Value="{u:BTSBrush UI.StatusBar.background}"/>
</Style>
@@ -904,11 +904,7 @@ namespace mbts.ui {
public static BTSColor background => UI.default_background;
public static BTSColor foreground => thumb_static;//UI.default_text;
}
public static class RepeatButton {
public static BTSColor background => UI.default_background;
public static BTSColor foreground => UI.black;
public static BTSColor border => UI.default_text;
}
public static class StatusBarItem {
public static BTSColor foreground => UI.default_text;
}
@@ -8,6 +8,7 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/view/Colors.xaml" />
<ResourceDictionary Source="/view/Resources/Converters.xaml" />
<ResourceDictionary Source="/view/Resources/Buttons.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="{x:Type c:TickUpDown}">
@@ -55,8 +56,8 @@
<Path
HorizontalAlignment="Right"
VerticalAlignment="Center"
Fill="{u:BTSBrush UI.RepeatButton.foreground}"
Data="F1 M 0,0 L 2.667,2.66665 L 5.3334,0 L 5.3334,-1.78168 L 2.6667,0.88501 L0,-1.78168 L0,0 Z"
Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType=RepeatButton}}"
RenderTransformOrigin="0.5,0.5">
<Path.RenderTransform>
<RotateTransform Angle="180" />
@@ -67,7 +68,7 @@
<Path
HorizontalAlignment="Center"
VerticalAlignment="Center"
Fill="{u:BTSBrush UI.RepeatButton.foreground}"
Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType=RepeatButton}}"
Data="F1 M 0,0 L 2.667,2.66665 L 5.3334,0 L 5.3334,-1.78168 L 2.6667,0.88501 L0,-1.78168 L0,0 Z" />
</RepeatButton>
</Grid>
@@ -110,16 +111,23 @@
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
/>
<RepeatButton Command="{TemplateBinding TickUpCommand}" CommandParameter="{TemplateBinding TickUpCommandParameter}" BorderThickness="0" Focusable="False" Visibility="Hidden">
<Path Data="F1 M 0,0 L 2.667,2.66665 L 5.3334,0 L 5.3334,-1.78168 L 2.6667,0.88501 L0,-1.78168 L0,0 Z"
Fill="{u:BTSBrush UI.RepeatButton.foreground}" HorizontalAlignment="Right" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
<Path
HorizontalAlignment="Right"
VerticalAlignment="Center"
Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType=RepeatButton}}"
RenderTransformOrigin="0.5,0.5"
Data="F1 M 0,0 L 2.667,2.66665 L 5.3334,0 L 5.3334,-1.78168 L 2.6667,0.88501 L0,-1.78168 L0,0 Z">
<Path.RenderTransform>
<RotateTransform Angle="180" />
</Path.RenderTransform>
</Path>
</RepeatButton>
<RepeatButton Command="{TemplateBinding TickDownCommand}" CommandParameter="{TemplateBinding TickDownCommandParameter}" BorderThickness="0" Focusable="False" Visibility="Hidden">
<Path Data="F1 M 0,0 L 2.667,2.66665 L 5.3334,0 L 5.3334,-1.78168 L 2.6667,0.88501 L0,-1.78168 L0,0 Z"
Fill="{u:BTSBrush UI.RepeatButton.foreground}" HorizontalAlignment="Center" VerticalAlignment="Center" />
<Path
HorizontalAlignment="Center"
VerticalAlignment="Center"
Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType=RepeatButton}}"
Data="F1 M 0,0 L 2.667,2.66665 L 5.3334,0 L 5.3334,-1.78168 L 2.6667,0.88501 L0,-1.78168 L0,0 Z" />
</RepeatButton>
</Grid>
</Border>
@@ -30,7 +30,7 @@
>
<Path
Data="F1 M 0,0 L 2.667,2.66665 L 5.3334,0 L 5.3334,-1.78168 L 2.6667,0.88501 L0,-1.78168 L0,0 Z"
Fill="#FF606060"
Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType=RepeatButton}}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
RenderTransformOrigin="0.5,0.5"
@@ -52,7 +52,7 @@
>
<Path
Data="F1 M 0,0 L 2.667,2.66665 L 5.3334,0 L 5.3334,-1.78168 L 2.6667,0.88501 L0,-1.78168 L0,0 Z"
Fill="#FF606060"
Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType=RepeatButton}}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
/>
+3 -3
View File
@@ -551,9 +551,9 @@
</Style>
<Style TargetType="RepeatButton">
<Setter Property="Foreground" Value="{u:BTSBrush UI.RepeatButton.foreground}" />
<Setter Property="Background" Value="{u:BTSBrush UI.RepeatButton.background}" />
<Setter Property="BorderBrush" Value="{u:BTSBrush UI.RepeatButton.border}" />
<Setter Property="Foreground" Value="{u:BTSBrush UI.Button.normal_foreground}" />
<Setter Property="Background" Value="{u:BTSBrush UI.Button.normal_background}" />
<Setter Property="BorderBrush" Value="{u:BTSBrush UI.Button.normal_border}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Template">
<Setter.Value>
+11
View File
@@ -0,0 +1,11 @@
namespace spark_api_server {
using System;
class Program {
static int Main(string[] args) {
Console.WriteLine("Starting spark_api_server...");
// TODO
return 0;
}
}
}
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
<PlatformTarget>x64</PlatformTarget>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>$(major).$(minor).$(patch)</Version>
<Version Condition="'$(version)'=='..'">0.0.0</Version>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../spark_api/spark_api.csproj" />
<ProjectReference Include="../spark_core/spark_core.csproj" />
</ItemGroup>
</Project>
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
<PlatformTarget>x64</PlatformTarget>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>$(major).$(minor).$(patch)</Version>
<Version Condition="'$(version)'=='..'">0.0.0</Version>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../spark_core/spark_core.csproj" />
</ItemGroup>
</Project>
+1 -1
View File
@@ -522,7 +522,7 @@ void OrderServiceServer::_on_exchange_position(
ret_pos.set_avg_filled_price(p.avg_filled_price.value());
ret_pos.set_position(p.position);
me->exchange_pos_publisher.add_or_update(ret_pos);
LOG(OrderMan, Info,
LOG(OrderMan, Diag,
"OrderServiceServer::_on_exchange_position publishing pos id: {} "
"key: {} res: {} account_name: {} account_id: {} "
"account_resolved: "
@@ -619,10 +619,6 @@ void EMExecutionGateway::_process_pos_cb_and_fire(
bts_account_ptr == nullptr
? std::nullopt
: std::optional<uint32_t>(bts_account_ptr->id());
LOG(OrderMan, Info,
"EMExecutionGateway::_process_pos_cb_and_fire pos: {} bts_account: "
"{}",
pos, account_name());
me->exchange_position.total_exchange_positions.push_back(
{exch_sec_desc, sec, account_name(), account_id, pos_qty,
Price(pos.position.average_price.to_double())});
@@ -341,8 +341,9 @@ extern "C" void init_spark_plugin(bts::SparkServices &srv) {
init_on_signal_plugin(srv);
if (dyn_algo_config.enable_execution_tester())
init_on_signal_plugin(srv);
init_execution_tester_plugin(srv);
init_sniper_plugin(srv);
if (dyn_algo_config.enable_execution_tester())
init_execution_tester_plugin(srv);
// init_sniper_plugin(srv);
init_task_eye_plugin(srv);
}
@@ -402,7 +402,7 @@ bool TaskingEyeAlgo::_in_shooting_zone(
} else {
double ee_sell_pr = theo + me->edge;
const md::PriceSize &md_bid = sec_data.sec_book.bid().at(0);
LOG(OrderMan, Info,
LOG(OrderMan, Diag,
"TaskingEyeAlgo::_in_shooting_zone sec_key: {} driver: {} theo: {} "
"ee_price: {} md: {}/{}",
sec_key, driver, theo, ee_sell_pr, md_bid.price(), md_bid.size());