Compare commits

...
62 Commits
Author SHA1 Message Date
Kevin Darby 8687ef64f9 added spaces to labels per John 2020-01-27 11:13:56 -05:00
Kevin Darby a307a09cb7 glbxice 2020-01-24 16:42:16 -05:00
Kevin Darby 634563863d added initVals to the atdl 2020-01-24 16:30:05 -05:00
Kevin Darby d7f9d18838 atdl's exported and verified 2020-01-24 15:12:47 -05:00
Kevin Darby c52b2c769f Revert "moved the concept of tag base out of attributes and into CustomOrderDef"
This reverts commit 2356d20888.
2020-01-24 14:23:56 -05:00
Kevin Darby 2356d20888 moved the concept of tag base out of attributes and into CustomOrderDef 2020-01-23 23:31:56 -05:00
Kevin Darby 46909d76e9 xsd validation 2020-01-23 22:36:17 -05:00
Kevin Darby 09404ff9a6 move xsd's 2020-01-23 17:07:46 -05:00
Kevin Darby ce1ae16419 added fixatdl schema and validator, going to try to move the tag base out of an attribute and into custom 2020-01-23 17:04:13 -05:00
Kevin Darby b0a24324ca we can produce and parse fixatdl 2020-01-22 18:26:57 -05:00
Kevin Darby 5f5e4c2400 made adtl file generator 2020-01-21 17:58:41 -05:00
Kevin Darby a798455e7f Merge branch 'dotnet' of bitbucket.org:bluetradesys/spark into cqg 2020-01-21 11:00:44 -05:00
Kevin Darby 7119e18436 Merge branch 'master' of bitbucket.org:bluetradesys/spark into dotnet 2020-01-21 10:24:48 -05:00
Eric Harding a6edbbe7b5 Fix spark sdk build 2020-01-14 17:13:07 -05:00
Kevin Darby d505591e11 Merge branch 'master' of bitbucket.org:bluetradesys/spark into cqg 2020-01-14 13:57:06 -05:00
Kevin Darby 83005d7439 algos over fix 2020-01-14 13:28:53 -05:00
Kevin Darby 4872e8ad7f create, update, delete limit orders works 2020-01-13 14:57:11 -05:00
Eric Harding 51276d161c Revert "Add diagnostic logs to SharedMemory open/close"
This reverts commit 3fa699b4c9 because of
log spam
2020-01-13 11:39:51 -05:00
Eric Harding 3fa699b4c9 Add diagnostic logs to SharedMemory open/close 2020-01-13 11:13:15 -05:00
Eric Harding c9396bd6af Stabilize spark_vm_shell.sh ssk keys 2020-01-13 11:13:00 -05:00
Kevin Darby 065f92937c added note about node 2020-01-11 16:39:01 -05:00
Kevin Darby cdfb60f5d9 native orders going through 2020-01-10 18:14:28 -05:00
Kevin Darby f2b407fdac json file for algos 2020-01-10 13:51:12 -05:00
Pedro Pinto f4dc550f1a Fixed slowness in FIX log parsing.
This slowness was actually causing us to take too long to complete the
FIX connection logon process, resulting in a timeout and failure to
establish the session. It took almost 1ms per log line, with
logs commonly having 20K lines. k
2020-01-10 08:35:33 -05:00
Pedro Pinto bc978ed065 Merge branch 'master' of bitbucket.org:bluetradesys/spark 2020-01-10 08:30:17 -05:00
Kevin Darby 4c4fa77d3a algo structure in a file 2020-01-09 22:47:00 -05:00
Kevin Darby 2aa5a02ce2 putting composites in a file 2020-01-09 18:13:20 -05:00
Kevin Darby 5e1f642076 algo types 2020-01-09 17:18:56 -05:00
Kevin Darby 90b4c7e26f starting cqg integration 2020-01-09 15:50:59 -05:00
Kevin Darby eccc3f5f38 fix merge error 2020-01-09 10:48:34 -05:00
Eric Harding 202c5faffd update devcontainer to allow 2g shm 2020-01-09 10:40:47 -05:00
Kevin Darby de20957ae7 change comment 2020-01-09 09:53:58 -05:00
Kevin Darby f7dec1161a build 2020-01-08 18:09:53 -05:00
Kevin Darby f5e826b095 Merge branch 'dotnet' of bitbucket.org:bluetradesys/spark into cqg 2020-01-08 18:05:25 -05:00
Kevin Darby 4cd3bc40d9 note about not sharing externals 2020-01-08 18:02:00 -05:00
Kevin Darby 3800f3344b netcore 3.1 2020-01-08 17:35:19 -05:00
Kevin Darby 6ad139804f Merge branch 'windows_docker' of bitbucket.org:bluetradesys/spark into dotnet 2020-01-08 17:33:28 -05:00
Kevin Darby 45d5c2d7cd docker / externals 2020-01-08 17:32:19 -05:00
Kevin Darby 0d24062f03 Merge branch 'dotnet' of bitbucket.org:bluetradesys/spark into windows_docker 2020-01-08 17:25:30 -05:00
Kevin Darby 44e0eae281 Merge branch 'master' of bitbucket.org:bluetradesys/spark into dotnet 2020-01-08 17:24:55 -05:00
Kevin Darby 152ab05b4e remove externals sharing 2020-01-08 17:08:49 -05:00
Pedro Pinto 65d55a7618 Added a parser of historical MD to facilitate analysis. 2020-01-02 13:57:54 -05:00
Pedro Pinto 57c3ec34c2 Fixed clang build. 2020-01-02 13:55:49 -05:00
Kevin Darby 4257a172c1 fixed shared obj dir on linux build 2019-12-31 12:39:54 -05:00
Kevin Darby 721a08c4b4 remove these CMakeDeps so gitignore can ignore 2019-12-31 10:44:32 -05:00
Kevin Darby 41a3535e84 made some minor changes to support running a dev environment in our api docker on windows 2019-12-31 10:07:55 -05:00
Kevin Darby 626629bf06 added spark_vm_shell for windows 2019-12-31 10:06:54 -05:00
Eric Harding 487aaef02f update cmake 2019-12-16 13:12:50 -05:00
Eric Harding f22fc03e56 merge master 2019-12-16 12:54:19 -05:00
Kevin Darby 5f45ddf210 wack vs backwack 2019-11-28 02:46:27 +00:00
Kevin Darby d6a533ca5c PR feedback 2019-11-27 17:21:24 -05:00
Kevin Darby 20e58dc80b address PR concerns 2019-11-13 16:46:36 -05:00
Kevin Darby 5773945791 add data dir for .net in linux
make sparkcmd build in the right place on windows again
2019-11-11 17:12:55 -05:00
Kevin Darby 721c889235 release mode uses published sparkcmd 2019-11-06 18:22:06 -05:00
Kevin Darby 9957af655f hooked sparkcmd linux build to the main server build stuff 2019-11-06 17:47:21 -05:00
Kevin Darby eab92fb486 damn windows casing 2019-11-06 13:55:29 -05:00
Kevin Darby 9f1cd47cfa hooking build to cmake 2019-11-06 13:55:07 -05:00
Kevin Darby 90c3edbbe7 adding core 2 back to docker per eric 2019-11-06 13:24:57 -05:00
Kevin Darby adee8b584c capitalized first letter of proto to work around a protoc bug 2019-11-06 12:43:27 -05:00
Kevin Darby 329ad323e0 delete protos to change case on windows 2019-11-06 12:41:37 -05:00
Kevin Darby c713b97441 cleanup csproj 2019-11-05 18:23:09 -05:00
Kevin Darby eb79264b9b netcore builds on linux through dotnet build 2019-11-05 18:19:17 -05:00
113 changed files with 5705 additions and 308 deletions

No files matched your search

+1
View File
@@ -34,3 +34,4 @@ trace_data/
/doc/user/public/*
.ionide/*
/.ignore
CMakeDeps.cmake
+36 -6
View File
@@ -46,7 +46,7 @@
"sourceFileMap": {
"/home/bts/spark/": "${workspaceRoot}"
}
},
},
{
"name": "(gdb) Launch",
"type": "cppdbg",
@@ -111,6 +111,37 @@
"externalConsole": true,
"requireExactSource": false
},
{
"name": "Fix Launch",
"type": "clr",
"request": "launch",
"program": "${workspaceRoot}/build/Debug/bin/net471/sparkcmd.exe",
"args": [
"fix",
"--export_atdl_path",
"./atdl/",
"--export_single_file",
],
"cwd": "${workspaceRoot}/build/Debug/bin/net471/",
"stopAtEntry": false,
"externalConsole": true,
"requireExactSource": false
},
{
"name": "Fix Launch2",
"type": "clr",
"request": "launch",
"program": "${workspaceRoot}/build/Debug/bin/net471/sparkcmd.exe",
"args": [
"fix",
"--validate_atdl_path",
"./atdl/"
],
"cwd": "${workspaceRoot}/build/Debug/bin/net471/",
"stopAtEntry": false,
"externalConsole": true,
"requireExactSource": false
},
{
"name": "Client Tests",
"type": "clr",
@@ -345,12 +376,11 @@
"name": ".NET Core Remote Launch",
"type": "coreclr",
"request": "launch",
"program": "/usr/bin/dotnet",
"program": "sparkcmd",
"args": [
"sparkcmd.dll",
"test",
"test_join_create_and_takeout_market"
],
"env": {"LD_LIBRARY_PATH" : "."},
"stopAtEntry": false,
"cwd": "/home/bts/spark/build/ninja_debug/server",
"pipeTransport": {
@@ -361,11 +391,11 @@
"debuggerPath": "/home/bts/vsdbg/vsdbg",
"pipeCwd": "${workspaceRoot}",
"quoteArgs": true
},
},
"sourceFileMap": {
"/home/bts/spark/": "${workspaceRoot}"
},
"justMyCode": false
},
},
]
}
+11
View File
@@ -48,6 +48,7 @@ else ()
add_subdirectory(doc/user)
add_subdirectory(src/sdk)
add_subdirectory(src/data_files)
add_subdirectory(src/client)
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/server
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/server
@@ -59,7 +60,17 @@ else ()
COMMAND ln ARGS -sf ${EXTERNALS_ROOT}/lib/Release/libACE-5.7.5.so ${CMAKE_BINARY_DIR}/server
COMMAND mkdir ARGS -p ${CMAKE_BINARY_DIR}/server/plugins
COMMENT "Creating server runtime layout"
DEPENDS sparkd data_files_dir spark_client_dir
DEPENDS sparkd data_files_dir)
add_custom_target(server_layout ALL DEPENDS ${CMAKE_BINARY_DIR}/server)
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
add_custom_command(TARGET server_layout POST_BUILD
COMMAND ln -fs ${CMAKE_BINARY_DIR}/../${CMAKE_BUILD_TYPE}/bin/netcoreapp3.1/linux-x64/sparkcmd ${CMAKE_BINARY_DIR}/server/ )
else()
add_custom_command(TARGET server_layout POST_BUILD
COMMAND ln -fs ${CMAKE_BINARY_DIR}/../${CMAKE_BUILD_TYPE}/bin/netcoreapp3.1/linux-x64/publish/sparkcmd ${CMAKE_BINARY_DIR}/server/ )
endif()
endif()
@@ -71,12 +71,12 @@ The first step is to start the spark_sdk Docker container with the examples dire
Windows Command Prompt:
{% clipable() %}
docker run --rm -it -v %CD%:/examples -u bts -w /examples --shm-size 1024m --name spark_sdk -h spark_sdk --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -p 9000:9000 -p 9001:9001 spark_sdk bash
docker run --rm -it -v %CD%:/examples -u bts -w /examples --shm-size 2048m --name spark_sdk -h spark_sdk --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -p 9000:9000 -p 9001:9001 spark_sdk bash
{% end %}
**Powershell** / Linux / Mac:
{% clipable() %}
docker run --rm -it -v ${PWD}:/examples -u bts -w /examples --shm-size 1024m --name spark_sdk -h spark_sdk --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -p 9000:9000 -p 9001:9001 spark_sdk bash
docker run --rm -it -v ${PWD}:/examples -u bts -w /examples --shm-size 2048m --name spark_sdk -h spark_sdk --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -p 9000:9000 -p 9001:9001 spark_sdk bash
{% end %}
### Attach
+1 -1
View File
@@ -1 +1 @@
set(sources /home/ppinto/Dropbox/bts/spark/doc/user/build.sh;content/_index.md;content/bts_spark/Glossary/_index.md;content/bts_spark/Help/_index.md;content/bts_spark/Help/about_spark.png;content/bts_spark/Help/image39.png;content/bts_spark/Help/image58.png;content/bts_spark/Launcher/_index.md;content/bts_spark/Launcher/image38.png;content/bts_spark/Launcher/image68.png;content/bts_spark/Logging-In-to-the-System/_index.md;content/bts_spark/Logging-In-to-the-System/image3.png;content/bts_spark/Logging-In-to-the-System/image64.png;content/bts_spark/Market/_index.md;content/bts_spark/Market/change_securities.png;content/bts_spark/Market/image11.png;content/bts_spark/Market/image14.png;content/bts_spark/Market/image20.png;content/bts_spark/Market/image21.png;content/bts_spark/Market/image23.png;content/bts_spark/Market/image24.png;content/bts_spark/Market/image34.png;content/bts_spark/Market/image49.png;content/bts_spark/Market/image53.png;content/bts_spark/Market/image66.png;content/bts_spark/Market/image69.png;content/bts_spark/Market/market_view.png;content/bts_spark/Market/settings_icon.png;content/bts_spark/Market/time_and_sales.png;content/bts_spark/My-Windows/_index.md;content/bts_spark/My-Windows/image15.png;content/bts_spark/My-Windows/image16.png;content/bts_spark/My-Windows/image37.png;content/bts_spark/Settings/_index.md;content/bts_spark/Settings/image51.png;content/bts_spark/Settings/image9.png;content/bts_spark/Spreader/_index.md;content/bts_spark/Spreader/image10.png;content/bts_spark/Spreader/image13.png;content/bts_spark/Spreader/image18.png;content/bts_spark/Spreader/image19.png;content/bts_spark/Spreader/image28.png;content/bts_spark/Spreader/image29.png;content/bts_spark/Spreader/image31.png;content/bts_spark/Spreader/image35.png;content/bts_spark/Spreader/image40.png;content/bts_spark/Spreader/image43.png;content/bts_spark/Spreader/image54.png;content/bts_spark/Spreader/image55.png;content/bts_spark/Spreader/image56.png;content/bts_spark/Spreader/image6.png;content/bts_spark/Spreader/image7.png;content/bts_spark/Spreader/image70.png;content/bts_spark/Spreader/image72.png;content/bts_spark/Spreader/image8.png;content/bts_spark/Trading/OrderTypes/index.md;content/bts_spark/Trading/_index.md;content/bts_spark/Trading/algo_studio.png;content/bts_spark/Trading/collapse_all_icon.png;content/bts_spark/Trading/cover_algo_control.png;content/bts_spark/Trading/expand_all_icon.png;content/bts_spark/Trading/image1.png;content/bts_spark/Trading/image17.png;content/bts_spark/Trading/image2.png;content/bts_spark/Trading/image25.png;content/bts_spark/Trading/image27.png;content/bts_spark/Trading/image33.png;content/bts_spark/Trading/image42.png;content/bts_spark/Trading/image44.png;content/bts_spark/Trading/image47.png;content/bts_spark/Trading/image48.png;content/bts_spark/Trading/image5.png;content/bts_spark/Trading/image50.png;content/bts_spark/Trading/image52.png;content/bts_spark/Trading/image57.png;content/bts_spark/Trading/image59.png;content/bts_spark/Trading/image60.png;content/bts_spark/Trading/image61.png;content/bts_spark/Trading/image62.png;content/bts_spark/Trading/image73.png;content/bts_spark/Trading/image74.png;content/bts_spark/Trading/join_algo_control.png;content/bts_spark/Trading/ladder.png;content/bts_spark/Trading/ladder_badges.png;content/bts_spark/Trading/ladder_main_part.png;content/bts_spark/Trading/lean_algo_control.png;content/bts_spark/Trading/mini_orderbook.png;content/bts_spark/Trading/oco_algo_control.png;content/bts_spark/Trading/offset_algo_control.png;content/bts_spark/Trading/pnl_calculation.png;content/bts_spark/Trading/pnl_window.png;content/bts_spark/Trading/recreate_icon.png;content/bts_spark/Trading/settings_icon.png;content/bts_spark/Trading/spark_menu_order_book.png;content/bts_spark/Trading/top_algo_control.png;content/bts_spark/Trading/trigger_algo_control.png;content/bts_spark/_index.md;content/release_notes/_index.md;content/system_requirements/_index.md;static/book.js;static/favicon.ico;static/image.js;templates/index.html;templates/page.html;templates/section.html;templates/shortcodes/back_button.html)
set(sources /home/bts/spark/doc/user/build.sh;content/_index.md;content/bts_spark/Glossary/_index.md;content/bts_spark/Help/_index.md;content/bts_spark/Help/about_spark.png;content/bts_spark/Help/image39.png;content/bts_spark/Help/image58.png;content/bts_spark/Launcher/_index.md;content/bts_spark/Launcher/image38.png;content/bts_spark/Launcher/image68.png;content/bts_spark/Logging-In-to-the-System/_index.md;content/bts_spark/Logging-In-to-the-System/image3.png;content/bts_spark/Logging-In-to-the-System/image64.png;content/bts_spark/Market/_index.md;content/bts_spark/Market/change_securities.png;content/bts_spark/Market/image11.png;content/bts_spark/Market/image14.png;content/bts_spark/Market/image20.png;content/bts_spark/Market/image21.png;content/bts_spark/Market/image23.png;content/bts_spark/Market/image24.png;content/bts_spark/Market/image34.png;content/bts_spark/Market/image49.png;content/bts_spark/Market/image53.png;content/bts_spark/Market/image66.png;content/bts_spark/Market/image69.png;content/bts_spark/Market/market_view.png;content/bts_spark/Market/settings_icon.png;content/bts_spark/Market/time_and_sales.png;content/bts_spark/My-Windows/_index.md;content/bts_spark/My-Windows/image15.png;content/bts_spark/My-Windows/image16.png;content/bts_spark/My-Windows/image37.png;content/bts_spark/Settings/_index.md;content/bts_spark/Settings/image51.png;content/bts_spark/Settings/image9.png;content/bts_spark/Spreader/_index.md;content/bts_spark/Spreader/image10.png;content/bts_spark/Spreader/image13.png;content/bts_spark/Spreader/image18.png;content/bts_spark/Spreader/image19.png;content/bts_spark/Spreader/image28.png;content/bts_spark/Spreader/image29.png;content/bts_spark/Spreader/image31.png;content/bts_spark/Spreader/image35.png;content/bts_spark/Spreader/image40.png;content/bts_spark/Spreader/image43.png;content/bts_spark/Spreader/image54.png;content/bts_spark/Spreader/image55.png;content/bts_spark/Spreader/image56.png;content/bts_spark/Spreader/image6.png;content/bts_spark/Spreader/image7.png;content/bts_spark/Spreader/image70.png;content/bts_spark/Spreader/image72.png;content/bts_spark/Spreader/image8.png;content/bts_spark/Trading/OrderTypes/index.md;content/bts_spark/Trading/_index.md;content/bts_spark/Trading/algo_studio.png;content/bts_spark/Trading/collapse_all_icon.png;content/bts_spark/Trading/cover_algo_control.png;content/bts_spark/Trading/expand_all_icon.png;content/bts_spark/Trading/image1.png;content/bts_spark/Trading/image17.png;content/bts_spark/Trading/image2.png;content/bts_spark/Trading/image25.png;content/bts_spark/Trading/image27.png;content/bts_spark/Trading/image33.png;content/bts_spark/Trading/image42.png;content/bts_spark/Trading/image44.png;content/bts_spark/Trading/image47.png;content/bts_spark/Trading/image48.png;content/bts_spark/Trading/image5.png;content/bts_spark/Trading/image50.png;content/bts_spark/Trading/image52.png;content/bts_spark/Trading/image57.png;content/bts_spark/Trading/image59.png;content/bts_spark/Trading/image60.png;content/bts_spark/Trading/image61.png;content/bts_spark/Trading/image62.png;content/bts_spark/Trading/image73.png;content/bts_spark/Trading/image74.png;content/bts_spark/Trading/join_algo_control.png;content/bts_spark/Trading/ladder.png;content/bts_spark/Trading/ladder_badges.png;content/bts_spark/Trading/ladder_main_part.png;content/bts_spark/Trading/lean_algo_control.png;content/bts_spark/Trading/mini_orderbook.png;content/bts_spark/Trading/oco_algo_control.png;content/bts_spark/Trading/offset_algo_control.png;content/bts_spark/Trading/pnl_calculation.png;content/bts_spark/Trading/pnl_window.png;content/bts_spark/Trading/recreate_icon.png;content/bts_spark/Trading/settings_icon.png;content/bts_spark/Trading/spark_menu_order_book.png;content/bts_spark/Trading/top_algo_control.png;content/bts_spark/Trading/trigger_algo_control.png;content/bts_spark/_index.md;content/release_notes/_index.md;content/system_requirements/_index.md;static/book.js;static/favicon.ico;static/image.js;templates/index.html;templates/page.html;templates/section.html;templates/shortcodes/back_button.html)
+19
View File
@@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.5)
project(spark_client)
include(${CMAKE_SOURCE_DIR}/tools/safe_dep_glob.cmake)
file(GLOB_RECURSE spark_client_sources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cs)
file(GLOB_RECURSE spark_client_csproj RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.csproj)
file(GLOB_RECURSE spark_ui_sources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} spark/*.cs)
file(GLOB_RECURSE spark_ui_csproj RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} spark/*.csproj)
list(REMOVE_ITEM spark_ui_sources ${spark_client_sources} )
list(REMOVE_ITEM spark_ui_csproj ${spark_client_csproj} )
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/../
COMMAND /bin/bash ${CMAKE_CURRENT_SOURCE_DIR}/build_spark_dotnetcore.sh
ARGS ${CMAKE_BUILD_TYPE} ${CMAKE_BINARY_DIR}
COMMENT "Building sparkcmd in netcore3"
DEPENDS libspark ${spark_client_sources} ${spark_client_csproj} ${CMAKE_CURRENT_SOURCE_DIR}/build_spark_dotnetcore.sh)
add_custom_target(spark_client_dir ALL DEPENDS ${CMAKE_BINARY_DIR}/../)
@@ -5,6 +5,7 @@
<SparkRoot>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)\..\..))</SparkRoot>
<SourceRoot>$([System.IO.Path]::GetFullPath($(SparkRoot)\src))</SourceRoot>
<Externals>$(SparkRoot)\externals\windows</Externals>
<Externals Condition=" '$(OS)' != 'Windows_NT' ">$(SparkRoot)/externals/linux</Externals>
<DepotName>$([System.IO.Path]::GetFileName($([System.IO.Path]::GetFullPath($(SparkRoot)))))</DepotName>
<ErrorReport>None</ErrorReport>
<Prefer32Bit>False</Prefer32Bit>
@@ -19,20 +20,25 @@
<OutputPath>$(BaseOutputPath)\bin</OutputPath>
<BaseIntermediateOutputPath>$(BaseOutputPath)\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(BaseOutputPath)\obj\$(MSBuildProjectName)</IntermediateOutputPath>
<BaseIntermediateOutputPath Condition=" '$(OS)' != 'Windows_NT' ">$(BaseOutputPath)\linuxobj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<IntermediateOutputPath Condition=" '$(OS)' != 'Windows_NT' ">$(BaseOutputPath)\linuxobj\$(MSBuildProjectName)</IntermediateOutputPath>
<GenDir>$(BaseOutputPath)\gen\$(MSBuildProjectName)</GenDir>
</PropertyGroup>
<Import Project="$(ComputerSpecificConfig)" Condition="Exists($(ComputerSpecificConfig))" />
<ItemGroup>
<AvailableItemName Include="Proto2">
<Targets>CompileProto3</Targets>
<Targets Condition=" '$(OS)' == 'Windows_NT' " >CompileProto2</Targets>
<Targets Condition=" '$(OS)' != 'Windows_NT' " >CompileProto2Linux</Targets>
</AvailableItemName>
<AvailableItemName Include="Proto3">
<Targets>CompileProto3</Targets>
<Targets Condition=" '$(OS)' == 'Windows_NT' " >CompileProto3</Targets>
<Targets Condition=" '$(OS)' != 'Windows_NT' " >CompileProto3Linux</Targets>
</AvailableItemName>
<AvailableItemName Include="Proto3Excel">
<Targets>CompileProto3Excel</Targets>
<Targets Condition=" '$(OS)' == 'Windows_NT' ">CompileProto3Excel</Targets>
</AvailableItemName>
</ItemGroup>
@@ -43,6 +49,14 @@
<protogen>$(Externals)\bin\protogen.exe</protogen>
</PropertyGroup>
<PropertyGroup Label="ProtoBuf" Condition=" '$(OS)' != 'Windows_NT' ">
<ProtocPluginBase>$(SparkRoot)/src/lib/api/service_compiler</ProtocPluginBase>
<ProtoInclude>$(Externals)/include</ProtoInclude>
<protoc>$(Externals)/bin/protoc</protoc>
<protoc_rename>$(Externals)/bin/lowercase_files.sh</protoc_rename>
<protogen>$(Externals)/bin/protogen</protogen>
</PropertyGroup>
<ItemDefinitionGroup>
<Proto2>
</Proto2>
@@ -3,7 +3,7 @@
<Target Name="CompileProto2"
Condition="'@(Proto2)'!=''"
Condition="'@(Proto2)'!='' AND '$(OS)' == 'Windows_NT' "
Inputs="$(MSBuildProjectFile);$(protogen);%(Proto2.FullPath)"
Outputs="$(GenDir)\proto2\%(Proto2.filename).cs"
AfterTargets="PreBuildEvent">
@@ -28,7 +28,7 @@
passes wipes out the additional compile includes that we add.
-->
<Target Name="CompileProto3" AfterTargets="GetAssemblyVersion"
Condition="'@(Proto3)'!=''"
Condition="'@(Proto3)'!='' AND '$(OS)' == 'Windows_NT' "
Inputs="$(protoc);
%(Proto3.Identity);$(ProtocPluginBase)\plugin.py;
$(ProtocPluginBase)\templates\c#\client.pb.cs;
@@ -58,7 +58,7 @@
</Target>
<Target Name="CompileProto3Excel" AfterTargets="GetAssemblyVersion"
Condition="'@(Proto3Excel)'!=''"
Condition="'@(Proto3Excel)'!='' AND '$(OS)' == 'Windows_NT' "
Inputs="$(protoc);
%(Proto3Excel.Identity);$(ProtocPluginBase)\plugin.py;
$(ProtocPluginBase)\templates\excel\excel.pb.cs;"
@@ -82,12 +82,74 @@
</ItemGroup>
</Target>
<Target Name="CompileProto2Linux"
Condition="'@(Proto2)'!='' AND '$(OS)' != 'Windows_NT' "
Inputs="$(MSBuildProjectFile);$(protogen);%(Proto2.FullPath)"
Outputs="$(GenDir)/proto2/%(Proto2.filename).cs"
AfterTargets="PreBuildEvent">
<PropertyGroup>
<SourceRelativeFile>$([System.String]::Copy('%(proto2.fullpath)').Replace($(SourceRoot), ''))</SourceRelativeFile>
<SourceRelativeDir>$([System.IO.Path]::GetDirectoryName($(SourceRelativeFile)))</SourceRelativeDir>
<WorkingDirectory>$(GenDir)/proto2</WorkingDirectory>
</PropertyGroup>
<MakeDir Directories="$(WorkingDirectory)" />
<Copy SourceFiles="%(Proto2.FullPath)" DestinationFolder="$(WorkingDirectory)" SkipUnchangedFiles="True" UseHardLinksIfPossible="True" />
<Error Text="protogen.exe does not exist. If you forgot to clone with externals try: git submodule update --init --recursive" Condition="!Exists($(protogen))" />
<Message Importance="High" Text="Doing Proto2 %(proto2.filename)" />
<Exec Command="$(Protogen) %(Proto2.filename)%(proto2.extension) --csharp_out=. -I. -I$(SourceRoot) -I$(Externals)/include"
WorkingDirectory="$(WorkingDirectory)" />
<ItemGroup>
<Compile Include="$(WorkingDirectory)/%(Proto2.filename).cs" />
</ItemGroup>
</Target>
<Target Name="CompileProto3Linux" AfterTargets="GetAssemblyVersion"
Condition="'@(Proto3)'!='' AND '$(OS)' != 'Windows_NT' "
Inputs="$(protoc);
%(Proto3.Identity);$(ProtocPluginBase)/plugin.py;
$(ProtocPluginBase)/templates/c#/client.pb.cs;
$(ProtocPluginBase)/templates/c#/server.pb.cs;
$(ProtocPluginBase)/templates/c#/immutable.pb.cs;"
Outputs="%(Proto3.OutCS);%(Proto3.OutCSServer);%(Proto3.OutCSClient);%(Proto3.OutCSImmutable)">
<MakeDir Directories="%(Proto3.OutBase)" />
<MakeDir Directories="$(IntermediateOutputPath)/gen" />
<Message Importance="High" Text="Generating service %(Proto3.FileName)" />
<Exec Command="
PYTHONPATH=$(Externals)/python $(protoc) \
%(Proto3.FullPath) \
--error_format=gcc \
--proto_path=$(protoinc):$(SourceRoot) \
--plugin=&apos;protoc-gen-service=$(ProtocPluginBase)/plugin.py&apos; \
--service_out=lang=c#,strip_out_path=1:%(Proto3.OutBase) \
--csharp_out=%(CompileOptions)%(Proto3.OutBase)"
WorkingDirectory="%(relativedir)" />
<!-- <Exec Command="$(protoc_rename) %(Proto3.OutBase)" /> -->
<ItemGroup>
<Compile Include="%(Proto3.OutCS)" />
<Compile Include="%(Proto3.OutCSClient)" />
<Compile Include="%(Proto3.OutCSServer)" />
<Compile Include="%(Proto3.OutCSImmutable)" />
</ItemGroup>
</Target>
<!-- <Target Name="RenameProto3Linux" AfterTargets="CompileProto3Linux"
Condition="'@(Proto3)'!='' AND '$(OS)' != 'Windows_NT' ">
<Move SourceFiles="$(OutBase)\Apicore.cs" DestinationFiles="$(OutBase)\apicore.cs" />
<Move SourceFiles="$(OutBase)\Apioptions.cs" DestinationFiles="$(OutBase)\apioptions.cs" />
<Move SourceFiles="$(OutBase)\Co2.cs" DestinationFiles="$(OutBase)\co2.cs" />
</Target> -->
<Target Name="AfterClean" AfterTargets="Clean">
<Delete Files="%(Proto3.OutCS)" />
<Delete Files="%(Proto3.OutCSClient)" />
<Delete Files="%(Proto3.OutCSServer)" />
<Delete Files="%(Proto3.OutCSImmutable)" />
<Delete Files="$(GenDir)\proto2\*" />
<Delete Files="$(GenDir)/proto2/*" />
<Delete Files="%(Proto3Excel.OutCSExcel)" />
</Target>
+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash
#$1 = Debug / Release (CMAKE_BUILD_TYPE), $2 = CMAKE_BINARY_DIR
cd "$(dirname "$0")"
echo $PWD dotnet build -c $1 ./sparkcmd/
dotnet build -c $1 -o $2/../$1/bin/netcoreapp3.1/linux-x64 ./sparkcmd/
if [ "$1" == "Release" ]
then
dotnet publish -c $1 -o $2/../$1/bin/netcoreapp3.1/linux-x64 ./sparkcmd/
ln -fs $2/src/lib/libspark.so $2/../$1/bin/netcoreapp3.1/linux-x64/publish
fi
ln -fs $2/src/lib/libspark.so $2/../$1/bin/netcoreapp3.1/linux-x64
+21
View File
@@ -0,0 +1,21 @@
namespace bts.api
{
//keep in sync with apioptions.proto
public static partial class ApioptionsReflection
{
public enum MessageOptions
{
fix_algostrategy_tagbase = 8506,
}
public enum FieldOptions
{
fix_tag = 8507,
fix_tag_is_header = 8509,
skip_fix_tag = 8510,
}
public enum EnumValueOptions
{
fix_value = 8508,
}
}
}
+2
View File
@@ -0,0 +1,2 @@
dotnet pack
dotnet nuget push
@@ -63,6 +63,8 @@ namespace bts.api {
return security.Glbx.SecurityDesc;
else if(security.HasIce)
return security.Ice.SecurityDesc;
else if(security.HasSynthetic)
return security.Synthetic.Name;
else
{
Log.assert(false, "security_desc not implemented for exchange");
+1 -1
View File
@@ -25,7 +25,7 @@
<Proto3 Include="../../lib/api/*.proto" />
<Proto3 Include="../../lib/api/services/*.proto" />
<!--Proto3 Remove="../../lib/api/services/MarketDataRelay.proto" /-->
<Proto3 Include="../../lib/md/protos/co2.proto" />
<Proto3 Include="../../lib/md/protos/Co2.proto" />
<Proto3 Include="../../lib/domain_model/Security.proto" />
<Proto3 Include="../../lib/sparkproto/SparkProtos.proto" />
<Proto3 Update="../../lib/api/services/OutOfProcessURLListener.proto">
@@ -28,5 +28,8 @@ namespace bts.utils
[DllImport("libspark")]
public static extern bool initialize_nothrow(StringBuilder buffer, int length);
//public static string bts_data_path()
//use mbts.config.Configuration.get<bts.config.System>().data_path;
}
}
@@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using Google.Protobuf.WellKnownTypes;
namespace bts.api
{
public static class TimestampExtensions
{
public static Timestamp add_nanos(this Timestamp lhs, int nanos)
{
var c = new Timestamp(lhs);
c.Nanos += nanos;
return c;
}
public static bool less(this Timestamp lhs, Timestamp rhs)
{
return lhs.compare(rhs) < 0;
}
public static bool less_or_equal(this Timestamp lhs, Timestamp rhs)
{
return lhs.compare(rhs) <= 0;
}
public static bool greater(this Timestamp lhs, Timestamp rhs)
{
return lhs.compare(rhs) > 0;
}
public static bool greater_or_equal(this Timestamp lhs, Timestamp rhs)
{
return lhs.compare(rhs) >= 0;
}
public static int compare(this Timestamp lhs, Timestamp rhs)
{
int secdiff = lhs.Seconds.CompareTo(rhs.Seconds);
return (secdiff != 0) ? secdiff : (lhs.Nanos.CompareTo(rhs.Nanos));
}
public static Comparer<Timestamp> timestamp_comparer => Comparer<Timestamp>.Create((x, y) => x.compare(y));
public static Timestamp parse_timestamp(string data)
{
DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
try
{
if (data.Length <= 8)
{
dt = DateTime.ParseExact(data, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture);
}
else
{
int sep = 14;
var yyMMddhhmmss = data.Substring(0, sep);
dt = DateTime.ParseExact(yyMMddhhmmss, "yyyyMMddHHmmss", System.Globalization.CultureInfo.InvariantCulture);
var nnanos = data.Substring(sep, data.Length - sep);
long nano = long.Parse(nnanos);
dt = dt.AddTicks(nano / 100);
}
}
catch (Exception _)
{
System.Diagnostics.Debug.Assert(_ != null); //UNUSED(_)
}
dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc);
var ts = Google.Protobuf.WellKnownTypes.Timestamp.FromDateTime(dt);
return ts;
}
public static string to_fix_string(this Timestamp ts)
{
return ts.ToDateTime().ToString("yyyyMMdd-HH:mm:ss.fff");
}
}
}
+28
View File
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text.RegularExpressions;
namespace bts.api
{
public class TypeUtils
{
static public List<Type> find_all_types_in_all_assemblies(string type, string assembly_regex = null)
{
List<Type> res = new List<Type>();
var asses = AppDomain.CurrentDomain.GetAssemblies();
foreach (Assembly a in asses)
{
if (!string.IsNullOrEmpty(assembly_regex))
{
if (!Regex.Match(a.GetName().Name, assembly_regex).Success)
continue;
}
Type t = a.GetType(type, false, true);
if (t != null)
res.Add(t);
}
return res;
}
}
}
@@ -70,10 +70,13 @@ namespace bts.test {
psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;
psi.UseShellExecute = false;
try{
var p = Process.Start(psi);
p.WaitForExit((int)time_out.TotalMilliseconds);
var errorlevel = p.ExitCode;
string stdout = p.StandardOutput.ReadToEnd();
string stderr = p.StandardError.ReadToEnd();
if (p.HasExited) {
return 0;
}
+1 -1
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Platforms>x64</Platforms>
<PlatformTarget>AnyCPU</PlatformTarget>
+6 -4
View File
@@ -17,6 +17,8 @@ using bts.md;
using bts.api.admin;
using security_key = System.UInt32;
using QuickFix.FIX42;
using Message = QuickFix.Message;
namespace bts.fix
{
@@ -75,18 +77,18 @@ namespace bts.fix
public void send_session_reject(SessionID sess, string text, Message refmessage = null)
{
QuickFix.FIX44.Reject rej = null;
Reject rej = null;
if (refmessage != null && refmessage.Header.IsSetField(Tags.MsgSeqNum))
rej = new QuickFix.FIX44.Reject(new QuickFix.Fields.RefSeqNum(refmessage.Header.GetInt(Tags.MsgSeqNum)));
rej = new Reject(new QuickFix.Fields.RefSeqNum(refmessage.Header.GetInt(Tags.MsgSeqNum)));
else
rej = new QuickFix.FIX44.Reject();
rej = new Reject();
rej.Text = new Text(text);
send(rej, sess);
}
public void send_biz_reject(SessionID sess, string text, Message refmessage, int reason_code = 0)
{
QuickFix.FIX44.BusinessMessageReject rej = new QuickFix.FIX44.BusinessMessageReject();
BusinessMessageReject rej = new BusinessMessageReject();
rej.RefMsgType = new QuickFix.Fields.RefMsgType(refmessage.Header.GetString(Tags.MsgType));
rej.RefSeqNum = new QuickFix.Fields.RefSeqNum(refmessage.Header.GetInt(Tags.MsgSeqNum));
+6 -6
View File
@@ -81,12 +81,12 @@ namespace bts.fix
case "/resetSessions":
responseString = ResetSessions(request);
break;
case "/refreshSession":
responseString = RefreshSession(request);
break;
case "/refreshSessions":
responseString = RefreshSessions(request);
break;
// case "/refreshSession":
// responseString = RefreshSession(request);
// break;
// case "/refreshSessions":
// responseString = RefreshSessions(request);
// break;
case "/enableSessions":
responseString = EnableSessions(request);
break;
+298
View File
@@ -0,0 +1,298 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Google.Protobuf;
using Google.Protobuf.Reflection;
using System.Linq;
using Google.Protobuf.WellKnownTypes;
using bts.api;
namespace bts.fix
{
public static class ProtoFix
{
static readonly QuickFix.IMessageFactory _factory = new QuickFix.DefaultMessageFactory();
public static T parse_fix<T>(string fixstring) where T : IMessage, new()
{
return (T) parse_fix(new T().Descriptor, fixstring);
}
public static IMessage parse_fix(MessageDescriptor desc, string fixstring)
{
QuickFix.Message fix = new QuickFix.Message(fixstring, false);
var msg = create_message(desc, fix);
return msg;
}
static string get_between(string source, string start, string end)
{
int spos = source.IndexOf(start, 0);
if(spos < 0)
return string.Empty;
spos += start.Length;
int epos = source.IndexOf(end, spos);
if(epos < 0)
return string.Empty;
return source.Substring(spos, epos - spos);
}
public static Timestamp peek_timestamp(string fixstring, int field = 60)
{
string ts = get_between(fixstring, field.ToString() + "=", "\u0001");
if(!string.IsNullOrEmpty(ts))
{
var stamp = TimestampExtensions.parse_timestamp(ts);
return stamp;
}
return null;
}
public static string peek_field(string fixstring, int field)
{
string ts = get_between(fixstring, field.ToString() + "=", "\u0001");
return ts;
}
public static string peek_symbol(string fixstring)
{
return peek_field(fixstring, 55);
}
public static IMessage create_message(MessageDescriptor desc, QuickFix.FieldMap fix)
{
object obj = Activator.CreateInstance(desc.ClrType);
IMessage msg = (IMessage)obj;
return fix_to_imsg(msg, fix);
}
public static IMessage fix_to_imsg(IMessage msg, QuickFix.FieldMap fix)
{
foreach (var fd in msg.Descriptor.Fields.InDeclarationOrder())
{
try
{
set_field(msg, fd, fix);
}
catch(QuickFix.FieldNotFoundException) {}
}
return msg;
}
public static int get_tag(IMessage msg, FieldDescriptor fd, out bool is_header)
{
is_header = false;
int fieldnum = 0;
if(fd.CustomOptions?.TryGetInt32((int)ApioptionsReflection.FieldOptions.fix_tag, out fieldnum) ?? false)
{
fd.CustomOptions.TryGetBool((int)ApioptionsReflection.FieldOptions.fix_tag_is_header, out is_header);
return fieldnum;
}
else
{
int tagbase = 0;
if(msg.Descriptor.CustomOptions?.TryGetInt32((int)ApioptionsReflection.MessageOptions.fix_algostrategy_tagbase, out tagbase) ?? false)
{
bool skip = false;
fd.CustomOptions?.TryGetBool((int)ApioptionsReflection.FieldOptions.skip_fix_tag, out skip);
if(!skip)
return fd.FieldNumber + tagbase;
}
}
throw new QuickFix.FieldNotFoundException(fd.FieldNumber);
}
static void set_field(IMessage msg, FieldDescriptor fd, QuickFix.FieldMap fix)
{
switch (fd.FieldType)
{
case FieldType.Bool:
{
int tag = get_tag(msg, fd, out bool is_header);
var data = is_header ? ((QuickFix.Message)fix).Header.GetBoolean(tag) : fix.GetBoolean(tag);
fd.Accessor.SetValue(msg, data);
}
break;
case FieldType.Float:
{
int tag = get_tag(msg, fd, out bool is_header);
var data = is_header ? ((QuickFix.Message)fix).Header.GetDecimal(tag) : fix.GetDecimal(tag);
object conv = Convert.ChangeType(data, fd.Accessor.GetValue(msg).GetType());
fd.Accessor.SetValue(msg, conv);
}
break;
case FieldType.Double:
{
int tag = get_tag(msg, fd, out bool is_header);
var data = is_header ? ((QuickFix.Message)fix).Header.GetDecimal(tag) : fix.GetDecimal(tag);
double d = decimal.ToDouble(data);
fd.Accessor.SetValue(msg, d);
}
break;
case FieldType.Int32:
case FieldType.SInt32:
case FieldType.UInt32:
{
int tag = get_tag(msg, fd, out bool is_header);
var data = is_header ? ((QuickFix.Message)fix).Header.GetInt(tag) : fix.GetInt(tag);
object conv = Convert.ChangeType(data, fd.Accessor.GetValue(msg).GetType());
fd.Accessor.SetValue(msg, conv);
}
break;
case FieldType.Int64:
case FieldType.SInt64:
case FieldType.UInt64:
{
int tag = get_tag(msg, fd, out bool is_header);
try
{
var data = is_header ? ((QuickFix.Message)fix).Header.GetDecimal(tag) : fix.GetDecimal(tag);
object conv = Convert.ChangeType(data, fd.Accessor.GetValue(msg).GetType());
fd.Accessor.SetValue(msg, conv);
}
catch(Exception ex) when (ex is QuickFix.FieldConvertError || ex is FormatException)
{
try
{
var snot = fix.GetString(tag); //scientific notation apparently appears in the files
var data = Double.Parse(snot, System.Globalization.NumberStyles.Float);
object conv = Convert.ChangeType(data, fd.Accessor.GetValue(msg).GetType());
fd.Accessor.SetValue(msg, conv);
}
catch {}
}
}
break;
case FieldType.Enum:
{
EnumValueDescriptor val = find_enum_by_attribute(msg, fd, fix);
if(val == null)
{
int tag = get_tag(msg, fd, out bool is_header);
char data = is_header ? ((QuickFix.Message)fix).Header.GetChar(tag) : fix.GetChar(tag);
val = fd.EnumType.FindValueByNumber((int)data);
val = val ?? fd.EnumType.FindValueByNumber(0);
}
fd.Accessor.SetValue(msg, val.Number);
}
break;
case FieldType.String:
{
int tag = get_tag(msg, fd, out bool is_header);
var data = is_header ? ((QuickFix.Message)fix).Header.GetString(tag) : fix.GetString(tag);
fd.Accessor.SetValue(msg, data);
}
break;
case FieldType.Message:
{
handle_message(msg, fd, fix);
}
break;
default:
throw new NotSupportedException("unsupported field type " + fd.FieldType.ToString());
}
}
private static EnumValueDescriptor find_enum_by_attribute(IMessage msg, FieldDescriptor fd, QuickFix.FieldMap fix)
{
int tag = get_tag(msg, fd, out bool is_header);
var fval = is_header ? ((QuickFix.Message)fix).Header.GetString(tag) : fix.GetString(tag);
foreach(var val in fd.EnumType.Values)
{
string eval = null;
if(val.CustomOptions?.TryGetString((int)ApioptionsReflection.EnumValueOptions.fix_value, out eval) ?? false)
{
if(eval != null && eval == fval)
return val;
}
}
return null;
}
static void handle_timestamp(IMessage msg, FieldDescriptor fd, QuickFix.FieldMap fix)
{
int tag = get_tag(msg, fd, out bool is_header);
var data = is_header ? ((QuickFix.Message)fix).Header.GetString(tag) : fix.GetString(tag);
Timestamp ts = TimestampExtensions.parse_timestamp(data);
fd.Accessor.SetValue(msg, ts);
}
static void handle_quantitymeasure(IMessage msg, FieldDescriptor fd, QuickFix.FieldMap fix)
{
int tag = get_tag(msg, fd, out bool is_header);
var data = is_header ? ((QuickFix.Message)fix).Header.GetInt(tag) : fix.GetInt(tag);
var qm = new bts.spark.QuantityMeasure { Absolute = (uint) Math.Abs(data) };
fd.Accessor.SetValue(msg, qm);
}
static void handle_message(IMessage msg, FieldDescriptor fd, QuickFix.FieldMap fix)
{
if (fd.MessageType.ClrType == typeof(Google.Protobuf.WellKnownTypes.Timestamp))
{
handle_timestamp(msg, fd, fix);
}
else if(fd.MessageType.ClrType == typeof(bts.spark.QuantityMeasure))
{
handle_quantitymeasure(msg, fd, fix);
}
else if(fd.MessageType.ClrType == typeof(bts.api.orderman.CustomOrderDefinition))
{
return;
}
else
{
if (!fd.IsRepeated)
{
var submsg = create_message(fd.MessageType, fix);
fd.Accessor.SetValue(msg, submsg);
}
else //for repeating groups we assume that the fd.FieldNumber corresponds to the "no" (number) tag in the fix
{
int tag = get_tag(msg, fd, out bool is_header);
int group = tag;//fd.FieldNumber;
int nvals = fix.GetInt(group);
IList list = (IList)fd.Accessor.GetValue(msg);
if (nvals == 1)
{
var submsg = create_message(fd.MessageType, fix);
list.Add(submsg);
}
else
{
var delimproto = fd.MessageType.Fields.InDeclarationOrder()[0];
var delim = delimproto.FieldNumber;
List<QuickFix.Fields.IField> repeated = new List<QuickFix.Fields.IField>();
var forder = fix.RepeatedTags.Select(x => x.Tag).Distinct();
var dict = fix.ToDictionary();
foreach(int fo in forder)
{
if(dict.TryGetValue(fo, out QuickFix.Fields.IField field))
repeated.Add(field);
}
repeated.AddRange(fix.RepeatedTags);
QuickFix.FieldMap fm = null;
foreach (var rep in repeated)
{
if (rep.Tag == delim)
{
if (fm != null)
{
var submsg = create_message(fd.MessageType, fm);
list.Add(submsg);
}
fm = new QuickFix.FieldMap();
}
if (fm != null)
fm.SetField(rep);
} //the last one
if (fm != null && fm.Count() > 0)
{
var submsg = create_message(fd.MessageType, fm);
list.Add(submsg);
}
}
}
}
}
}
}
+508
View File
@@ -0,0 +1,508 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using bts.api.orderman;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Linq;
using Google.Protobuf;
using Google.Protobuf.Reflection;
using System.Globalization;
namespace bts.fix
{
public class ATDL
{
readonly SortedList<string, FIXAlgoDefinition> _atdl = new SortedList<string, FIXAlgoDefinition>();
public IReadOnlyDictionary<string, FIXAlgoDefinition> algo_definitions => _atdl;
public const string default_algo_import_path = "./spark_algos.json";
public const string default_atdl_export_file_name = "spark_algos.xml";
const string core_ns = "http://www.fixprotocol.org/FIXatdl-1-1/Core";
const string layout_ns = "http://www.fixprotocol.org/FIXatdl-1-1/Layout";
const string val_ns = "http://www.fixprotocol.org/FIXatdl-1-1/Validation";
const string flow_ns = "http://www.fixprotocol.org/FIXatdl-1-1/Flow";
const string tz_ns = "http://www.fixprotocol.org/FIXatdl-1-1/Timezones";
const string region_ns = "http://www.fixprotocol.org/FIXatdl-1-1/Regions";
readonly static Dictionary<Type, int> _algo_types = new Dictionary<Type, int>();
static ATDL()
{
foreach (var fd in CustomOrderDefinition.Descriptor.Fields.InDeclarationOrder())
{
if (fd.FieldType == FieldType.Message)
_algo_types[fd.MessageType.ClrType] = 0;
}
}
public ATDL(string path = default_algo_import_path)
{
path = path ?? default_algo_import_path;
using(var fs = new StreamReader(path))
{
var algos = JsonParser.Default.Parse<FIXAlgoDefinitions>(fs);
foreach(var algo in algos.AlgoStrategy)
{
_atdl[algo.Name] = algo;
}
}
}
static bool is_directory(string path)
{
FileAttributes attr = File.GetAttributes(path);
return attr.HasFlag(FileAttributes.Directory);
}
public static void validate_fix_atdl(string validate_atdl_path)
{
if(is_directory(validate_atdl_path))
{
string[] files = Directory.GetFiles(validate_atdl_path, "*.xml", SearchOption.AllDirectories);
foreach(var f in files)
valididate_single_atdl_file(f);
}
else
valididate_single_atdl_file(validate_atdl_path);
}
static void valididate_single_atdl_file(string path)
{
Log.assert(!is_directory(path));
var reader = new Atdl4net.Xml.StrategiesReader();
var strats = reader.Load(path);
foreach (var strat in strats)
{
Console.WriteLine("Strategy " + strat.Name);
Dictionary<int, string> tagname = new Dictionary<int, string>();
Dictionary<string, int> nametag = new Dictionary<string, int>();
foreach(var par in strat.Parameters)
{
tagname.Add((int)par.FixTag.Value, par.Name);
nametag.Add(par.Name, (int)par.FixTag.Value);
Console.WriteLine(" Parameter " + par.Name);
}
}
XmlSchemaSet schema = new XmlSchemaSet();
const string xsdpath = "./atdl/schema/";
schema.Add(core_ns, xsdpath + "fixatdl-core-1-1.xsd");
schema.Add(flow_ns, xsdpath + "fixatdl-flow-1-1.xsd");
schema.Add(layout_ns, xsdpath + "fixatdl-layout-1-1.xsd");
schema.Add(region_ns, xsdpath + "fixatdl-regions-1-1.xsd");
schema.Add(tz_ns, xsdpath + "fixatdl-timezones-1-1.xsd");
schema.Add(val_ns, xsdpath + "fixatdl-validation-1-1.xsd");
XmlReader rd = XmlReader.Create(path);
XDocument doc = XDocument.Load(rd, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
doc.Validate(schema, (object _, ValidationEventArgs e) =>
{
XmlSeverityType type = XmlSeverityType.Warning;
if (Enum.TryParse<XmlSeverityType>("Error", out type))
{
if (type == XmlSeverityType.Error) throw new Exception(e.Exception.ToString() +
"\n line number: " + e.Exception.LineNumber.ToString());
}
});
Console.WriteLine("File " + path + " looks valid ");
}
public void write_fix_atdl(string path, bool single_file)
{
if(single_file && is_directory(path))
{
Directory.CreateDirectory(path);
path = path + "/" + default_atdl_export_file_name;
}
if(single_file)
write_single_fix_atdl(path, _atdl.Values);
else
{
Log.assert(is_directory(path));
Directory.CreateDirectory(path);
foreach(var algo in _atdl.Values)
{
var fname = path + $"/Spark_{algo.Name}.xml";
write_single_fix_atdl(fname, new[]{algo});
}
}
}
static void write_single_fix_atdl(string path, IEnumerable<FIXAlgoDefinition> algos)
{
var s = new XmlWriterSettings();
s.Encoding = System.Text.Encoding.UTF8;
s.OmitXmlDeclaration = false;
s.Indent = true;
s.IndentChars = " ";
using(XmlWriter w = XmlWriter.Create(path, s))
{
w.WriteStartDocument();
w.WriteStartElement("Strategies", core_ns);
w.WriteAttributeString("xmlns", "", null, core_ns);
w.WriteAttributeString("xmlns", "val", null, val_ns);
w.WriteAttributeString("xmlns", "lay", null, layout_ns);
w.WriteAttributeString("xmlns", "flow", null, flow_ns);
w.WriteAttributeString("xmlns", "tz", null, tz_ns);
w.WriteAttributeString("xmlns", "xsi", null, "http://www.w3.org/2001/XMLSchema-instance");
w.WriteAttributeString("xsi", "schemaLocation", null, "http://www.fixprotocol.org/FIXatdl-1-1/Core fixatdl-core-1-1.xsd");
FIXAlgoDefinition.Descriptor.FindFieldByNumber(FIXAlgoDefinition.NameFieldNumber)
.CustomOptions.TryGetInt32((int)api.ApioptionsReflection.FieldOptions.fix_tag, out int nametag);
w.WriteAttributeString("strategyIdentifierTag", nametag.ToString());
FIXAlgoDefinition.Descriptor.FindFieldByNumber(FIXAlgoDefinition.VersionFieldNumber)
.CustomOptions.TryGetInt32((int)api.ApioptionsReflection.FieldOptions.fix_tag, out int vertag);
w.WriteAttributeString("versionIdentifierTag", vertag.ToString());
foreach(var strat in algos)
{
w.WriteStartElement("Strategy");
w.WriteAttributeString("name", strat.Name);
w.WriteAttributeString("uiRep", strat.Name);
w.WriteAttributeString("wireValue", strat.Name);
string ver = strat.Version;
if(string.IsNullOrEmpty(ver))
ver = "1";
w.WriteAttributeString("version", ver);
w.WriteAttributeString("fixMsgType", "D");
w.WriteAttributeString("providerID", "BTS");
{
w.WriteStartElement("Regions");
w.WriteStartElement("Region");
w.WriteAttributeString("name", "TheAmericas");
w.WriteAttributeString("inclusion", "Include");
w.WriteStartElement("Country");
w.WriteAttributeString("CountryCode", "US");
w.WriteAttributeString("inclusion", "Include");
w.WriteEndElement();
w.WriteEndElement();
w.WriteEndElement();
}
{
w.WriteStartElement("Markets");
w.WriteStartElement("Market");
w.WriteAttributeString("MICCode", "XCME");
w.WriteAttributeString("inclusion", "Include");
w.WriteEndElement();
w.WriteEndElement();
}
{
w.WriteStartElement("SecurityTypes");
w.WriteStartElement("SecurityType");
w.WriteAttributeString("name", "FUT");
w.WriteAttributeString("inclusion", "Include");
w.WriteEndElement();
w.WriteEndElement();
}
var imsg = extract_order_from_custom(strat.Definition);
visit_parameters(w, imsg);
visit_layout(w, imsg);
w.WriteEndElement();
}
}
}
static bool get_tag_and_name(IMessage m, FieldDescriptor fd, FieldDescriptor parent_fd,
Dictionary<int, int> tags, Dictionary<string, int> names,
out int tag, out string fieldname)
{
tag = ProtoFix.get_tag(m, fd, out bool is_header);
fieldname = fd.Name;
if (fd.FieldType == FieldType.Message && fd.MessageType.ClrType == typeof(bts.api.orderman.CustomOrderDefinition))
{
return false;
}
//TODO the concept of the collision due to using the same order type in different places in tree isn't great
if (tags.ContainsKey(tag))
return false;
tags[tag] = 0;
if (names.ContainsKey(fieldname))
{
if (parent_fd != null)
{
fieldname = parent_fd.Name + "_" + fieldname;
if (names.ContainsKey(fieldname))
return false;
}
else
return false;
}
names[fieldname] = 0;
//TODO the concept of the collision due to using the same order type in different places in tree isn't great
return true;
}
static void visit_parameters(XmlWriter w, IMessage imsg)
{
Dictionary<int, int> tags = new Dictionary<int, int>();
Dictionary<string, int> names = new Dictionary<string, int>();
message_visitor(imsg, (m, fd, parent_fd) =>
{
try
{
if(!get_tag_and_name(m, fd, parent_fd, tags, names, out int tag, out string fieldname))
return;
w.WriteStartElement("Parameter");
w.WriteAttributeString("name", fieldname);
w.WriteAttributeString("fixTag", tag.ToString());
if (fd.FieldType == FieldType.Message && fd.MessageType.ClrType == typeof(Google.Protobuf.WellKnownTypes.Timestamp))
{
w.WriteAttributeString("xsi", "type", null, "UTCTimestamp_t");
w.WriteAttributeString("localMktTz", "America/New_York");
}
else if (fd.FieldType == FieldType.Message && fd.MessageType.ClrType == typeof(bts.spark.QuantityMeasure))
{
w.WriteAttributeString("xsi", "type", null, "Int_t");
w.WriteAttributeString("minValue", "0");
}
else if (fd.FieldType == FieldType.Enum)
{
w.WriteAttributeString("xsi", "type", null, "Char_t");
foreach (var val in fd.EnumType.Values)
{
string eval = null;
if (val.CustomOptions?.TryGetString((int)bts.api.ApioptionsReflection.EnumValueOptions.fix_value, out eval) ?? false)
{
w.WriteStartElement("EnumPair");
w.WriteAttributeString("enumID", val.Name);
w.WriteAttributeString("wireValue", eval);
w.WriteEndElement();
}
}
}
else if (fd.FieldType == FieldType.Int32)
{
w.WriteAttributeString("xsi", "type", null, "Int_t");
}
else if (fd.FieldType == FieldType.Double || fd.FieldType == FieldType.Float)
{
w.WriteAttributeString("xsi", "type", null, "Float_t");
}
else if (fd.FieldType == FieldType.UInt32)
{
w.WriteAttributeString("xsi", "type", null, "Int_t");
w.WriteAttributeString("minValue", "0");
}
else if( fd.FieldType == FieldType.Bool)
{
w.WriteAttributeString("xsi", "type", null, "Boolean_t");
}
else
{
w.WriteAttributeString("xsi", "type", null, "String_t");
}
w.WriteEndElement();
}
catch (QuickFix.FieldNotFoundException) { }
});
}
static string title_case(string title, bool insert_spaces = true)
{
var s = new CultureInfo("en").TextInfo.ToTitleCase(title.ToLower().Replace("_", " "));
if(!insert_spaces)
return s.Replace(" ", "");
else
return s;
}
static void visit_layout(XmlWriter w, IMessage imsg)
{
w.WriteStartElement("lay", "StrategyLayout", layout_ns);
w.WriteStartElement("lay", "StrategyPanel", layout_ns);
w.WriteAttributeString("orientation", "HORIZONTAL");
int msgcount = 0;
Dictionary<int, int> tags = new Dictionary<int, int>();
Dictionary<string, int> names = new Dictionary<string, int>();
Type mtype = null;
message_visitor(imsg, (m, fd, parent_fd) =>
{
try
{
if (!get_tag_and_name(m, fd, parent_fd, tags, names, out int tag, out string fieldname))
return;
if ( _algo_types.ContainsKey( m.GetType() ) && (mtype == null || m.GetType() != mtype))
{
if(msgcount > 0)
{
w.WriteEndElement();
msgcount--;
}
w.WriteStartElement("lay", "StrategyPanel", layout_ns);
w.WriteAttributeString("orientation", "VERTICAL");
msgcount++;
mtype = m.GetType();
}
w.WriteStartElement("lay", "Control", layout_ns);
w.WriteAttributeString("ID", fieldname + "_ID");
var label = title_case(fieldname);
w.WriteAttributeString("label", label);
w.WriteAttributeString("parameterRef", fieldname);
if (fd.FieldType == FieldType.Message && fd.MessageType.ClrType == typeof(Google.Protobuf.WellKnownTypes.Timestamp))
{
w.WriteAttributeString("xsi", "type", null, "lay:Clock_t");
w.WriteAttributeString("localMktTz", "America/New_York");
}
else if (fd.FieldType == FieldType.Message && fd.MessageType.ClrType == typeof(bts.spark.QuantityMeasure))
{
w.WriteAttributeString("xsi", "type", null, "lay:SingleSpinner_t");
w.WriteAttributeString("initValue", "0");
}
else if (fd.FieldType == FieldType.Enum)
{
w.WriteAttributeString("xsi", "type", null, "lay:DropDownList_t");
w.WriteAttributeString("initValue", fd.EnumType.Values.First().Name);
foreach (var val in fd.EnumType.Values)
{
string eval = null;
if (val.CustomOptions?.TryGetString((int)bts.api.ApioptionsReflection.EnumValueOptions.fix_value, out eval) ?? false)
{
w.WriteStartElement("lay", "ListItem", layout_ns);
w.WriteAttributeString("enumID", val.Name);
w.WriteAttributeString("uiRep", val.Name);
w.WriteEndElement();
}
}
}
else if (fd.FieldType == FieldType.Int32)
{
w.WriteAttributeString("xsi", "type", null, "lay:SingleSpinner_t");
w.WriteAttributeString("initValue", "0");
}
else if (fd.FieldType == FieldType.Double || fd.FieldType == FieldType.Float)
{
if(m.Descriptor.ClrType == typeof(IcebergOrderDefinition))
w.WriteAttributeString("xsi", "type", null, "lay:SingleSpinner_t");
else
w.WriteAttributeString("xsi", "type", null, "lay:DoubleSpinner_t");
w.WriteAttributeString("initValue", "0");
}
else if (fd.FieldType == FieldType.UInt32)
{
w.WriteAttributeString("xsi", "type", null, "lay:SingleSpinner_t");
w.WriteAttributeString("initValue", "0");
}
else if (fd.FieldType == FieldType.Bool)
{
w.WriteAttributeString("xsi", "type", null, "lay:CheckBox_t");
w.WriteAttributeString("initValue", "false");
}
else
{
w.WriteAttributeString("xsi", "type", null, "lay:TextField_t");
}
w.WriteEndElement();
}
catch (QuickFix.FieldNotFoundException) { }
});
for(int i = 0; i < msgcount; i++)
w.WriteEndElement();
w.WriteEndElement();
w.WriteEndElement();
}
public static void write_json(FIXAlgoDefinitions defs, string path)
{
using (var fs = new StreamWriter(path))
{
var s = JsonFormatter.Settings.Default;
var raw = JsonFormatter.Default.Format(defs);
object parsed = Newtonsoft.Json.JsonConvert.DeserializeObject(raw);
string indented = Newtonsoft.Json.JsonConvert.SerializeObject(parsed, Newtonsoft.Json.Formatting.Indented);
fs.Write(indented);
}
}
public static IMessage message_visitor(IMessage msg, Action<IMessage, FieldDescriptor, FieldDescriptor> visitor, FieldDescriptor parent = null)
{
var memb = msg.Descriptor.Fields.InDeclarationOrder().ToList();
memb = memb.OrderBy(x => (int)x.FieldType).ToList();
List<FieldDescriptor> subs = new List<FieldDescriptor>();
foreach (var fd in memb)
{
if (fd.FieldType == FieldType.Message)
subs.Add(fd);
visitor(msg, fd, parent);
}
foreach(var fd in subs)
{
bool custom = msg.Descriptor.ClrType == typeof(bts.api.orderman.CustomOrderDefinition);
var submsg = fd.Accessor.GetValue(msg);
if (submsg != null)
message_visitor((IMessage)submsg, visitor, custom ? parent : fd);
}
return msg;
}
public static IMessage extract_order_from_custom(CustomOrderDefinition custom)
{
foreach (var fd in CustomOrderDefinition.Descriptor.Fields.InDeclarationOrder())
{
var val = fd.Accessor.GetValue(custom);
if (val != null && val is IMessage valmsg)
return valmsg;
}
Log.assert(false, "can't find non-null member of CustomOrderDefintion");
return null;
}
#region write sample file
public static void write_sample_json(string path = "./spark_algos.json")
{
FIXAlgoDefinition tc = new FIXAlgoDefinition()
{
Name = "TickAndCover",
Definition = new CustomOrderDefinition
{
Cover = new CoverOrderDefinition
{
Child = new CustomOrderDefinition
{
Top = new TopOrderDefinition { Child = new CustomOrderDefinition { Limit = new LimitOrderDefinition() } }
},
Hedge = new CustomOrderDefinition
{
Lean = new LeanOrderDefinition { Child = new CustomOrderDefinition { Limit = new LimitOrderDefinition() } }
}
}
}
};
FIXAlgoDefinition sc = new FIXAlgoDefinition()
{
Name = "SmashAndCover",
Definition = new CustomOrderDefinition
{
Cover = new CoverOrderDefinition
{
Child = new CustomOrderDefinition
{
Lean = new LeanOrderDefinition{ Child = new CustomOrderDefinition { Limit = new LimitOrderDefinition() } }
},
Hedge = new CustomOrderDefinition
{
Lean = new LeanOrderDefinition { Child = new CustomOrderDefinition { Limit = new LimitOrderDefinition() } }
}
}
}
};
FIXAlgoDefinitions defs = new FIXAlgoDefinitions();
defs.AlgoStrategy.Add(tc);
defs.AlgoStrategy.Add(sc);
write_json(defs, path);
}
}
#endregion
}
@@ -0,0 +1 @@
(C) 2010 FIX Protocol Limited. All use of the FIXatdl Schema is subject to the disclaimer which is printed on one of the initial pages of the written specification for the FIXatdl Schema and is included in the zip file which you downloaded to obtain the Schema.
@@ -0,0 +1,219 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
- - - - - - - - - - - - - - - - - - - - - - - - - -
FIXatdl Sample document instance for FIXatdl Schema Version 1.1
(C) 2010 FIX Protocol Limited. All use of the FIXatdl Schema is subject to
the disclaimer which is printed on one of the initial pages of the written specification
for the FIXatdl Schema and is included in the zip file which you downloaded to
obtain the Schema.
Comments and errors should be posted on the FIX protocol web-site
http://www.fixprotocol.org
- - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<Strategies xmlns="http://www.fixprotocol.org/FIXatdl-1-1/Core" xmlns:val="http://www.fixprotocol.org/FIXatdl-1-1/Validation" xmlns:lay="http://www.fixprotocol.org/FIXatdl-1-1/Layout" xmlns:flow="http://www.fixprotocol.org/FIXatdl-1-1/Flow" xmlns:tz="http://www.fixprotocol.org/FIXatdl-1-1/Timezones" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.fixprotocol.org/FIXatdl-1-1/Core fixatdl-core-1-1.xsd" strategyIdentifierTag="7620" versionIdentifierTag="7621">
<!-- ************************ -->
<!-- ******* Tazer 1 ******** -->
<!-- ************************ -->
<Strategy name="Tazer1" uiRep="Tazer" wireValue="Tazer" version="1" fixMsgType="D" providerID="ABC">
<!-- US only -->
<Regions>
<Region name="TheAmericas" inclusion="Include">
<Country CountryCode="US" inclusion="Include"/>
</Region>
</Regions>
<!-- Nasdaq only -->
<Markets>
<Market MICCode="XNAS" inclusion="Include"/>
</Markets>
<!-- Equities ("CS") only -->
<SecurityTypes>
<SecurityType name="CS" inclusion="Include"/>
</SecurityTypes>
<!-- Parameter Section -->
<Parameter name="StartTime" xsi:type="UTCTimestamp_t" fixTag="7602" use="required">
<Description>Strategy Start Time</Description>
</Parameter>
<Parameter name="EndTime" xsi:type="UTCTimestamp_t" fixTag="7603" use="required" maxValue="16:00:00" localMktTz="America/New_York">
<Description>Strategy End Time</Description>
</Parameter>
<Parameter name="Text" xsi:type="String_t" fixTag="9999" use="optional"/>
<Parameter name="SweepDistribution" xsi:type="Char_t" fixTag="7640" use="required">
<EnumPair enumID="e_Uniform" wireValue="U">
<Description>The 'Uniform' setting for Sweep Distribution</Description>
</EnumPair>
<EnumPair enumID="e_Gaussian" wireValue="G">
<Description>The 'Gaussian' setting for Sweep Distribution</Description>
</EnumPair>
</Parameter>
<Parameter name="Variance" xsi:type="Float_t" fixTag="7641" use="optional" minValue="0.01" maxValue="0.50"/>
<Parameter name="DisplayQty" xsi:type="Int_t" fixTag="7645" use="optional" minValue="0"/>
<!-- Layout Section -->
<lay:StrategyLayout>
<lay:StrategyPanel orientation="VERTICAL" collapsible="false">
<lay:StrategyPanel orientation="HORIZONTAL" collapsible="false">
<lay:Control xsi:type="lay:Clock_t" ID="StartTimeClock" label="Start Time" parameterRef="StartTime" initValue="09:30:00" initValueMode="1" localMktTz="America/New_York"/>
<lay:Control xsi:type="lay:Clock_t" ID="EndTimeClock" label="End Time" parameterRef="EndTime" initValue="16:00:00" localMktTz="America/New_York"/>
<lay:Control ID="m_dq" xsi:type="lay:DropDownList_t" label="Display Qty Handling">
<lay:ListItem enumID="choice1" uiRep="Send nothing"/>
<lay:ListItem enumID="choice2" uiRep="Send 0"/>
<lay:ListItem enumID="choice3" uiRep="Send what user enters"/>
</lay:Control>
<lay:Control xsi:type="lay:TextField_t" ID="DisplayQuantity" label="Display Quantity" parameterRef="DisplayQty">
<!-- for "choice1" Control is still displayed however it appears disabled and is set to a null value (will not be transmitted over the wire) -->
<!-- for "choice2" Control is set to value "0" and is disabled (read-only) but will be transmitted over the wire -->
<flow:StateRule enabled="false">
<val:Edit logicOperator="OR">
<val:Edit field="m_dq" operator="EQ" value="choice1"/>
<val:Edit field="m_dq" operator="EQ" value="choice2"/>
</val:Edit>
</flow:StateRule>
<flow:StateRule visible="false">
<val:Edit field="m_dq" operator="EQ" value="choice1"/>
</flow:StateRule>
<flow:StateRule value="{NULL}">
<val:Edit field="m_dq" operator="EQ" value="choice1"/>
</flow:StateRule>
<flow:StateRule value="0">
<Description>Display Quantity should be set to 0 if Display Qty Handling is set to 'choice2'</Description>
<val:Edit field="m_dq" operator="EQ" value="choice2"/>
</flow:StateRule>
</lay:Control>
</lay:StrategyPanel>
<lay:StrategyPanel orientation="HORIZONTAL" collapsible="false">
<lay:Control ID="m_sd" xsi:type="lay:DropDownList_t" label="Sweep Distribution" parameterRef="SweepDistribution" initValue="e_Uniform">
<lay:ListItem enumID="e_Uniform" uiRep="Uniform"/>
<lay:ListItem enumID="e_Gaussian" uiRep="Gaussian"/>
</lay:Control>
<lay:Control xsi:type="lay:TextField_t" ID="Variance" label="Variance" parameterRef="Variance">
<!-- Control is still displayed however it appears disabled and is set to a null value (will not be transmitted over the wire) -->
<flow:StateRule enabled="false" value="{NULL}">
<val:Edit field="m_sd" operator="EQ" value="e_Uniform"/>
</flow:StateRule>
</lay:Control>
</lay:StrategyPanel>
</lay:StrategyPanel>
</lay:StrategyLayout>
<!-- Validation Section -->
<val:StrategyEdit errorMessage="End Time should be later than Start Time">
<val:Edit field="EndTime" operator="GT" field2="StartTime"/>
</val:StrategyEdit>
<val:StrategyEdit errorMessage="Variance is required when Sweep Distribution is Gaussian.">
<val:Edit logicOperator="OR">
<val:Edit field="SweepDistribution" operator="NE" value="G"/>
<val:Edit logicOperator="AND">
<val:Edit field="SweepDistribution" operator="EQ" value="G"/>
<val:Edit field="Variance" operator="EX"/>
</val:Edit>
</val:Edit>
</val:StrategyEdit>
<val:StrategyEdit errorMessage="Variance must be between 0 and 2.0">
<val:Edit logicOperator="OR">
<val:Edit field="SweepDistribution" operator="NE" value="G"/>
<val:Edit logicOperator="AND">
<val:Edit field="SweepDistribution" operator="EQ" value="G"/>
<val:Edit field="Variance" operator="EX"/>
<val:Edit field="Variance" operator="GT" value="0.0"/>
<val:Edit field="Variance" operator="LT" value="2.0"/>
</val:Edit>
</val:Edit>
</val:StrategyEdit>
</Strategy>
<Strategy name="OPLX" uiRep="Get Done" wireValue="60" version="2.0" fixMsgType="D">
<!-- Americas region only -->
<Regions>
<Region name="TheAmericas" inclusion="Include"/>
</Regions>
<!-- Security types other than Futures ("FUT") -->
<SecurityTypes>
<SecurityType name="FUT" inclusion="Exclude"/>
</SecurityTypes>
<Parameter name="StartTime" xsi:type="UTCTimestamp_t" fixTag="6168" use="optional"/>
<Parameter name="EndTime" xsi:type="UTCTimestamp_t" fixTag="126" use="optional"/>
<Parameter name="AgencyOnly" xsi:type="Int_t" fixTag="81" use="required">
<EnumPair wireValue="1" enumID="Yes"/>
<EnumPair wireValue="0" enumID="No"/>
</Parameter>
<Parameter name="Aggression" xsi:type="Char_t" fixTag="6408" use="optional">
<EnumPair enumID="e_Low" wireValue="L"/>
<EnumPair enumID="e_Medium" wireValue="S"/>
<EnumPair enumID="e_High" wireValue="H"/>
</Parameter>
<Parameter name="DisplaySize" xsi:type="Qty_t" fixTag="111" use="optional" minValue="0"/>
<lay:StrategyLayout>
<lay:StrategyPanel collapsible="false" orientation="HORIZONTAL">
<lay:StrategyPanel collapsible="false" orientation="VERTICAL">
<lay:Control ID="Aggression" xsi:type="lay:DropDownList_t" label="Aggression" initValue="e_Medium" parameterRef="Aggression">
<lay:ListItem enumID="e_Low" uiRep="Low"/>
<lay:ListItem enumID="e_Medium" uiRep="Medium"/>
<lay:ListItem enumID="e_High" uiRep="High"/>
</lay:Control>
<!-- Posting is a 'helper control' and not associated with a specific Parameter -->
<lay:Control ID="Posting" xsi:type="lay:DropDownList_t" label="Posting/Iceberg" initValue="e_SMART">
<lay:ListItem enumID="e_SMART" uiRep="SMART"/>
<lay:ListItem enumID="e_NOPOST" uiRep="NOPOST"/>
<lay:ListItem enumID="e_Custom" uiRep="Custom"/>
</lay:Control>
<lay:Control ID="DisplaySize" xsi:type="lay:SingleSpinner_t" label="Display Size" incrementPolicy="LotSize" parameterRef="DisplaySize">
<!-- e_SMART will be null (do not transmit over wire) and not visible nor enabled -->
<!-- e_NOPOST will be set to 0, visible, and disabled (read-only) - (non-null thus transmitted over the wire) -->
<!-- e_Custom will be non-null, visible, and enabled -->
<flow:StateRule visible="true">
<val:Edit logicOperator="OR">
<val:Edit field="Posting" operator="EQ" value="e_Custom"/>
<val:Edit field="Posting" operator="EQ" value="e_NOPOST"/>
</val:Edit>
</flow:StateRule>
<flow:StateRule enabled="true">
<val:Edit field="Posting" operator="EQ" value="e_Custom"/>
</flow:StateRule>
<flow:StateRule value="{NULL}">
<val:Edit field="Posting" operator="EQ" value="e_SMART"/>
</flow:StateRule>
<flow:StateRule value="0">
<val:Edit field="Posting" operator="EQ" value="e_NOPOST"/>
</flow:StateRule>
</lay:Control>
</lay:StrategyPanel>
<lay:StrategyPanel collapsible="false" orientation="VERTICAL">
<!-- StartTime and EndTime need a 'helper control' to support the fact that it is optional (also had to warp AgencyOnly with StrategyPanel as a given StrategyPanel can include only Control or StrategyPanel elements, but not both) -->
<lay:StrategyPanel collapsible="false" orientation="HORIZONTAL">
<lay:Control ID="c_EnableStartTime" xsi:type="lay:CheckBox_t" label="Start Time" initValue="false"/>
<lay:Control ID="StartTime" xsi:type="lay:Clock_t" label="" parameterRef="StartTime">
<flow:StateRule enabled="false" value="{NULL}">
<val:Edit field="c_EnableStartTime" operator="EQ" value="false"/>
</flow:StateRule>
</lay:Control>
</lay:StrategyPanel>
<lay:StrategyPanel collapsible="false" orientation="HORIZONTAL">
<lay:Control ID="c_EnableEndTime" xsi:type="lay:CheckBox_t" label="End Time" initValue="false"/>
<lay:Control ID="EndTime" xsi:type="lay:Clock_t" label="" initValue="16:00:00" localMktTz="America/New_York" parameterRef="EndTime">
<flow:StateRule enabled="false" value="{NULL}">
<val:Edit field="c_EnableEndTime" operator="EQ" value="false"/>
</flow:StateRule>
</lay:Control>
</lay:StrategyPanel>
<lay:StrategyPanel collapsible="false" orientation="HORIZONTAL">
<lay:Control ID="AgencyOnly" xsi:type="lay:DropDownList_t" label="Agency Only" initValue="No" parameterRef="AgencyOnly">
<lay:ListItem enumID="Yes" uiRep="Yes"/>
<lay:ListItem enumID="No" uiRep="No"/>
</lay:Control>
</lay:StrategyPanel>
</lay:StrategyPanel>
</lay:StrategyPanel>
</lay:StrategyLayout>
<val:StrategyEdit errorMessage="Start time must be less than end time.">
<!-- Note that "OR" "NX" checks are required as StartTime and EndTime Parameters are marked use="optional" -->
<val:Edit logicOperator="OR">
<val:Edit field="StartTime" operator="NX"/>
<val:Edit field="EndTime" operator="NX"/>
<val:Edit field="EndTime" operator="GT" field2="StartTime"/>
</val:Edit>
</val:StrategyEdit>
<val:StrategyEdit errorMessage="Display Size cannot be greater than Order Qty">
<val:Edit logicOperator="OR">
<val:Edit field="DisplaySize" operator="NX"/>
<val:Edit field="DisplaySize" operator="LE" field2="FIX_OrderQty"/>
</val:Edit>
</val:StrategyEdit>
</Strategy>
</Strategies>
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- - - - - - - - - - - - - - - - - - - - - - - - - -
FIXatdl Sample document instance for FIXatdl Schema Version 1.1
(C) 2010 FIX Protocol Limited. All use of the FIXatdl Schema is subject to
the disclaimer which is printed on one of the initial pages of the written specification
for the FIXatdl Schema and is included in the zip file which you downloaded to
obtain the Schema.
Comments and errors should be posted on the FIX protocol web-site
http://www.fixprotocol.org
- - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:flow="http://www.fixprotocol.org/FIXatdl-1-1/Flow" xmlns:val="http://www.fixprotocol.org/FIXatdl-1-1/Validation" xmlns:core="http://www.fixprotocol.org/FIXatdl-1-1/Core" targetNamespace="http://www.fixprotocol.org/FIXatdl-1-1/Flow" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.1">
<xs:annotation>
<xs:documentation>
This value is the internal build number of the ATDL Schema
</xs:documentation>
<xs:appinfo>
<BuildInfo buildNumber="2.7.2e20101221"/>
</xs:appinfo>
</xs:annotation>
<xs:import namespace="http://www.fixprotocol.org/FIXatdl-1-1/Validation" schemaLocation="fixatdl-validation-1-1.xsd"/>
<xs:import namespace="http://www.fixprotocol.org/FIXatdl-1-1/Core" schemaLocation="fixatdl-core-1-1.xsd"/>
<!-- Please email any suggestions or revisions to algotech@fixprotocol.org-->
<!-- Please note - Revision history is at the end of this xsd
Flow Sub-Schema
The intent of the flow sub-schema is to provide an easy, platform-neutral way to specify the interaction
of controls defined by the UI sub-schema. StateRules elements define the behavior of the control, while
Edit elements define how the rule should be executed based on how they evaluate.-->
<xs:element name="StateRule" type="flow:StateRule_t"/>
<xs:complexType name="StateRule_t">
<xs:sequence>
<xs:element ref="core:Description" minOccurs="0">
<xs:annotation>
<xs:documentation>Description of the State Rule.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:choice>
<xs:element ref="val:Edit"/>
<xs:element ref="val:EditRef"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="enabled" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>Indicates whether or not to enable the control when the edit expression of the strategyEdit element evaluates to True.
The desired behavior is as follows:
when the StateRule’s edit condition is true and enabled=True then enable the control;
when the edit condition is true and enabled=false then disable the control;
when the edit condition is false and enable=True then disable the control;
when the edit condition is false and enabled=false then enable the control.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="visible" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>Indicates whether or not to show the control when the boolean expression, defined by the Edit element, evaluates to True.
The desired behavior is as follows:
when the StateRule’s edit condition is true and visible=True then display the control;
when the edit condition is true and visible=false then hide the control;
when the edit condition is false and visible=True then hide the control;
when the edit condition is false and enabled=false then display the control.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="value" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>GUI control's displayed value should be set to this value when edit condition is true. Although the type of this attribute has been listed as string, ultimately the type of this attribute must be compatible with the type of the control.
For example, if the control is numeric, such as a SingleSpinner, then a string containing a numeric value would an appropriate value (e.g. “15”).
If the control contains ListItem elements then allowable values of StateRule/@value is restricted to the enumIDs of the ListItem elements.
A special token, “{NULL}”, may be used for the value of this attribute to indicate that the control should be set to an uninitialized state. Controls that are un-initialized should have no value.
The effect of an un-initialized control is as follows:
When an order is to be generated, the controls which are linked to parameters will have their values retrieved. If there is no retrieved value because the control was un-initialized then the parameter should have no value and its associated FIX tag should be excluded from the message.
This is relevant only for controls that can be in an un-initialized state such as spinners and text fields. Controls such as check boxes and radio buttons are always initialized. (They are either checked or unchecked.)
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:schema>
<!-- Please email any revisions to the Steward of the Master Model & Mapping artifacts at algotech@fixprotocol.org -->
<!-- Revision History -->
<!-- Date Version Author Comments
Authors - Greg Malatestinic, Rick Labs, Zoltan Feledy, Jim Arlet, Gideon Kaplan, Martin Naughton, Mike McDermott and other members of FPL Algo Trading WG.
-if there is anyone else then please speak up :-)
30jan08 v2.5 by Robert Golan for uris, revision history, and version stamping.
20May08 - <edit> elements max and min occurs is now 1
27May08 - stateGroup and stateRule can now refer to editRef.
30Aug08 - value attribute has been added.
17Sep08 - stateGroup.filed changed to stateGroup.targetParameter.
21Jan09 v2.5.3 by Greg Malatestinic
- removed stateGroup element
23Jan09 v2.5.6 by Martin Naughton and Mike McDermott
- added a description element to stateRule
- added a reference to the Core schema to support the description element reference
16Feb09 v2.5.9 by Mike McDermott
- added a 'flow' alias to the default namespace for consistency
- created a StateRule_t complex type for consistency
27Mar09 v2.6.3 by Mike McDermott
- updated namespaces to conform with FIX standard for xml namespaces
- updated namespaces to conform with *product* version of 1.1
- updated element and type names to conform with FIX standard of upper camel case
22Feb v2.7.2 by Greg Malatestinic
- All xsd files renamed to fixatdl-{sub-schema}-1-1.xsd. Import/@schemaLocation adjusted accordingly.
- Namespaces changed to http://www.fixprotocol.org/FIXatdl-1-1/{sub-schema}
15Dec2010 v2.7.2e by Greg Malatestinic
- Sync'd documentation with specification document.
-->
@@ -0,0 +1,564 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- - - - - - - - - - - - - - - - - - - - - - - - - -
FIXatdl Sample document instance for FIXatdl Schema Version 1.1
(C) 2010 FIX Protocol Limited. All use of the FIXatdl Schema is subject to
the disclaimer which is printed on one of the initial pages of the written specification
for the FIXatdl Schema and is included in the zip file which you downloaded to
obtain the Schema.
Comments and errors should be posted on the FIX protocol web-site
http://www.fixprotocol.org
- - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:lay="http://www.fixprotocol.org/FIXatdl-1-1/Layout" xmlns:flow="http://www.fixprotocol.org/FIXatdl-1-1/Flow" xmlns:core="http://www.fixprotocol.org/FIXatdl-1-1/Core" xmlns:tz="http://www.fixprotocol.org/FIXatdl-1-1/Timezones" targetNamespace="http://www.fixprotocol.org/FIXatdl-1-1/Layout" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.1">
<xs:annotation>
<xs:documentation>
This value is the internal build number of the ATDL Schema
</xs:documentation>
<xs:appinfo>
<BuildInfo buildNumber="2.7.2e20101221"/>
</xs:appinfo>
</xs:annotation>
<xs:import namespace="http://www.fixprotocol.org/FIXatdl-1-1/Flow" schemaLocation="fixatdl-flow-1-1.xsd"/>
<xs:import namespace="http://www.fixprotocol.org/FIXatdl-1-1/Core" schemaLocation="fixatdl-core-1-1.xsd"/>
<xs:import namespace="http://www.fixprotocol.org/FIXatdl-1-1/Timezones" schemaLocation="fixatdl-timezones-1-1.xsd"/>
<!-- Please email any suggestions or revisions to algotech@fixprotocol.org-->
<!-- Please note - Revision history is at the end of this xsd
User Interface Sub-Schema
The intent of the UI sub-schema is to provide an easy, platform-neutral way to specify the layout of components.
This schema should be flexible enough to support multiple-platforms (i.e. Java Swing, SWT, or Web).-->
<xs:element name="StrategyLayout" type="lay:StrategyLayout_t"/>
<xs:complexType name="StrategyLayout_t">
<xs:sequence>
<xs:element name="StrategyPanel" type="lay:StrategyPanel_t" maxOccurs="unbounded">
<xs:key name="controlKey">
<xs:selector xpath=".//lay:control"/>
<xs:field xpath="@ID"/>
</xs:key>
<xs:unique name="controlParameterRefMustBeUnique">
<xs:selector xpath=".//lay:control"/>
<xs:field xpath="@parameterRef"/>
</xs:unique>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="StrategyPanel_t">
<xs:sequence>
<xs:element name="StrategyPanel" type="lay:StrategyPanel_t" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Control" type="lay:Control_t" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="title" type="xs:string">
<xs:annotation>
<xs:documentation>Title that appears in the panel border.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="collapsed" type="xs:boolean" default="false">
<xs:annotation>
<xs:documentation>Initial visual state of a panel. Indicates whether a panel is initially drawn in a collapsed state.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="collapsible" type="xs:boolean" default="true">
<xs:annotation>
<xs:documentation>Indicates whether panel can be collapsed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="color" type="xs:string">
<xs:annotation>
<xs:documentation>Set the background color. The value should appear as the RBG combination separated by commas.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="orientation" type="lay:PanelOrientation_t">
<xs:annotation>
<xs:documentation>Must be HORIZONTAL or VERTICAL. Declares the orientation of the components (parameters or nested strategyPanels) within a strategyPanel.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="border" type="lay:Border_t">
<xs:annotation>
<xs:documentation>Recommended border for the panel. Valid values are NONE and LINE.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="Control_t" abstract="true">
<xs:sequence>
<xs:element ref="flow:StateRule" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="HelpText" type="lay:HelpText_t" minOccurs="0">
<xs:annotation>
<xs:documentation> Help text for the parameter </xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="ID" use="required">
<xs:annotation>
<xs:documentation>Unique identifier of this control. No two controls of the same strategy can have the same ID.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[A-Za-z][A-za-z0-9_]{0,255}"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="parameterRef" use="optional">
<xs:annotation>
<xs:documentation>The name of the parameter for which this control gives the visual representation. A parameter with this name must be defined within the same strategy as this control.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[A-Za-z][A-za-z0-9_]{0,255}"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="label" type="xs:string">
<xs:annotation>
<xs:documentation>A title for this control which may be displayed. If the control is a Label_t then Control/@label or Control/@initValue must be used to define the string which is to be rendered. If both attributes are provided then Control/@initValue takes precedence.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="initFixField" type="xs:string">
<xs:annotation>
<xs:documentation>Indicates the initialization value is to be taken from this standard FIX field. Format: "FIX_" + FIXFieldName. Eg. "FIX_OrderQty". Required when initPolicy=”UseFixField”.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="initPolicy">
<xs:annotation>
<xs:documentation>Describes how to initialize the control. If the value of this attribute is undefined or equal to "UseValue" and initValue is defined then initialize with initValue.
If the value is equal to "UseFixField" then attempt to initialize with the value of the tag specified in initFixField. If the value is equal to "UseFixField" and it is not possible to access the value of the specified fix tag then revert to using initValue. If the value is equal to "UseFixField", the field is not accessible, and initValue is not defined, then do not initialize.
Valid values are: UseValue and UseFixField.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="UseValue"/>
<xs:enumeration value="UseFixField"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="tooltip" type="xs:string">
<xs:annotation>
<xs:documentation>Tool tip text for rendered GUI objects rendered for the parameter.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="disableForTemplate" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>For implementing systems that support saving order templates or pre-populated orders for basket trading/list trading this attribute specifies that the control should be disabled when the order screen is going to be saved as a template and not actually used to place an order.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="Clock_t">
<xs:complexContent>
<xs:extension base="lay:Control_t">
<xs:attribute name="initValue" type="xs:time">
<xs:annotation>
<xs:documentation>The value used to pre-populate the GUI component when the order entry screen is initially rendered. Expressed in local market time of the order recipient system.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="initValueMode" default="0">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Defines the treatment of initValue time. 0: use initValue; 1: use current time if initValue time has past.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:int">
<xs:enumeration value="0"/>
<xs:enumeration value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="localMktTz" type="tz:LocalMktTz_t">
<xs:annotation>
<xs:documentation>The timezone in which initValue is represented in. Required when initValue is supplied.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="TextField_t">
<xs:complexContent>
<xs:extension base="lay:Control_t">
<xs:attribute name="initValue" type="xs:string">
<xs:annotation>
<xs:documentation>The value used to pre-populate the GUI component when the order entry screen is initially rendered.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="SingleSelectList_t">
<xs:complexContent>
<xs:extension base="lay:Control_t">
<xs:sequence>
<xs:element name="ListItem" type="lay:ListItem_t" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="initValue" type="xs:string">
<xs:annotation>
<xs:documentation>The value used to pre-populate the GUI component when the order entry screen is initially rendered. Refers to an item in the list. Must be an enumID value from one of the listItems.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="MultiSelectList_t">
<xs:complexContent>
<xs:extension base="lay:Control_t">
<xs:sequence>
<xs:element name="ListItem" type="lay:ListItem_t" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="initValue" type="xs:string">
<xs:annotation>
<xs:documentation>The value used to pre-populate the GUI component when the order entry screen is initially rendered.
Refers to items in the list. Must be one or more enumID values from the listItems.
For multiple items use a space delimiter.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="Slider_t">
<xs:complexContent>
<xs:extension base="lay:Control_t">
<xs:sequence>
<xs:element name="ListItem" type="lay:ListItem_t" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="initValue" type="xs:string">
<xs:annotation>
<xs:documentation>The value used to pre-populate the GUI component when the order entry screen is initially rendered. Refers to an item in the list. Must be an enumID value from one of the listItems.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="CheckBox_t">
<xs:complexContent>
<xs:extension base="lay:Control_t">
<xs:attribute name="initValue" type="xs:boolean">
<xs:annotation>
<xs:documentation>The value used to pre-populate the GUI component when the order entry screen is initially rendered. True indicates the checkbox should be checked. False iundicates it should be unchecked. For rule evaluation, checked=true and unchecked=false.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="checkedEnumRef" type="xs:string">
<xs:annotation>
<xs:documentation>Refers to an enumID defined in the definition of the Parameter referred by Control/@parameterRef. This enumID is the output from this control if it is checked/selected.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="uncheckedEnumRef" type="xs:string">
<xs:annotation>
<xs:documentation>Refers to an enumID defined in the definition of the Parameter referred by Control/@parameterRef. This enumID is the output from this control if it is unchecked/unselected.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="CheckBoxList_t">
<xs:complexContent>
<xs:extension base="lay:Control_t">
<xs:sequence>
<xs:element name="ListItem" type="lay:ListItem_t" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="initValue" type="core:MultipleStringValue">
<xs:annotation>
<xs:documentation>The value used to pre-populate the GUI component when the order entry screen is initially rendered. Refers to enumIDs of child ListItems. If a ListItem's enumID is included then the associated checkbox should be checked when initially rendered. If it is not included then the checkbox should be unchecked when initially rendered.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="orientation" type="lay:PanelOrientation_t">
<xs:annotation>
<xs:documentation>Must be HORIZONTAL or VERTICAL. Declares the orientation of the radio buttons within a RadioButtonList or the checkboxes within a CheckBoxList.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="SingleSpinner_t">
<xs:complexContent>
<xs:extension base="lay:Control_t">
<xs:attribute name="initValue" type="xs:double">
<xs:annotation>
<xs:documentation>The value used to pre-populate the GUI component when the order entry screen is initially rendered.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="increment" type="xs:double" use="optional">
<xs:annotation>
<xs:documentation>Limits the granularity of a spinner control. Useful in spinner objects to enforce odd-lot and sub-penny restrictions.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="incrementPolicy" use="optional">
<xs:simpleType>
<xs:annotation>
<xs:documentation>
Describes how to use increment. If undefined then take value from increment
attribute, if LotSize use value based on symbol lot size. (If lot size is not available use value of
increment attribute.) If Tick use value based on symbol tick size. (If tick size is not available
use value of increment attribute.) If increment is to be used and is not defined then use a system
default value.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="Tick"/>
<xs:enumeration value="LotSize"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="DoubleSpinner_t">
<xs:complexContent>
<xs:extension base="lay:Control_t">
<xs:attribute name="initValue" type="xs:double">
<xs:annotation>
<xs:documentation>The value used to pre-populate the GUI component when the order entry screen is initially rendered.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="innerIncrement" type="xs:double" use="optional">
<xs:annotation>
<xs:documentation>Limits the granularity of the inner spinner of a double spinner control. Useful in spinner objects to enforce odd-lot and sub-penny restrictions.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="innerIncrementPolicy" use="optional">
<xs:simpleType>
<xs:annotation>
<xs:documentation>
Describes how to use innerIncrement. If undefined then take value from innerIncrement
attribute, if LotSize use value based on symbol lot size. (If lot size is not available use value of
innerIncrement attribute.) If Tick use value based on symbol tick size. (If tick size is not available
use value of innerIncrement attribute.) If innerIncrement is to be used and is not defined then use a system
default value.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="Tick"/>
<xs:enumeration value="LotSize"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="outerIncrement" type="xs:double" use="optional">
<xs:annotation>
<xs:documentation>Limits the granularity of the outer spinner of a double spinner control. Useful in spinner objects to enforce odd-lot and sub-penny restrictions.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="outerIncrementPolicy" use="optional">
<xs:simpleType>
<xs:annotation>
<xs:documentation>
Describes how to use outerIncrement. If undefined then take value from outerIncrement
attribute, if LotSize use value based on symbol lot size. (If lot size is not available use value of
outerIncrement attribute.) If Tick use value based on symbol tick size. (If tick size is not available
use value of outerIncrement attribute.) If outerIncrement is to be used and is not defined then use a system
default value.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="Tick"/>
<xs:enumeration value="LotSize"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="DropDownList_t">
<xs:complexContent>
<xs:extension base="lay:Control_t">
<xs:sequence>
<xs:element name="ListItem" type="lay:ListItem_t" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="initValue" type="xs:string">
<xs:annotation>
<xs:documentation>The value used to pre-populate the GUI component when the order entry screen is initially rendered. Refers to an item in the list. Must be an enumID value from one of the listItems.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="EditableDropDownList_t">
<xs:complexContent>
<xs:extension base="lay:Control_t">
<xs:sequence>
<xs:element name="ListItem" type="lay:ListItem_t" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="initValue" type="xs:string">
<xs:annotation>
<xs:documentation>The value used to pre-populate the GUI component when the order entry screen is initially rendered. Refers to an item in the list. Must be an enumID value from one of the listItems.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="RadioButton_t">
<xs:complexContent>
<xs:extension base="lay:Control_t">
<xs:attribute name="radioGroup" type="xs:string">
<xs:annotation>
<xs:documentation>Indicates a group of radio buttons, among which only one radio button may be selected at a time.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="initValue" type="xs:boolean">
<xs:annotation>
<xs:documentation>The value used to pre-populate the GUI component when the order entry screen is initially rendered. True indicates the radio button should initially be checked. False indicates it should be unchecked. For rule evaluation, checked=true and unchecked=false.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="checkedEnumRef" type="xs:string">
<xs:annotation>
<xs:documentation>Refers to an enumID defined in the definition of the Parameter referred by Control/@parameterRef. This enumID is the output from this control if it is checked/selected.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="uncheckedEnumRef" type="xs:string">
<xs:annotation>
<xs:documentation>Refers to an enumID defined in the definition of the Parameter referred by Control/@parameterRef. This enumID is the output from this control if it is unchecked/unselected.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="RadioButtonList_t">
<xs:complexContent>
<xs:extension base="lay:Control_t">
<xs:sequence>
<xs:element name="ListItem" type="lay:ListItem_t" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="initValue" type="xs:string">
<xs:annotation>
<xs:documentation>The value used to pre-populate the GUI component when the order entry screen is initially rendered. Refers to an item in the list. Must be an enumID value from one of the listItems.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="orientation" type="lay:PanelOrientation_t">
<xs:annotation>
<xs:documentation>Must be HORIZONTAL or VERTICAL. Declares the orientation of the radio buttons within a RadioButtonList or the checkboxes within a CheckBoxList.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="Label_t">
<xs:complexContent>
<xs:extension base="lay:Control_t">
<xs:attribute name="initValue" type="xs:string">
<xs:annotation>
<xs:documentation>Use this to set the displayed label. Control/@label or Control/@initValue must be used to define the string which is to be rendered. If both attributes are provided then Control/@initValue takes precedence.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="HiddenField_t">
<xs:complexContent>
<xs:extension base="lay:Control_t">
<xs:attribute name="initValue" type="xs:string"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="ListItem_t">
<xs:sequence>
<xs:element ref="flow:StateRule" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="enumID" use="optional">
<xs:annotation>
<xs:documentation>A reference to the enum specified in the parameter definition. Use is optional when the control does not refer to a parameter.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[A-Za-z][A-za-z0-9_]{0,255}"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="uiRep" type="xs:string">
<xs:annotation>
<xs:documentation>The value shown in the list. These are the values that go into Java or .Net list controls.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:simpleType name="HelpText_t">
<xs:restriction base="xs:string">
<xs:whiteSpace value="preserve"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="PanelOrientation_t">
<xs:restriction base="xs:string">
<xs:enumeration value="HORIZONTAL"/>
<xs:enumeration value="VERTICAL"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Border_t">
<xs:restriction base="xs:string">
<xs:enumeration value="None"/>
<xs:enumeration value="Line"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
<!-- Please email any revisions to the Steward of the Master Model & Mapping artifacts at algotech@fixprotocol.org -->
<!-- Revision History -->
<!-- Date Version Author Comments
Authors - Greg Malatestinic, Rick Labs, Zoltan Feledy, Jim Arlet, Gideon Kaplan, Martin Naughton and other members of FPL Algo Trading WG.
-if there is anyone else then please speak up :-)
30jan08 v2.5 by Robert Golan for uris, revision history, and version stamping.
10Mar08 - Reverting to previous version naming. This is now version 2.4.3.
27Aug08 - Control Types have been reviewed and cleaned up.
23Dec08 v2.5.0
- Added Control elements
13Jan09 v2.5.1 by Greg Malatestinic
- Added increment and incrementSource to spinner control
- Added "id" to Control_t - a way to identify a control for use in a stateRule
- Added stateRule to Control_t
- Removed references to core
14Jan09 v2.5.2 by Mike McDermott
- moved 'parameterRef' attribute from each derived control type, to the base control element defintion
- changed 'increment' on Slider type to optional
- added 'tooltip' attribute from core schema to base control type
- changed 'incrementSource' attribute on SingleSpinner_t type to optional
- removed 'Static' as an option for 'incrementSource' on SingleSpinner_t
- added HiddenField_t as a control type
- removed component_t - it was deprecated by the new control type structure
21Jan09 v2.5.3 by Greg Malatestinic
- added increment to NumberSpinner_t and Slider_t and replaced incrementSource with incrementPolicy
- added innerIncrement and outerIncrement to DoubleSpinner_t and also inner/outerIncrementPolicy
- created complex type ListItem
- added ListItem elements to all list-based controls: SingleSelectList_t, MultiSelectList_t, ListBox_t, DropDpwnList_t, EditableDropDownList_t, RadioButtonList_t and MultiSelectListBox_t
- added initFixTag and initPolicy to Control_t
- added initValue (with appropriate type) to all concrete controls.
- added import of cor. Needed for Clock_t.initValue
22Jan09 v2.5.4 by Greg Malatestinic and Mike McDermott
- added helpText to Control_t and moved helpText_t from Core to Layout
28Jan09 v2.5.7 by Greg Malatestinic
- added ListItem element and initValue to HiddenField_t control
- created a new control type, Label_t.
16Feb09 v2.5.9 by Mike McDermott
- set the 'ID' attribute on Control_t to be 'required'
- added a xs:key constaint to the 'ID' attribute on Control_t
- added a 'lay' alias to the default namespace to allow the xs:key constraint to work correctly
- created a StrategyLayout_t complex type for consistency
20Feb09 v2.6.0 by Jim Arlet and Mike McDermott
- readded CheckBoxList_t
26Feb09 v2.6.1 by Mike McDermott
- added abstract="true" to Control_t to enfore the use of xsi:type
- removed ListBox_t and MultiListBox_t because they were determined to be redundant
- renamed RadioButtonList_t to RadioButtonGroup_t
- added a RadioButton_t control
09Mar09 v2.6.2 by Mike McDermott
- added 'disableForTemplate' attribute to the Control_t type
27Mar09 v2.6.3 by Mike McDermott
- updated namespaces to conform with FIX standard for xml namespaces
- updated namespaces to conform with *product* version of 1.1
- updated element and type names to conform with FIX standard of upper camel case
26May09 v2.6.5 by Mike McDermott
- added minOccurs="0" to all listItem references to prevent list items from being
'mandatory' on controls that could have a collection
10Jan10 v2.6.7 by John Shields
- added checkedEnumRef and uncheckedEnumRef attributes to Checkbox_t and RadioButton_t (moved from Boolean_t in Core schema)
- added radioGroup to RadioButton_t
- changed name of RadioButtonGroup_t back to RadioButtonList_t to avoid confusion with radioGroup attribute of RadioButton_t
- added ListItem sequence to Slider_t
- changed type of initValue attribute for Slider_t to xs:string (must be an enumID of one of the ListItems)
- removed increment and incrementPolicy attributes from Slider_t
13Jan10 v2.6.8 by Greg Malatestinic
- changed Clock_t/@initValue from UTCTimestamp to LocalMktTime
- added Clock_t/@localMktTz
- chenged CheckboxList_T/@initVal from type string to type MultipleStringValue
20Jan10 v2.6.9 by Greg Malatestinic
- No Changes
19Feb10 v2.7.1 by Greg Malatestinic
- initFixTag replaced by initFixField
- several border enums were removed. Only None and Line remain.
- added orientation attribute to RadioButtonList_t and CheckBoxList_t
22Feb v2.7.2 by Greg Malatestinic
- All xsd files renamed to fixatdl-{sub-schema}-1-1.xsd. Import/@schemaLocation adjusted accordingly.
- Namespaces changed to http://www.fixprotocol.org/FIXatdl-1-1/{sub-schema}
15Dec2010 v2.7.2e by Greg Malatestinic
- Sync'd documentation with specification document.
-->
@@ -0,0 +1,301 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- - - - - - - - - - - - - - - - - - - - - - - - - -
FIXatdl Sample document instance for FIXatdl Schema Version 1.1
(C) 2010 FIX Protocol Limited. All use of the FIXatdl Schema is subject to
the disclaimer which is printed on one of the initial pages of the written specification
for the FIXatdl Schema and is included in the zip file which you downloaded to
obtain the Schema.
Comments and errors should be posted on the FIX protocol web-site
http://www.fixprotocol.org
- - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:rg="http://www.fixprotocol.org/FIXatdl-1-1/Regions" targetNamespace="http://www.fixprotocol.org/FIXatdl-1-1/Regions" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.1">
<xs:annotation>
<xs:documentation>
This value is the internal build number of the ATDL Schema
</xs:documentation>
<xs:appinfo>
<BuildInfo buildNumber="2.7.2e20101221"/>
</xs:appinfo>
</xs:annotation>
<!-- Please email any suggestions or revisions to algotech@fixprotocol.org-->
<!-- Please note - Revision history is at the end of this xsd
Regions Mapping-->
<xs:element name="TheAmericas">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="AI"/>
<xs:enumeration value="AG"/>
<xs:enumeration value="AR"/>
<xs:enumeration value="AW"/>
<xs:enumeration value="BS"/>
<xs:enumeration value="BB"/>
<xs:enumeration value="BZ"/>
<xs:enumeration value="BM"/>
<xs:enumeration value="BO"/>
<xs:enumeration value="BR"/>
<xs:enumeration value="CA"/>
<xs:enumeration value="KY"/>
<xs:enumeration value="CL"/>
<xs:enumeration value="CO"/>
<xs:enumeration value="CR"/>
<xs:enumeration value="CU"/>
<xs:enumeration value="DM"/>
<xs:enumeration value="DO"/>
<xs:enumeration value="EC"/>
<xs:enumeration value="SV"/>
<xs:enumeration value="FK"/>
<xs:enumeration value="GD"/>
<xs:enumeration value="GP"/>
<xs:enumeration value="GT"/>
<xs:enumeration value="GY"/>
<xs:enumeration value="HT"/>
<xs:enumeration value="HN"/>
<xs:enumeration value="JM"/>
<xs:enumeration value="MQ"/>
<xs:enumeration value="MX"/>
<xs:enumeration value="MS"/>
<xs:enumeration value="AN"/>
<xs:enumeration value="NI"/>
<xs:enumeration value="PA"/>
<xs:enumeration value="PY"/>
<xs:enumeration value="PE"/>
<xs:enumeration value="PR"/>
<xs:enumeration value="BL"/>
<xs:enumeration value="KN"/>
<xs:enumeration value="LC"/>
<xs:enumeration value="MF"/>
<xs:enumeration value="PM"/>
<xs:enumeration value="VC"/>
<xs:enumeration value="TT"/>
<xs:enumeration value="TC"/>
<xs:enumeration value="US"/>
<xs:enumeration value="UY"/>
<xs:enumeration value="VG"/>
<xs:enumeration value="VI"/>
<xs:enumeration value="VE"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="EuropeMiddleEastAfrica">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="AX"/>
<xs:enumeration value="AL"/>
<xs:enumeration value="DZ"/>
<xs:enumeration value="AD"/>
<xs:enumeration value="AO"/>
<xs:enumeration value="AM"/>
<xs:enumeration value="AT"/>
<xs:enumeration value="AZ"/>
<xs:enumeration value="BH"/>
<xs:enumeration value="BY"/>
<xs:enumeration value="BE"/>
<xs:enumeration value="BJ"/>
<xs:enumeration value="BA"/>
<xs:enumeration value="BW"/>
<xs:enumeration value="BG"/>
<xs:enumeration value="BF"/>
<xs:enumeration value="BI"/>
<xs:enumeration value="CM"/>
<xs:enumeration value="CV"/>
<xs:enumeration value="CF"/>
<xs:enumeration value="TD"/>
<xs:enumeration value="KM"/>
<xs:enumeration value="CG"/>
<xs:enumeration value="CD"/>
<xs:enumeration value="CI"/>
<xs:enumeration value="HR"/>
<xs:enumeration value="CY"/>
<xs:enumeration value="CZ"/>
<xs:enumeration value="DK"/>
<xs:enumeration value="DJ"/>
<xs:enumeration value="EG"/>
<xs:enumeration value="GQ"/>
<xs:enumeration value="ER"/>
<xs:enumeration value="EE"/>
<xs:enumeration value="ET"/>
<xs:enumeration value="FO"/>
<xs:enumeration value="FI"/>
<xs:enumeration value="FR"/>
<xs:enumeration value="GF"/>
<xs:enumeration value="GA"/>
<xs:enumeration value="GM"/>
<xs:enumeration value="GE"/>
<xs:enumeration value="DE"/>
<xs:enumeration value="GH"/>
<xs:enumeration value="GI"/>
<xs:enumeration value="GR"/>
<xs:enumeration value="GL"/>
<xs:enumeration value="GG"/>
<xs:enumeration value="GN"/>
<xs:enumeration value="GW"/>
<xs:enumeration value="VA"/>
<xs:enumeration value="HU"/>
<xs:enumeration value="IS"/>
<xs:enumeration value="IR"/>
<xs:enumeration value="IQ"/>
<xs:enumeration value="IE"/>
<xs:enumeration value="IM"/>
<xs:enumeration value="IL"/>
<xs:enumeration value="IT"/>
<xs:enumeration value="JE"/>
<xs:enumeration value="JO"/>
<xs:enumeration value="KE"/>
<xs:enumeration value="KW"/>
<xs:enumeration value="LV"/>
<xs:enumeration value="LB"/>
<xs:enumeration value="LS"/>
<xs:enumeration value="LR"/>
<xs:enumeration value="LY"/>
<xs:enumeration value="LI"/>
<xs:enumeration value="LT"/>
<xs:enumeration value="LU"/>
<xs:enumeration value="MK"/>
<xs:enumeration value="MG"/>
<xs:enumeration value="MW"/>
<xs:enumeration value="ML"/>
<xs:enumeration value="MT"/>
<xs:enumeration value="MR"/>
<xs:enumeration value="MU"/>
<xs:enumeration value="YT"/>
<xs:enumeration value="MD"/>
<xs:enumeration value="MC"/>
<xs:enumeration value="ME"/>
<xs:enumeration value="MA"/>
<xs:enumeration value="MZ"/>
<xs:enumeration value="NA"/>
<xs:enumeration value="NL"/>
<xs:enumeration value="NE"/>
<xs:enumeration value="NG"/>
<xs:enumeration value="NO"/>
<xs:enumeration value="OM"/>
<xs:enumeration value="PS"/>
<xs:enumeration value="PN"/>
<xs:enumeration value="PL"/>
<xs:enumeration value="PT"/>
<xs:enumeration value="QA"/>
<xs:enumeration value="RE"/>
<xs:enumeration value="RO"/>
<xs:enumeration value="RU"/>
<xs:enumeration value="RW"/>
<xs:enumeration value="SH"/>
<xs:enumeration value="SM"/>
<xs:enumeration value="ST"/>
<xs:enumeration value="SA"/>
<xs:enumeration value="SN"/>
<xs:enumeration value="RS"/>
<xs:enumeration value="SC"/>
<xs:enumeration value="SL"/>
<xs:enumeration value="SK"/>
<xs:enumeration value="SI"/>
<xs:enumeration value="SO"/>
<xs:enumeration value="ZA"/>
<xs:enumeration value="GS"/>
<xs:enumeration value="ES"/>
<xs:enumeration value="LK"/>
<xs:enumeration value="SD"/>
<xs:enumeration value="SR"/>
<xs:enumeration value="SJ"/>
<xs:enumeration value="SZ"/>
<xs:enumeration value="SE"/>
<xs:enumeration value="CH"/>
<xs:enumeration value="SY"/>
<xs:enumeration value="EH"/>
<xs:enumeration value="TZ"/>
<xs:enumeration value="TG"/>
<xs:enumeration value="TN"/>
<xs:enumeration value="TR"/>
<xs:enumeration value="UG"/>
<xs:enumeration value="UA"/>
<xs:enumeration value="AE"/>
<xs:enumeration value="GB"/>
<xs:enumeration value="YE"/>
<xs:enumeration value="ZM"/>
<xs:enumeration value="ZW"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="AsiaPacificJapan">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="AF"/>
<xs:enumeration value="AS"/>
<xs:enumeration value="AU"/>
<xs:enumeration value="BD"/>
<xs:enumeration value="BT"/>
<xs:enumeration value="IO"/>
<xs:enumeration value="BN"/>
<xs:enumeration value="KH"/>
<xs:enumeration value="CN"/>
<xs:enumeration value="CX"/>
<xs:enumeration value="CC"/>
<xs:enumeration value="CK"/>
<xs:enumeration value="FJ"/>
<xs:enumeration value="PF"/>
<xs:enumeration value="GU"/>
<xs:enumeration value="HK"/>
<xs:enumeration value="IN"/>
<xs:enumeration value="ID"/>
<xs:enumeration value="JP"/>
<xs:enumeration value="KZ"/>
<xs:enumeration value="KI"/>
<xs:enumeration value="KP"/>
<xs:enumeration value="KR"/>
<xs:enumeration value="KG"/>
<xs:enumeration value="LA"/>
<xs:enumeration value="MO"/>
<xs:enumeration value="MY"/>
<xs:enumeration value="MV"/>
<xs:enumeration value="MH"/>
<xs:enumeration value="FM"/>
<xs:enumeration value="MN"/>
<xs:enumeration value="MM"/>
<xs:enumeration value="NR"/>
<xs:enumeration value="NP"/>
<xs:enumeration value="NC"/>
<xs:enumeration value="NZ"/>
<xs:enumeration value="NU"/>
<xs:enumeration value="NF"/>
<xs:enumeration value="MP"/>
<xs:enumeration value="PK"/>
<xs:enumeration value="PW"/>
<xs:enumeration value="PG"/>
<xs:enumeration value="PH"/>
<xs:enumeration value="WS"/>
<xs:enumeration value="SG"/>
<xs:enumeration value="SB"/>
<xs:enumeration value="TW"/>
<xs:enumeration value="TJ"/>
<xs:enumeration value="TH"/>
<xs:enumeration value="TL"/>
<xs:enumeration value="TK"/>
<xs:enumeration value="TO"/>
<xs:enumeration value="TM"/>
<xs:enumeration value="TV"/>
<xs:enumeration value="UM"/>
<xs:enumeration value="UZ"/>
<xs:enumeration value="VU"/>
<xs:enumeration value="VN"/>
<xs:enumeration value="WF"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:schema>
<!-- Please email any revisions to the Steward of the Master Model & Mapping artifacts at algotech@fixprotocol.org -->
<!-- Revision History -->
<!-- Date Version Author Comments
Authors - Greg Malatestinic, Rick Labs, Zoltan Feledy, Jim Arlet, Gideon Kaplan, Martin Naughton, Mike McDermott and other members of FPL Algo Trading WG.
-if there is anyone else then please speak up :-)
27Mar09 v2.6.3 by Mike McDermott
- updated namespaces to conform with FIX standard for xml namespaces
- updated namespaces to conform with *product* version of 1.1
- updated element and type names to conform with FIX standard of upper camel case
27Jan10 v2.7.1 by Greg Malatestinic
- added namespace declaration, rg, for Regions
22Feb v2.7.2 by Greg Malatestinic
- All xsd files renamed to fixatdl-{sub-schema}-1-1.xsd. Import/@schemaLocation adjusted accordingly.
- Namespaces changed to http://www.fixprotocol.org/FIXatdl-1-1/{sub-schema}
-->
@@ -0,0 +1,444 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- - - - - - - - - - - - - - - - - - - - - - - - - -
FIXatdl Sample document instance for FIXatdl Schema Version 1.1
(C) 2010 FIX Protocol Limited. All use of the FIXatdl Schema is subject to
the disclaimer which is printed on one of the initial pages of the written specification
for the FIXatdl Schema and is included in the zip file which you downloaded to
obtain the Schema.
Comments and errors should be posted on the FIX protocol web-site
http://www.fixprotocol.org
- - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tz="http://www.fixprotocol.org/FIXatdl-1-1/Timezones" targetNamespace="http://www.fixprotocol.org/FIXatdl-1-1/Timezones" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.1">
<xs:annotation>
<xs:documentation>
This value is the internal build number of the ATDL Schema
</xs:documentation>
<xs:appinfo>
<BuildInfo buildNumber="2.7.2e20101221"/>
</xs:appinfo>
</xs:annotation>
<!-- Please email any suggestions or revisions to algotech@fixprotocol.org-->
<!-- Please note - Revision history is at the end of this xsd -->
<xs:simpleType name="LocalMktTz_t">
<xs:restriction base="xs:string">
<xs:enumeration value="Africa/Abidjan"/>
<xs:enumeration value="Africa/Accra"/>
<xs:enumeration value="Africa/Addis_Ababa"/>
<xs:enumeration value="Africa/Algiers"/>
<xs:enumeration value="Africa/Asmara"/>
<xs:enumeration value="Africa/Bamako"/>
<xs:enumeration value="Africa/Bangui"/>
<xs:enumeration value="Africa/Banjul"/>
<xs:enumeration value="Africa/Bissau"/>
<xs:enumeration value="Africa/Blantyre"/>
<xs:enumeration value="Africa/Brazzaville"/>
<xs:enumeration value="Africa/Bujumbura"/>
<xs:enumeration value="Africa/Cairo"/>
<xs:enumeration value="Africa/Casablanca"/>
<xs:enumeration value="Africa/Ceuta"/>
<xs:enumeration value="Africa/Conakry"/>
<xs:enumeration value="Africa/Dakar"/>
<xs:enumeration value="Africa/Dar_es_Salaam"/>
<xs:enumeration value="Africa/Djibouti"/>
<xs:enumeration value="Africa/Douala"/>
<xs:enumeration value="Africa/El_Aaiun"/>
<xs:enumeration value="Africa/Freetown"/>
<xs:enumeration value="Africa/Gaborone"/>
<xs:enumeration value="Africa/Harare"/>
<xs:enumeration value="Africa/Johannesburg"/>
<xs:enumeration value="Africa/Kampala"/>
<xs:enumeration value="Africa/Khartoum"/>
<xs:enumeration value="Africa/Kigali"/>
<xs:enumeration value="Africa/Kinshasa"/>
<xs:enumeration value="Africa/Lagos"/>
<xs:enumeration value="Africa/Libreville"/>
<xs:enumeration value="Africa/Lome"/>
<xs:enumeration value="Africa/Luanda"/>
<xs:enumeration value="Africa/Lubumbashi"/>
<xs:enumeration value="Africa/Lusaka"/>
<xs:enumeration value="Africa/Malabo"/>
<xs:enumeration value="Africa/Maputo"/>
<xs:enumeration value="Africa/Maseru"/>
<xs:enumeration value="Africa/Mbabane"/>
<xs:enumeration value="Africa/Mogadishu"/>
<xs:enumeration value="Africa/Monrovia"/>
<xs:enumeration value="Africa/Nairobi"/>
<xs:enumeration value="Africa/Ndjamena"/>
<xs:enumeration value="Africa/Niamey"/>
<xs:enumeration value="Africa/Nouakchott"/>
<xs:enumeration value="Africa/Ouagadougou"/>
<xs:enumeration value="Africa/Porto-Novo"/>
<xs:enumeration value="Africa/Sao_Tome"/>
<xs:enumeration value="Africa/Tripoli"/>
<xs:enumeration value="Africa/Tunis"/>
<xs:enumeration value="Africa/Windhoek"/>
<xs:enumeration value="America/Adak"/>
<xs:enumeration value="America/Anchorage"/>
<xs:enumeration value="America/Anguilla"/>
<xs:enumeration value="America/Antigua"/>
<xs:enumeration value="America/Araguaina"/>
<xs:enumeration value="America/Argentina/Buenos_Aires"/>
<xs:enumeration value="America/Argentina/Catamarca"/>
<xs:enumeration value="America/Argentina/Cordoba"/>
<xs:enumeration value="America/Argentina/Jujuy"/>
<xs:enumeration value="America/Argentina/La_Rioja"/>
<xs:enumeration value="America/Argentina/Mendoza"/>
<xs:enumeration value="America/Argentina/Rio_Gallegos"/>
<xs:enumeration value="America/Argentina/Salta"/>
<xs:enumeration value="America/Argentina/San_Juan"/>
<xs:enumeration value="America/Argentina/San_Luis"/>
<xs:enumeration value="America/Argentina/Tucuman"/>
<xs:enumeration value="America/Argentina/Ushuaia"/>
<xs:enumeration value="America/Aruba"/>
<xs:enumeration value="America/Asuncion"/>
<xs:enumeration value="America/Atikokan"/>
<xs:enumeration value="America/Bahia"/>
<xs:enumeration value="America/Barbados"/>
<xs:enumeration value="America/Belem"/>
<xs:enumeration value="America/Belize"/>
<xs:enumeration value="America/Blanc-Sablon"/>
<xs:enumeration value="America/Boa_Vista"/>
<xs:enumeration value="America/Bogota"/>
<xs:enumeration value="America/Boise"/>
<xs:enumeration value="America/Cambridge_Bay"/>
<xs:enumeration value="America/Campo_Grande"/>
<xs:enumeration value="America/Cancun"/>
<xs:enumeration value="America/Caracas"/>
<xs:enumeration value="America/Cayenne"/>
<xs:enumeration value="America/Cayman"/>
<xs:enumeration value="America/Chicago"/>
<xs:enumeration value="America/Chihuahua"/>
<xs:enumeration value="America/Costa_Rica"/>
<xs:enumeration value="America/Cuiaba"/>
<xs:enumeration value="America/Curacao"/>
<xs:enumeration value="America/Danmarkshavn"/>
<xs:enumeration value="America/Dawson"/>
<xs:enumeration value="America/Dawson_Creek"/>
<xs:enumeration value="America/Denver"/>
<xs:enumeration value="America/Detroit"/>
<xs:enumeration value="America/Dominica"/>
<xs:enumeration value="America/Edmonton"/>
<xs:enumeration value="America/Eirunepe"/>
<xs:enumeration value="America/El_Salvador"/>
<xs:enumeration value="America/Fortaleza"/>
<xs:enumeration value="America/Glace_Bay"/>
<xs:enumeration value="America/Godthab"/>
<xs:enumeration value="America/Goose_Bay"/>
<xs:enumeration value="America/Grand_Turk"/>
<xs:enumeration value="America/Grenada"/>
<xs:enumeration value="America/Guadeloupe"/>
<xs:enumeration value="America/Guatemala"/>
<xs:enumeration value="America/Guayaquil"/>
<xs:enumeration value="America/Guyana"/>
<xs:enumeration value="America/Halifax"/>
<xs:enumeration value="America/Havana"/>
<xs:enumeration value="America/Hermosillo"/>
<xs:enumeration value="America/Indiana/Indianapolis"/>
<xs:enumeration value="America/Indiana/Knox"/>
<xs:enumeration value="America/Indiana/Marengo"/>
<xs:enumeration value="America/Indiana/Petersburg"/>
<xs:enumeration value="America/Indiana/Tell_City"/>
<xs:enumeration value="America/Indiana/Vevay"/>
<xs:enumeration value="America/Indiana/Vincennes"/>
<xs:enumeration value="America/Indiana/Winamac"/>
<xs:enumeration value="America/Inuvik"/>
<xs:enumeration value="America/Iqaluit"/>
<xs:enumeration value="America/Jamaica"/>
<xs:enumeration value="America/Juneau"/>
<xs:enumeration value="America/Kentucky/Louisville"/>
<xs:enumeration value="America/Kentucky/Monticello"/>
<xs:enumeration value="America/La_Paz"/>
<xs:enumeration value="America/Lima"/>
<xs:enumeration value="America/Los_Angeles"/>
<xs:enumeration value="America/Maceio"/>
<xs:enumeration value="America/Managua"/>
<xs:enumeration value="America/Manaus"/>
<xs:enumeration value="America/Marigot"/>
<xs:enumeration value="America/Martinique"/>
<xs:enumeration value="America/Mazatlan"/>
<xs:enumeration value="America/Menominee"/>
<xs:enumeration value="America/Merida"/>
<xs:enumeration value="America/Mexico_City"/>
<xs:enumeration value="America/Miquelon"/>
<xs:enumeration value="America/Moncton"/>
<xs:enumeration value="America/Monterrey"/>
<xs:enumeration value="America/Montevideo"/>
<xs:enumeration value="America/Montreal"/>
<xs:enumeration value="America/Montserrat"/>
<xs:enumeration value="America/Nassau"/>
<xs:enumeration value="America/New_York"/>
<xs:enumeration value="America/Nipigon"/>
<xs:enumeration value="America/Nome"/>
<xs:enumeration value="America/Noronha"/>
<xs:enumeration value="America/North_Dakota/Center"/>
<xs:enumeration value="America/North_Dakota/New_Salem"/>
<xs:enumeration value="America/Panama"/>
<xs:enumeration value="America/Pangnirtung"/>
<xs:enumeration value="America/Paramaribo"/>
<xs:enumeration value="America/Phoenix"/>
<xs:enumeration value="America/Port-au-Prince"/>
<xs:enumeration value="America/Port_of_Spain"/>
<xs:enumeration value="America/Porto_Velho"/>
<xs:enumeration value="America/Puerto_Rico"/>
<xs:enumeration value="America/Rainy_River"/>
<xs:enumeration value="America/Rankin_Inlet"/>
<xs:enumeration value="America/Recife"/>
<xs:enumeration value="America/Regina"/>
<xs:enumeration value="America/Resolute"/>
<xs:enumeration value="America/Rio_Branco"/>
<xs:enumeration value="America/Santarem"/>
<xs:enumeration value="America/Santiago"/>
<xs:enumeration value="America/Santo_Domingo"/>
<xs:enumeration value="America/Sao_Paulo"/>
<xs:enumeration value="America/Scoresbysund"/>
<xs:enumeration value="America/Shiprock"/>
<xs:enumeration value="America/St_Barthelemy"/>
<xs:enumeration value="America/St_Johns"/>
<xs:enumeration value="America/St_Kitts"/>
<xs:enumeration value="America/St_Lucia"/>
<xs:enumeration value="America/St_Thomas"/>
<xs:enumeration value="America/St_Vincent"/>
<xs:enumeration value="America/Swift_Current"/>
<xs:enumeration value="America/Tegucigalpa"/>
<xs:enumeration value="America/Thule"/>
<xs:enumeration value="America/Thunder_Bay"/>
<xs:enumeration value="America/Tijuana"/>
<xs:enumeration value="America/Toronto"/>
<xs:enumeration value="America/Tortola"/>
<xs:enumeration value="America/Vancouver"/>
<xs:enumeration value="America/Whitehorse"/>
<xs:enumeration value="America/Winnipeg"/>
<xs:enumeration value="America/Yakutat"/>
<xs:enumeration value="America/Yellowknife"/>
<xs:enumeration value="Antarctica/Casey"/>
<xs:enumeration value="Antarctica/Davis"/>
<xs:enumeration value="Antarctica/DumontDUrville"/>
<xs:enumeration value="Antarctica/Mawson"/>
<xs:enumeration value="Antarctica/McMurdo"/>
<xs:enumeration value="Antarctica/Palmer"/>
<xs:enumeration value="Antarctica/Rothera"/>
<xs:enumeration value="Antarctica/South_Pole"/>
<xs:enumeration value="Antarctica/Syowa"/>
<xs:enumeration value="Antarctica/Vostok"/>
<xs:enumeration value="Arctic/Longyearbyen"/>
<xs:enumeration value="Asia/Aden"/>
<xs:enumeration value="Asia/Almaty"/>
<xs:enumeration value="Asia/Amman"/>
<xs:enumeration value="Asia/Anadyr"/>
<xs:enumeration value="Asia/Aqtau"/>
<xs:enumeration value="Asia/Aqtobe"/>
<xs:enumeration value="Asia/Ashgabat"/>
<xs:enumeration value="Asia/Baghdad"/>
<xs:enumeration value="Asia/Bahrain"/>
<xs:enumeration value="Asia/Baku"/>
<xs:enumeration value="Asia/Bangkok"/>
<xs:enumeration value="Asia/Beirut"/>
<xs:enumeration value="Asia/Bishkek"/>
<xs:enumeration value="Asia/Brunei"/>
<xs:enumeration value="Asia/Choibalsan"/>
<xs:enumeration value="Asia/Chongqing"/>
<xs:enumeration value="Asia/Colombo"/>
<xs:enumeration value="Asia/Damascus"/>
<xs:enumeration value="Asia/Dhaka"/>
<xs:enumeration value="Asia/Dili"/>
<xs:enumeration value="Asia/Dubai"/>
<xs:enumeration value="Asia/Dushanbe"/>
<xs:enumeration value="Asia/Gaza"/>
<xs:enumeration value="Asia/Harbin"/>
<xs:enumeration value="Asia/Ho_Chi_Minh"/>
<xs:enumeration value="Asia/Hong_Kong"/>
<xs:enumeration value="Asia/Hovd"/>
<xs:enumeration value="Asia/Irkutsk"/>
<xs:enumeration value="Asia/Jakarta"/>
<xs:enumeration value="Asia/Jayapura"/>
<xs:enumeration value="Asia/Jerusalem"/>
<xs:enumeration value="Asia/Kabul"/>
<xs:enumeration value="Asia/Kamchatka"/>
<xs:enumeration value="Asia/Karachi"/>
<xs:enumeration value="Asia/Kashgar"/>
<xs:enumeration value="Asia/Katmandu"/>
<xs:enumeration value="Asia/Kolkata"/>
<xs:enumeration value="Asia/Krasnoyarsk"/>
<xs:enumeration value="Asia/Kuala_Lumpur"/>
<xs:enumeration value="Asia/Kuching"/>
<xs:enumeration value="Asia/Kuwait"/>
<xs:enumeration value="Asia/Macau"/>
<xs:enumeration value="Asia/Magadan"/>
<xs:enumeration value="Asia/Makassar"/>
<xs:enumeration value="Asia/Manila"/>
<xs:enumeration value="Asia/Muscat"/>
<xs:enumeration value="Asia/Nicosia"/>
<xs:enumeration value="Asia/Novosibirsk"/>
<xs:enumeration value="Asia/Omsk"/>
<xs:enumeration value="Asia/Oral"/>
<xs:enumeration value="Asia/Phnom_Penh"/>
<xs:enumeration value="Asia/Pontianak"/>
<xs:enumeration value="Asia/Pyongyang"/>
<xs:enumeration value="Asia/Qatar"/>
<xs:enumeration value="Asia/Qyzylorda"/>
<xs:enumeration value="Asia/Rangoon"/>
<xs:enumeration value="Asia/Riyadh"/>
<xs:enumeration value="Asia/Sakhalin"/>
<xs:enumeration value="Asia/Samarkand"/>
<xs:enumeration value="Asia/Seoul"/>
<xs:enumeration value="Asia/Shanghai"/>
<xs:enumeration value="Asia/Singapore"/>
<xs:enumeration value="Asia/Taipei"/>
<xs:enumeration value="Asia/Tashkent"/>
<xs:enumeration value="Asia/Tbilisi"/>
<xs:enumeration value="Asia/Tehran"/>
<xs:enumeration value="Asia/Thimphu"/>
<xs:enumeration value="Asia/Tokyo"/>
<xs:enumeration value="Asia/Ulaanbaatar"/>
<xs:enumeration value="Asia/Urumqi"/>
<xs:enumeration value="Asia/Vientiane"/>
<xs:enumeration value="Asia/Vladivostok"/>
<xs:enumeration value="Asia/Yakutsk"/>
<xs:enumeration value="Asia/Yekaterinburg"/>
<xs:enumeration value="Asia/Yerevan"/>
<xs:enumeration value="Atlantic/Azores"/>
<xs:enumeration value="Atlantic/Bermuda"/>
<xs:enumeration value="Atlantic/Canary"/>
<xs:enumeration value="Atlantic/Cape_Verde"/>
<xs:enumeration value="Atlantic/Faroe"/>
<xs:enumeration value="Atlantic/Madeira"/>
<xs:enumeration value="Atlantic/Reykjavik"/>
<xs:enumeration value="Atlantic/South_Georgia"/>
<xs:enumeration value="Atlantic/St_Helena"/>
<xs:enumeration value="Atlantic/Stanley"/>
<xs:enumeration value="Australia/Adelaide"/>
<xs:enumeration value="Australia/Brisbane"/>
<xs:enumeration value="Australia/Broken_Hill"/>
<xs:enumeration value="Australia/Currie"/>
<xs:enumeration value="Australia/Darwin"/>
<xs:enumeration value="Australia/Eucla"/>
<xs:enumeration value="Australia/Hobart"/>
<xs:enumeration value="Australia/Lindeman"/>
<xs:enumeration value="Australia/Lord_Howe"/>
<xs:enumeration value="Australia/Melbourne"/>
<xs:enumeration value="Australia/Perth"/>
<xs:enumeration value="Australia/Sydney"/>
<xs:enumeration value="Europe/Amsterdam"/>
<xs:enumeration value="Europe/Andorra"/>
<xs:enumeration value="Europe/Athens"/>
<xs:enumeration value="Europe/Belgrade"/>
<xs:enumeration value="Europe/Berlin"/>
<xs:enumeration value="Europe/Bratislava"/>
<xs:enumeration value="Europe/Brussels"/>
<xs:enumeration value="Europe/Bucharest"/>
<xs:enumeration value="Europe/Budapest"/>
<xs:enumeration value="Europe/Chisinau"/>
<xs:enumeration value="Europe/Copenhagen"/>
<xs:enumeration value="Europe/Dublin"/>
<xs:enumeration value="Europe/Gibraltar"/>
<xs:enumeration value="Europe/Guernsey"/>
<xs:enumeration value="Europe/Helsinki"/>
<xs:enumeration value="Europe/Isle_of_Man"/>
<xs:enumeration value="Europe/Istanbul"/>
<xs:enumeration value="Europe/Jersey"/>
<xs:enumeration value="Europe/Kaliningrad"/>
<xs:enumeration value="Europe/Kiev"/>
<xs:enumeration value="Europe/Lisbon"/>
<xs:enumeration value="Europe/Ljubljana"/>
<xs:enumeration value="Europe/London"/>
<xs:enumeration value="Europe/Luxembourg"/>
<xs:enumeration value="Europe/Madrid"/>
<xs:enumeration value="Europe/Malta"/>
<xs:enumeration value="Europe/Mariehamn"/>
<xs:enumeration value="Europe/Minsk"/>
<xs:enumeration value="Europe/Monaco"/>
<xs:enumeration value="Europe/Moscow"/>
<xs:enumeration value="Europe/Oslo"/>
<xs:enumeration value="Europe/Paris"/>
<xs:enumeration value="Europe/Podgorica"/>
<xs:enumeration value="Europe/Prague"/>
<xs:enumeration value="Europe/Riga"/>
<xs:enumeration value="Europe/Rome"/>
<xs:enumeration value="Europe/Samara"/>
<xs:enumeration value="Europe/San_Marino"/>
<xs:enumeration value="Europe/Sarajevo"/>
<xs:enumeration value="Europe/Simferopol"/>
<xs:enumeration value="Europe/Skopje"/>
<xs:enumeration value="Europe/Sofia"/>
<xs:enumeration value="Europe/Stockholm"/>
<xs:enumeration value="Europe/Tallinn"/>
<xs:enumeration value="Europe/Tirane"/>
<xs:enumeration value="Europe/Uzhgorod"/>
<xs:enumeration value="Europe/Vaduz"/>
<xs:enumeration value="Europe/Vatican"/>
<xs:enumeration value="Europe/Vienna"/>
<xs:enumeration value="Europe/Vilnius"/>
<xs:enumeration value="Europe/Volgograd"/>
<xs:enumeration value="Europe/Warsaw"/>
<xs:enumeration value="Europe/Zagreb"/>
<xs:enumeration value="Europe/Zaporozhye"/>
<xs:enumeration value="Europe/Zurich"/>
<xs:enumeration value="Indian/Antananarivo"/>
<xs:enumeration value="Indian/Chagos"/>
<xs:enumeration value="Indian/Christmas"/>
<xs:enumeration value="Indian/Cocos"/>
<xs:enumeration value="Indian/Comoro"/>
<xs:enumeration value="Indian/Kerguelen"/>
<xs:enumeration value="Indian/Mahe"/>
<xs:enumeration value="Indian/Maldives"/>
<xs:enumeration value="Indian/Mauritius"/>
<xs:enumeration value="Indian/Mayotte"/>
<xs:enumeration value="Indian/Reunion"/>
<xs:enumeration value="Pacific/Apia"/>
<xs:enumeration value="Pacific/Auckland"/>
<xs:enumeration value="Pacific/Chatham"/>
<xs:enumeration value="Pacific/Easter"/>
<xs:enumeration value="Pacific/Efate"/>
<xs:enumeration value="Pacific/Enderbury"/>
<xs:enumeration value="Pacific/Fakaofo"/>
<xs:enumeration value="Pacific/Fiji"/>
<xs:enumeration value="Pacific/Funafuti"/>
<xs:enumeration value="Pacific/Galapagos"/>
<xs:enumeration value="Pacific/Gambier"/>
<xs:enumeration value="Pacific/Guadalcanal"/>
<xs:enumeration value="Pacific/Guam"/>
<xs:enumeration value="Pacific/Honolulu"/>
<xs:enumeration value="Pacific/Johnston"/>
<xs:enumeration value="Pacific/Kiritimati"/>
<xs:enumeration value="Pacific/Kosrae"/>
<xs:enumeration value="Pacific/Kwajalein"/>
<xs:enumeration value="Pacific/Majuro"/>
<xs:enumeration value="Pacific/Marquesas"/>
<xs:enumeration value="Pacific/Midway"/>
<xs:enumeration value="Pacific/Nauru"/>
<xs:enumeration value="Pacific/Niue"/>
<xs:enumeration value="Pacific/Norfolk"/>
<xs:enumeration value="Pacific/Noumea"/>
<xs:enumeration value="Pacific/Pago_Pago"/>
<xs:enumeration value="Pacific/Palau"/>
<xs:enumeration value="Pacific/Pitcairn"/>
<xs:enumeration value="Pacific/Ponape"/>
<xs:enumeration value="Pacific/Port_Moresby"/>
<xs:enumeration value="Pacific/Rarotonga"/>
<xs:enumeration value="Pacific/Saipan"/>
<xs:enumeration value="Pacific/Tahiti"/>
<xs:enumeration value="Pacific/Tarawa"/>
<xs:enumeration value="Pacific/Tongatapu"/>
<xs:enumeration value="Pacific/Truk"/>
<xs:enumeration value="Pacific/Wake"/>
<xs:enumeration value="Pacific/Wallis"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
<!-- Please email any revisions to the Steward of the Master Model & Mapping artifacts at algotech@fixprotocol.org -->
<!-- Revision History -->
<!-- Date Version Author Comments
Authors - Greg Malatestinic, Rick Labs, Zoltan Feledy, Jim Arlet, Gideon Kaplan, Martin Naughton, Mike McDermott and other members of FPL Algo Trading WG.
-if there is anyone else then please speak up :-)
27Mar09 v2.6.6 by Mike McDermott
- Initial Version
10Jan10 v2.6.7 by John Shields
- removed trailing whitespace from timezone values
27Jan10 by v2.7.1 by Greg Malatestinic
- added xmlns:tz="http://www.fixprotocol.org/ATDL-1-1/Timezones"
22Feb v2.7.2 by Greg Malatestinic
- All xsd files renamed to fixatdl-{sub-schema}-1-1.xsd. Import/@schemaLocation adjusted accordingly.
- Namespaces changed to http://www.fixprotocol.org/FIXatdl-1-1/{sub-schema}
-->
@@ -0,0 +1,165 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- - - - - - - - - - - - - - - - - - - - - - - - - -
FIXatdl Sample document instance for FIXatdl Schema Version 1.1
(C) 2010 FIX Protocol Limited. All use of the FIXatdl Schema is subject to
the disclaimer which is printed on one of the initial pages of the written specification
for the FIXatdl Schema and is included in the zip file which you downloaded to
obtain the Schema.
Comments and errors should be posted on the FIX protocol web-site
http://www.fixprotocol.org
- - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:lay="http://www.fixprotocol.org/FIXatdl-1-1/Validation" xmlns:core="http://www.fixprotocol.org/FIXatdl-1-1/Core" targetNamespace="http://www.fixprotocol.org/FIXatdl-1-1/Validation" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.1">
<xs:annotation>
<xs:documentation>
This value is the internal build number of the ATDL Schema
</xs:documentation>
<xs:appinfo>
<BuildInfo buildNumber="2.7.2e20101221"/>
</xs:appinfo>
</xs:annotation>
<xs:import namespace="http://www.fixprotocol.org/FIXatdl-1-1/Core" schemaLocation="fixatdl-core-1-1.xsd"/>
<!-- Please email any suggestions or revisions to algotech@fixprotocol.org-->
<!-- Please note - Revision history is at the end of this xsd -->
<!--
Validation Sub-Schema
In order to validate the parameter values entered by the user the following sub-schema has been provided.
It enables the creation of complex and conditional validation rules that can be applied to the algorithmic
orders generated by an OMS or EMS. -->
<xs:element name="StrategyEdit" type="lay:StrategyEdit_t"/>
<xs:complexType name="StrategyEdit_t">
<xs:annotation>
<xs:documentation>Specifies a strategy-wide rule consisting of a boolean expression and an error message to be didsplayed when the boolean expression evaluates to False().</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element ref="core:Description" minOccurs="0">
<xs:annotation>
<xs:documentation>Optional description of the Strategy Edit.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:choice>
<xs:element name="Edit" type="lay:Edit_t">
<xs:annotation>
<xs:documentation>Boolean expression evaluated in validation and flow control rules. An Edit element will describe a condition that is either true or false.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="EditRef" type="lay:EditRef_t"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="errorMessage" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>The error message to display when the boolean expression defined by StrategyEdit/Edit evaluates to False.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:element name="Edit" type="lay:Edit_t"/>
<xs:complexType name="Edit_t">
<xs:annotation>
<xs:documentation>Construct used to build a boolean expression.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element ref="core:Description" minOccurs="0">
<xs:annotation>
<xs:documentation>Description of the Edit.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Edit" type="lay:Edit_t" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="EditRef" type="lay:EditRef_t" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="field" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>Field name for comparison. When the edit is used within a stateRule, this field must refer to the ID of a Control. When the edit is used within a strategyEdit, this field must refer to either the name of a parameter or a standard FIX field name. When referring to a standard FIX tag then the name must be pre-pended with the string “FIX_”, e.g. “FIX_OrderQty”.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="field2" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>Value used as the second operand. Used in conjunction with Edit/@field and Edit/@operator. Similar definition to Edit/@field except that it is mutually exclusive with Edit/@value.
Required when: Edit/@operator is in {GE, GT, LE, LT, EQ, NE} and Edit/@value is not specified.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="value" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>Value used as the second operand. Used in conjunction with Edit/@field and Edit/@operator. Represents a string literal value and not a reference.
When Edit is a descendant of a StateRule element, Edit/@value refers to the value of the control referred by Edit/@field. If the control referred by Edit/@field has enumerated values then Edit/@value refers to the enumID of one of the control’s ListItem elements.
When Edit is a descendant of a StrategyEdit element, Edit/@value refers to the wireValue of the parameter referred by Edit/@field.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="operator" type="lay:operator_t" use="optional">
<xs:annotation>
<xs:documentation>One of the following enumerated types: EX (Exists or supplied by user), NX (Does not exist or was not supplied), EQ (Equal), LT (Less than), GT (Greater than), NE (Not equal), LE (Less than equal), GE (Greater than equal). Required when logicOperator is not present. An edit element must contain either a logicOperator attribute or an operator attribute, but never both.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="logicOperator" type="lay:logicOperator_t" use="optional">
<xs:annotation>
<xs:documentation>Operator where operands are one or more Edit elements. Short-circuit evaluation is assumed in all edit statements. Valid values are one of the enumerations: AND, OR, XOR, NOT. Required when operator is not present. An edit element must contain either a logicOperator attribute or an operator attribute, but never both.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="id" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>Optional identifier. Allows for re-use of this edit within stateRule or editRef elements. This attribute is required if the Edit element is a direct child of either the Strategies or Strategy elements.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:element name="EditRef" type="lay:EditRef_t"/>
<xs:complexType name="EditRef_t">
<xs:attribute name="id" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>Refers to an ID of a previously defined edit element. The edit element may be defined at the strategy level or at the strategies level.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:simpleType name="operator_t">
<xs:restriction base="xs:string">
<xs:enumeration value="EX"/>
<xs:enumeration value="NX"/>
<xs:enumeration value="EQ"/>
<xs:enumeration value="NE"/>
<xs:enumeration value="LE"/>
<xs:enumeration value="LT"/>
<xs:enumeration value="GE"/>
<xs:enumeration value="GT"/>
<!-- exists -->
<!-- not exists -->
<!-- equal -->
<!-- not equal -->
<!-- less than or equal -->
<!-- less than -->
<!-- greater than or equal -->
<!-- greater than -->
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="logicOperator_t">
<xs:restriction base="xs:string">
<xs:enumeration value="AND"/>
<xs:enumeration value="OR"/>
<xs:enumeration value="XOR"/>
<xs:enumeration value="NOT"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
<!-- Please email any revisions to the Steward of the Master Model & Mapping artifacts at algotech@fixprotocol.org -->
<!-- Revision History -->
<!-- Date Version Author Comments
Authors - Greg Malatestinic, Rick Labs, Zoltan Feledy, Jim Arlet, Gideon Kaplan, Martin Naughton, Mike McDermott and other
members of FPL Algo Trading WG. - if there is anyone else then please speak up :-)
30Jan08 v2.5 by Robert Golan for uris, revision history, and version stamping.
14May08 v2.4.9 by Greg Malatestinic
- changes to <edit> to support tree-like expression structure. Added field2 attribute. logicOperator and operator
are mutually exclusive - one is required.
23Jan09 v2.5.6 by Martin Naughton and Mike McDermott
- added a description element to strategyEdit and edit
- added a reference to the Core schema to support the description element reference
16Feb09 v2.5.9 by Mike McDermott
- added a 'val' alias to the default namespace for consistency
- created a StrategyEdit_t complex type to conform with the existing pattern
22Feb v2.7.2 by Greg Malatestinic
- All xsd files renamed to fixatdl-{sub-schema}-1-1.xsd. Import/@schemaLocation adjusted accordingly.
- Namespaces changed to http://www.fixprotocol.org/FIXatdl-1-1/{sub-schema}
15Dec2010 v2.7.2e by Greg Malatestinic
- Sync'd documentation with specification document.
-->
+29 -16
View File
@@ -16,6 +16,11 @@ using bts.api.admin;
using System.Collections.Concurrent;
using System.Runtime.CompilerServices;
using QuickFix.FIX42;
using Message = QuickFix.Message;
using System.Threading;
using System.Threading.Tasks;
namespace bts.fix
{
class DropCopySession : SessionBase
@@ -67,18 +72,19 @@ namespace bts.fix
}
}
virtual public void OnMessage(QuickFix.FIX44.OrderStatusRequest req, SessionID s)
virtual public void OnMessage(OrderStatusRequest req, SessionID s)
{
uint oid = uint.Parse(req.OrderID.getValue());
if (_order_cache.TryGetValue(oid, out OrderRecordImmutable order))
{
var ostat = build_order_status(s, order);
ostat.OrdStatusReqID = new OrdStatusReqID(req.OrdStatusReqID.getValue());
//ostat.OrdStatusReqID = new OrdStatusReqID(req.OrdStatusReqID.getValue());
//TODO
_router.send(ostat, s);
}
}
virtual public void OnMessage(QuickFix.FIX44.SecurityDefinitionRequest req, SessionID s)
virtual public void OnMessage(SecurityDefinitionRequest req, SessionID s)
{
if (req.SecurityRequestType.getValue() == SecurityRequestType.REQUEST_LIST_SECURITIES)
{
@@ -90,24 +96,25 @@ namespace bts.fix
if (req.IsSetSecurityExchange())
secs = secs.Where(x => exchanges_equal(x.Exchange, req.SecurityExchange));
var def = new QuickFix.FIX44.SecurityDefinition(req.SecurityReqID,
var def = new SecurityDefinition(req.SecurityReqID,
new SecurityResponseID(Guid.NewGuid().ToString()),
new SecurityResponseType(SecurityResponseType.LIST_OF_SECURITIES_RETURNED_PER_REQUEST));
new TotalNumSecurities(secs.Count()));
_router.send(def, s);
}
else
throw new IncorrectTagValue(req.SecurityRequestType.Tag);
throw new IncorrectTagValue(QuickFix.Fields.Tags.SecurityRequestType);
}
virtual protected void subscribe_fills_and_orders(SessionID sessionID)
virtual async protected void subscribe_fills_and_orders(SessionID sessionID)
{
var scheduler = TaskPoolScheduler.Default;
var interval = TimeSpan.FromMilliseconds(500);
var on_orders = _orderservice.Value.subscribei_orders().Naggle(interval, scheduler).PermissionFilter(_adminobservable).Table().Cache();
var on_fills = _orderservice.Value.subscribei_fills().Naggle(interval, scheduler).PermissionFilter(_adminobservable).Table().Cache();
var odone = new TaskCompletionSource<int>();
_ordersdisp = on_orders.Subscribe(o =>
{
foreach (var order in o.added)
@@ -121,8 +128,10 @@ namespace bts.fix
var ostat = build_order_status(sessionID, order, true);
_router.send(ostat, sessionID);
}
odone.TrySetResult(0);
});
await odone.Task;
_fillsdisp = on_fills.Subscribe(f =>
{
foreach (var fill in f.added)
@@ -148,7 +157,7 @@ namespace bts.fix
fstatus = translate_status(state, ref native);
}
protected bts.api.SecurityImmutable? resolve_execution_report_security(bts.api.SecurityImmutable? sec, QuickFix.FIX44.ExecutionReport report)
protected bts.api.SecurityImmutable? resolve_execution_report_security(bts.api.SecurityImmutable? sec, ExecutionReport report)
{
report.SecurityExchange = convert_exchange(sec.Value.Exchange);
var sectype = sec.Value.security_type();
@@ -171,14 +180,15 @@ namespace bts.fix
return sec;
}
virtual protected QuickFix.FIX44.ExecutionReport build_fill(SessionID sess, in FillImmutable fill, bool change = false)
virtual protected ExecutionReport build_fill(SessionID sess, in FillImmutable fill, bool change = false)
{
var exec = new QuickFix.Fields.ExecType(QuickFix.Fields.ExecType.PARTIAL_FILL);
QuickFix.Fields.OrdStatus status = new QuickFix.Fields.OrdStatus();
uint filled = 0; uint leaves = 0; double prx = 0.0;
uint filled = 0; uint leaves = 0; double prx = 0.0; uint orig_qty = 0;
OrderRecordImmutable order; NativeOrderStateImmutable? native = null;
if (_order_cache.TryGetValue(fill.OrderKey, out order))
{
orig_qty = order.State.Quantity;
process_order_state(order.State, ref filled, ref leaves, ref prx, ref status, ref native);
if(Convert.ToDouble(order.State.Quantity) == fill.LastShares)
exec = new QuickFix.Fields.ExecType(QuickFix.Fields.ExecType.FILL);
@@ -187,9 +197,10 @@ namespace bts.fix
exec = new QuickFix.Fields.ExecType(QuickFix.Fields.ExecType.TRADE_CORRECT);
var sec = _router.lookup(fill.SecurityKey);
QuickFix.FIX44.ExecutionReport report = new QuickFix.FIX44.ExecutionReport(
ExecutionReport report = new ExecutionReport(
new OrderID(fill.OrderKey.ToString()),
new ExecID(fill.FillKey.ToString()),
new ExecID(fill.FillKey.ToString()),
new QuickFix.Fields.ExecTransType( ExecTransType.NEW ),
exec,
status,
new Symbol(sec?.Symbol ?? string.Empty),
@@ -199,7 +210,8 @@ namespace bts.fix
new AvgPx(Convert.ToDecimal(prx)));
report.Account = new Account(fill.Account);
report.LastQty = new LastQty(Convert.ToDecimal(fill.LastShares));
report.OrderQty = new OrderQty(orig_qty);
report.LastShares = new LastShares(Convert.ToDecimal(fill.LastShares));
report.LastPx = new LastPx(Convert.ToDecimal(fill.LastPrice));
var ts = fill.HasTimestamp ? fill.Timestamp.ToDateTime() : DateTime.MinValue;
report.TransactTime = new TransactTime(ts, true);
@@ -219,7 +231,7 @@ namespace bts.fix
return report;
}
virtual protected QuickFix.FIX44.ExecutionReport build_order_status(SessionID sess, in OrderRecordImmutable order, bool change = false)
virtual protected ExecutionReport build_order_status(SessionID sess, in OrderRecordImmutable order, bool change = false)
{
var exec = new QuickFix.Fields.ExecType(QuickFix.Fields.ExecType.NEW);
if (_order_cache.TryGetValue(order.Key, out OrderRecordImmutable _))
@@ -230,9 +242,10 @@ namespace bts.fix
process_order_state(order.State, ref filled, ref leaves, ref prx, ref status, ref native);
var sec = _router.lookup(order.Def.SecurityKey);
QuickFix.FIX44.ExecutionReport report = new QuickFix.FIX44.ExecutionReport(
ExecutionReport report = new ExecutionReport(
new OrderID(order.Key.ToString()),
new ExecID("0"),
new QuickFix.Fields.ExecTransType(ExecTransType.STATUS),
exec,
status,
new Symbol(sec?.Symbol ?? string.Empty),
+95 -71
View File
@@ -9,19 +9,28 @@ using QuickFix.Fields;
using bts.api;
using bts.api.orderman;
using QuickFix.FIX42;
using Message = QuickFix.Message;
namespace bts.fix
{
/* Some test fix
order for 4 lot CLZ8
8=FIX.4.49=15635=D49=SPARK56=CLIENT134=150=3073797=Y52=20000809-20:20:5011=900010081=ACC A21=255=SIM:CLZ854=138=440=259=044=7460=20000809-18:20:32207=SIM10=045
order for 4 lot CLZ8-CLH9
8=FIX.4.49=15635=D49=SPARK56=CLIENT134=150=3073797=Y52=20000809-20:20:5011=900010081=ACC A21=255=SIM:CLZ8-CLH954=138=440=259=044=7460=20000809-18:20:32207=SIM10=045
*/
/*
create limit
8=FIX.4.29=15635=D49=CQG56=SPARK34=150=3073797=N52=20200109-20:20:5011=900010081=ACC A21=255=SIM:ESH0207=SIM54=160=20200809-18:20:3238=1040=244=320059=010=129
update limit
8=FIX.4.29=11035=G49=CQG56=SPARK37=1341=9000100811=9000200821=155= ESH054=160=20200113-19:45:2938=1040=244=320110=017
delete limit
8=FIX.4.29=9335=F49=CQG56=SPARK41= 9000100837=1311=9000300855=ESH054=160=20200113-19:45:2738=1010=247
create algo
8=FIX.4.29=15635=D49=CQG56=SPARK34=150=3073797=N52=20200109-20:20:5011=900010081=ACC A21=255=SIM:ESH0207=SIM54=160=20200809-18:20:3238=1040=244=320059=06401=Lean8401=118402=28405=010=128
*/
class OrderSession : DropCopySession
{
readonly ATDL _atdl = new ATDL();
public OrderSession(IFixRouter router, SessionID sess) : base(router, sess)
{
}
@@ -47,11 +56,11 @@ namespace bts.fix
}
}
virtual public void OnMessage(QuickFix.FIX44.OrderCancelRequest cancel, SessionID s)
virtual public void OnMessage(OrderCancelRequest cancel, SessionID s)
{
var id = cancel.OrderID.getValue();
if(!uint.TryParse(id, out uint key))
throw new IncorrectTagValue(cancel.OrderID.Tag);
throw new IncorrectTagValue(QuickFix.Fields.Tags.OrderID);
var resp = _orderservice.Value.cancel_order(new Cancel { OrderKey = key });
if (resp.ErrorCode != OrderError.Ok)
{
@@ -59,108 +68,123 @@ namespace bts.fix
}
}
virtual public void OnMessage(QuickFix.FIX44.OrderCancelReplaceRequest replace, SessionID s)
virtual public void OnMessage(OrderCancelReplaceRequest replace, SessionID s)
{
var id = replace.OrderID.getValue();
if (!uint.TryParse(id, out uint key))
throw new IncorrectTagValue(replace.OrderID.Tag);
throw new IncorrectTagValue(QuickFix.Fields.Tags.OrderID);
double price = Convert.ToDouble(replace.Price.getValue());
uint sz = Convert.ToUInt32(Math.Abs(replace.OrderQty.getValue()));
var resp = _orderservice.Value.update_order(new Update
var upd = new Update
{
OrderKey = key,
Price = price,
Quantity = sz,
});
Custom = get_custom(replace),
};
var resp = _orderservice.Value.update_order(upd);
if (resp.ErrorCode != OrderError.Ok)
{
send_cancel_reject(s, "Cancel Rejected: " + resp.ErrorCode.ToString() + " - " + resp.Msg, replace);
}
}
virtual public void OnMessage(QuickFix.FIX44.NewOrderSingle create, SessionID s)
virtual public void OnMessage(NewOrderSingle create, SessionID s)
{
Venue ven = convert_exchange(create.SecurityExchange);
Venue ven = Venue.Glbx;
if(create.IsSetSecurityExchange())
ven = convert_exchange(create.SecurityExchange);
if(create.IsSetExDestination())
ven = convert_exchange(create.ExDestination);
if (ven == bts.api.Venue.Unset)
throw new IncorrectTagValue(create.SecurityExchange.Tag);
throw new IncorrectTagValue(QuickFix.Fields.Tags.SecurityExchange);
var sec = _router.lookup(create.Symbol.getValue());
if (!sec.HasValue)
sec = _router.lookup(create.SecurityDesc.getValue());
if (!sec.HasValue)
throw new IncorrectTagValue(create.SecurityDesc.Tag);
throw new IncorrectTagValue(QuickFix.Fields.Tags.Symbol);
OrderDefinition def = null;
try
{
string manual = "Y";
if(create.IsSetField(Tags.ManualOrderIndicator))
manual = create.GetField(Tags.ManualOrderIndicator);
def = new OrderDefinition()
{
Account = create.Account.getValue(),
AccountId = lookup_account(create.Account.getValue()),
SecurityKey = sec.Value.Id,
Side = (api.Side)(int)create.Side.getValue(),
TimeInForce = (api.orderman.TimeInForce)(int)create.TimeInForce.getValue(),
User = _user_name,
UserId = lookup_user(_user_name),
ManualOrderIndicator = manual == "Y" ? bts.api.orderman.ManualOrderIndicator.Yes : bts.api.orderman.ManualOrderIndicator.No,
};
}
catch
{
throw new IncorrectTagValue(create.TimeInForce.Tag);
}
OrderDefinition def = (OrderDefinition)ProtoFix.create_message(OrderDefinition.Descriptor, create);
def.SecurityKey = sec.Value.Id;
def.User = _login_name;
def.UserId = lookup_user(_login_name);
def.AccountId = lookup_account(def.Account);
set_ordertype(def, create, out bool price_req);
Create cr = new Create();
cr.NewOrder = def;
def.CustomDef = get_custom(create);
cr.NewOrder = def;
try
{
if (price_req)
if (create.IsSetPrice())
cr.Price = Convert.ToDouble(create.Price.getValue());
}
catch
{
throw new IncorrectTagValue(create.Price.Tag);
}
catch { throw new IncorrectTagValue(QuickFix.Fields.Tags.Price); }
try
{
if(!create.IsSetOrderQty() || create.OrderQty.getValue() < 0)
throw new IncorrectTagValue(QuickFix.Fields.Tags.OrderQty);
cr.Quantity = Convert.ToUInt32(Math.Abs(create.OrderQty.getValue()));
}
catch
{
throw new IncorrectTagValue(create.OrderQty.Tag);
}
catch { throw new IncorrectTagValue(QuickFix.Fields.Tags.OrderQty); }
if(!create.IsSetClOrdID())
throw new IncorrectTagValue(QuickFix.Fields.Tags.ClOrdID);
var resp = _orderservice.Value.create_order(cr);
_fix_clorderids[resp.OrderKey] = create.ClOrdID.getValue();
if (resp.ErrorCode != OrderError.Ok)
{
_router.send_biz_reject(s, "Order Rejected: " + resp.ErrorCode.ToString() + " - " + resp.Msg, create);
}
}
private void set_ordertype(OrderDefinition def, QuickFix.FIX44.NewOrderSingle req, out bool price_req)
CustomOrderDefinition get_custom(Message fix)
{
price_req = false;
switch (req.OrdType.getValue())
FIXAlgoDefinition.Descriptor.FindFieldByNumber(FIXAlgoDefinition.NameFieldNumber).
CustomOptions.TryGetInt32((int)ApioptionsReflection.FieldOptions.fix_tag, out int algotag);
if(fix.IsSetField(algotag))
{
case '1':
def.CustomDef = new CustomOrderDefinition { Market = new MarketOrderDefinition() };
break;
case '2':
def.CustomDef = new CustomOrderDefinition { Limit = new LimitOrderDefinition() };
price_req = true;
break;
case '3':
def.CustomDef = new CustomOrderDefinition { Stop = new StopOrderDefinition() {StopPrice = Convert.ToDouble(req.StopPx.getValue()) } };
break;
case '4':
def.CustomDef = new CustomOrderDefinition { StopLimit = new StopLimitOrderDefinition() { StopPrice = Convert.ToDouble(req.StopPx.getValue()) } };
price_req = true;
break;
default:
throw new IncorrectTagValue(req.OrdType.Tag);
string algotype = fix.GetString(algotag);
if(!_atdl.algo_definitions.TryGetValue(algotype, out FIXAlgoDefinition algodef))
throw new IncorrectTagValue(algotag);
else
{
var custom = algodef.Definition.Clone();
var imsg = ATDL.extract_order_from_custom(custom);
ProtoFix.fix_to_imsg(imsg, fix);
return custom;
}
}
else
{
if(!fix.IsSetField(QuickFix.Fields.Tags.OrdType))
throw new IncorrectTagValue(QuickFix.Fields.Tags.OrdType);
switch (fix.GetChar(QuickFix.Fields.Tags.OrdType))
{
case '1':
return new CustomOrderDefinition { Market = new MarketOrderDefinition() };
case '2':
{
if(fix.IsSetField(QuickFix.Fields.Tags.MaxShow))
return new CustomOrderDefinition { GlbxIceberg =
new GLBXIcebergOrderDefinition() { MaxShowQuantity = (uint)Math.Abs(fix.GetInt(QuickFix.Fields.Tags.MaxShow)) }};
else
return new CustomOrderDefinition { Limit = new LimitOrderDefinition() };
}
case '3':
return new CustomOrderDefinition { Stop = new StopOrderDefinition()
{
StopPrice = Convert.ToDouble(fix.GetDecimal(QuickFix.Fields.Tags.StopPx)) }
};
case '4':
return new CustomOrderDefinition { StopLimit = new StopLimitOrderDefinition()
{
StopPrice = Convert.ToDouble(fix.GetDecimal(QuickFix.Fields.Tags.StopPx)) }
};
default:
throw new IncorrectTagValue(QuickFix.Fields.Tags.OrdType);
}
}
}
}
+34 -17
View File
@@ -17,6 +17,8 @@ using bts.api.orderman;
using bts.api.user;
using bts.api.admin;
using QuickFix.FIX42;
using Message = QuickFix.Message;
namespace bts.fix
{
@@ -27,7 +29,7 @@ namespace bts.fix
protected static Lazy<bts.metrics.ShellLatencyService> _latencyservice =
new Lazy<bts.metrics.ShellLatencyService>(() => bts.api.Locator.locate<bts.metrics.ShellLatencyService>(), true);
protected string _user_name;
protected string _login_name;
protected AuthToken _token;
protected IDisposable _admindisp;
@@ -51,7 +53,7 @@ namespace bts.fix
_adminobservable = _adminservice.Value.subscribei_admin_data().Select(x =>
{
return new AdminModelWrapper(x.all.TryFirst(), _user_name);
return new AdminModelWrapper(x.all.TryFirst(), _login_name);
});
_admindisp = _adminobservable.Subscribe(x => _admin_data = x.admin_data);
}
@@ -78,13 +80,18 @@ namespace bts.fix
{
try
{
QuickFix.FIX44.Logon msg = (QuickFix.FIX44.Logon)message;
_user_name = msg.Username.getValue();
string pass = string.Empty;
if(msg.IsSetPassword())
pass = msg.Password.getValue();
Logon msg = (Logon)message;
var fixlogin = new QuickFix.Fields.SenderCompID();
string login = msg.Header.GetString(fixlogin.Tag).ToLower();
// var fixuser = new QuickFix.Fields.TargetSubID();
// string user = msg.Header.GetString(fixuser.Tag);
_login_name = login;
string pass = string.Empty;
if(msg.IsSetRawData())
pass = msg.RawData.getValue();
var resp = _authservice.authenticate_login(new AuthenticateLoginRequest {
Login = msg.Username.getValue(), Password = pass});
Login = login, Password = pass});
if (resp != null && resp.IsValid)
_token = resp.Token;
else
@@ -102,7 +109,7 @@ namespace bts.fix
break;
case MsgType.HEARTBEAT:
{
QuickFix.FIX44.Heartbeat hb = (QuickFix.FIX44.Heartbeat)message;
Heartbeat hb = (Heartbeat)message;
handle_heartbeat(hb, sessionID);
}
break;
@@ -112,10 +119,10 @@ namespace bts.fix
}
}
async protected void handle_heartbeat(QuickFix.FIX44.Heartbeat hb, SessionID sessionID)
async protected void handle_heartbeat(Heartbeat hb, SessionID sessionID)
{
var resp = await _latencyservice.Value.report_async(new bts.metrics.Report { HostName = "BTSFIX_" + sessionID.ToString(),
Timestamp = _clock, User = _user_name });
Timestamp = _clock, User = _login_name });
if (resp.success)
_router.send(hb, sessionID);
}
@@ -131,12 +138,12 @@ namespace bts.fix
log_info("CREATE");
}
virtual public void OnMessage(QuickFix.FIX44.BusinessMessageReject n, SessionID s)
virtual public void OnMessage(BusinessMessageReject n, SessionID s)
{
//Log.assert(false, "biz reject wtf " + n.EncodedText.getValue());
Log.FIX.warn(_sess.ToString() + " Business Reject " + n.BusinessRejectReason.getValue() + " " + n.Text.getValue());
}
virtual public void OnMessage(QuickFix.FIX44.News n, SessionID s)
virtual public void OnMessage(News n, SessionID s)
{
log_info("news " + n.EncodedHeadline.getValue());
}
@@ -154,8 +161,8 @@ namespace bts.fix
protected void send_cancel_reject(SessionID sess, string text, Message refmessage)
{
QuickFix.FIX44.OrderCancelReject rej = new QuickFix.FIX44.OrderCancelReject();
if (refmessage is QuickFix.FIX44.OrderCancelRequest cancel)
OrderCancelReject rej = new OrderCancelReject();
if (refmessage is QuickFix.FIX42.OrderCancelRequest cancel)
{
if (cancel.IsSetClOrdID())
rej.SetField(cancel.ClOrdID);
@@ -167,7 +174,7 @@ namespace bts.fix
rej.Text = new Text(text);
_router.send(rej, sess);
}
else if (refmessage is QuickFix.FIX44.OrderCancelReplaceRequest replace)
else if (refmessage is OrderCancelReplaceRequest replace)
{
if (replace.IsSetClOrdID())
rej.SetField(replace.ClOrdID);
@@ -255,7 +262,17 @@ namespace bts.fix
protected bts.api.Venue convert_exchange(QuickFix.Fields.SecurityExchange fixtype)
{
switch (fixtype.getValue())
return convert_exchange(fixtype.getValue());
}
protected bts.api.Venue convert_exchange(QuickFix.Fields.ExDestination fixtype)
{
return convert_exchange(fixtype.getValue());
}
protected bts.api.Venue convert_exchange(string venue)
{
switch (venue)
{
case "BTS":
return bts.api.Venue.Bts;
+90
View File
@@ -0,0 +1,90 @@
{
"algoStrategy": [
{
"name": "TickAndCover",
"definition":
{
"cover":
{
"child":
{
"top": { "child": { "limit": {} } }
},
"hedge":
{
"lean": { "child": { "limit": {} } }
}
}
}
},
{
"name": "SmashAndCover",
"definition":
{
"cover":
{
"child":
{
"lean": { "child": { "limit": {} } }
},
"hedge":
{
"lean": { "child": { "limit": {} } }
}
}
}
},
{
"name": "JoinAndCover",
"definition":
{
"cover":
{
"child":
{
"join": { "child": { "limit": {} } }
},
"hedge":
{
"lean": { "child": { "limit": {} } }
}
}
}
},
{
"name": "Prorata",
"definition":
{
"prorata":
{
"child": { "limit": {} },
"hedge":
{
"scratch": { "child": { "limit": {} } }
},
"overfill_hedge":
{
"lean": { "child": { "limit": {} } }
}
}
}
},
{ "name": "Top", "definition": { "top": { "child": { "limit": {} } } } },
{ "name": "Cover",
"definition":
{
"cover":
{
"child" : { "limit": {} },
"hedge" : { "limit": {} }
}
}
},
{ "name": "Lean", "definition": { "lean": { "child": { "limit": {} } } } },
{ "name": "Join", "definition": { "join": { "child": { "limit": {} } } } },
{ "name": "Iceberg", "definition": { "iceberg": { "child": { "limit": {} } } } },
{ "name": "Scratch", "definition": { "scratch": { "child": { "limit": {} } } } },
{ "name": "ISpreader", "definition": { "iceberg": { "child": { "spreader": {} } } } },
{ "name": "Spreader", "definition": { "spreader": { } } }
]
}
+6 -6
View File
@@ -8,7 +8,7 @@ SocketReuseAddress=Y
StartTime=00:00:00
EndTime=00:00:00
FileLogPath=log
UseDataDictionary=Y
UseDataDictionary=N
ResetOnLogon=Y
ResetOnLogout=Y
ResetOnDisconnect=Y
@@ -27,16 +27,16 @@ SSLEnable=N
[SESSION]
BeginString=FIX.4.4
BeginString=FIX.4.2
SenderCompID=SPARK
TargetCompID=CLIENT1
TargetCompID=CQG
FileStorePath=store
DataDictionary=./spec/fix/FIX44.xml
DataDictionary=./spec/fix/FIX42.xml
[SESSION]
BeginString=FIX.4.4
BeginString=FIX.4.2
SenderCompID=SPARK
TargetCompID=CLIENT2
FileStorePath=store
DataDictionary=./spec/fix/FIX44.xml
DataDictionary=./spec/fix/FIX42.xml
+27 -3
View File
@@ -21,21 +21,45 @@
<PackageReference Include="NUnit" Version="3.10.1" />
<PackageReference Include="QuickFix.Net.NETCore" Version="1.8.1" />
<PackageReference Include="QuickFix.Net.NETCore.FIX44" Version="1.8.1" />
<PackageReference Include="QuickFix.Net.NETCore.FIX42" Version="1.8.1" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
</ItemGroup>
<ItemGroup Condition = " '$(OS)' == 'Windows_NT' ">
<Reference Include="fixatdl">
<HintPath>../../../externals/windows/lib/debug/Atdl4net.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../spark_api/spark_api.csproj"/>
<ProjectReference Include="../spark_core/spark_core.csproj"/>
</ItemGroup>
<Target Name="copy_fix" AfterTargets="PostBuildEvent" >
<Copy SourceFiles="./spark_fix.cfg" DestinationFolder="$(OutputPath)\" SkipUnchangedFiles="true" />
<Copy SourceFiles="./spark_fix.cfg" DestinationFolder="$(OutputPath)/" SkipUnchangedFiles="true" />
<Copy SourceFiles="./spark_algos.json" DestinationFolder="$(OutputPath)/" SkipUnchangedFiles="true" />
<Copy SourceFiles="./spec/fix/FIX42.xml" DestinationFolder="$(OutputPath)/spec/fix/" SkipUnchangedFiles="true" />
<Copy SourceFiles="./spec/fix/FIX44.xml" DestinationFolder="$(OutputPath)/spec/fix/" SkipUnchangedFiles="true" />
<Copy SourceFiles="./atdl/schema/fixatdl-core-1-1.xsd" DestinationFolder="$(OutputPath)/atdl/schema/" SkipUnchangedFiles="true" />
<Copy SourceFiles="./atdl/schema/fixatdl-flow-1-1.xsd" DestinationFolder="$(OutputPath)/atdl/schema/" SkipUnchangedFiles="true" />
<Copy SourceFiles="./atdl/schema/fixatdl-layout-1-1.xsd" DestinationFolder="$(OutputPath)/atdl/schema/" SkipUnchangedFiles="true" />
<Copy SourceFiles="./atdl/schema/fixatdl-regions-1-1.xsd" DestinationFolder="$(OutputPath)/atdl/schema/" SkipUnchangedFiles="true" />
<Copy SourceFiles="./atdl/schema/fixatdl-timezones-1-1.xsd" DestinationFolder="$(OutputPath)/atdl/schema/" SkipUnchangedFiles="true" />
<Copy SourceFiles="./atdl/schema/fixatdl-validation-1-1.xsd" DestinationFolder="$(OutputPath)/atdl/schema/" SkipUnchangedFiles="true" />
</Target>
<Target Name="copy_fix471" AfterTargets="PostBuildEvent" >
<Copy SourceFiles="./spark_fix.cfg" DestinationFolder="$(OutputPath)/../net471" SkipUnchangedFiles="true" />
<Copy SourceFiles="./spark_algos.json" DestinationFolder="$(OutputPath)/../net471" SkipUnchangedFiles="true" />
<Copy SourceFiles="./spec/fix/FIX42.xml" DestinationFolder="$(OutputPath)/../net471/spec/fix/" SkipUnchangedFiles="true" />
<Copy SourceFiles="./spec/fix/FIX44.xml" DestinationFolder="$(OutputPath)/../net471/spec/fix/" SkipUnchangedFiles="true" />
<Copy SourceFiles="./atdl/schema/fixatdl-core-1-1.xsd" DestinationFolder="$(OutputPath)/../net471/atdl/schema/" SkipUnchangedFiles="true" />
<Copy SourceFiles="./atdl/schema/fixatdl-flow-1-1.xsd" DestinationFolder="$(OutputPath)/../net471/atdl/schema/" SkipUnchangedFiles="true" />
<Copy SourceFiles="./atdl/schema/fixatdl-layout-1-1.xsd" DestinationFolder="$(OutputPath)/../net471/atdl/schema/" SkipUnchangedFiles="true" />
<Copy SourceFiles="./atdl/schema/fixatdl-regions-1-1.xsd" DestinationFolder="$(OutputPath)/../net471/atdl/schema/" SkipUnchangedFiles="true" />
<Copy SourceFiles="./atdl/schema/fixatdl-timezones-1-1.xsd" DestinationFolder="$(OutputPath)/../net471/atdl/schema/" SkipUnchangedFiles="true" />
<Copy SourceFiles="./atdl/schema/fixatdl-validation-1-1.xsd" DestinationFolder="$(OutputPath)/../net471/atdl/schema/" SkipUnchangedFiles="true" />
</Target>
</Project>
+8 -1
View File
@@ -1,6 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;net471</TargetFrameworks>
<TargetFrameworks>net471</TargetFrameworks>
<RuntimeIdentifiers>win7-x64</RuntimeIdentifiers>
<TargetFrameworks Condition = " '$(OS)' != 'Windows_NT' ">netcoreapp3.1</TargetFrameworks>
<RuntimeIdentifier Condition = " '$(OS)' != 'Windows_NT' ">linux-x64</RuntimeIdentifier>
<PublishTrimmed>true</PublishTrimmed>
<PublishSingleFile>true</PublishSingleFile>
<OutputType>Exe</OutputType>
<GeneratePackageOnBuild Condition="$(Configuration) == 'Release' or $(Configuration) == 'Release'">true</GeneratePackageOnBuild>
<PackageOutputPath>$(OutputPath)\net471</PackageOutputPath>
+1 -1
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<Platform>x64</Platform>
<PlatformTarget>x64</PlatformTarget>
+24 -2
View File
@@ -9,13 +9,13 @@ namespace bts
[Verb("fix", HelpText = "Fix command")]
public class FIXCommandOptions
{
[Option('f', "config", Required = true)]
[Option('f', "config", Required = false, Default = "./spark_fix.cfg")]
public string config_file { get; set; }
[Option('i', "initiator", Default = false, Required = false)]
public bool initiator{ get; set; }
[Option('w', "http", Required = false)]
[Option('w', "http", Required = false, Default = "http://127.0.0.1:5080/")]
public string http{ get; set; }
[Option('o', "order_session", Default = false, Required = false)]
@@ -23,6 +23,18 @@ namespace bts
[Option('d', "dropcopy_only", Default = false, Required = false)]
public bool dropcopy_only { get; set; }
[Option('e', "algo_import_file", Default = ATDL.default_algo_import_path, Required = false)]
public string algo_import_file { get; set; }
[Option('e', "export_atdl_path", Default = null, Required = false)]
public string export_atdl_path { get; set; }
[Option('e', "validate_atdl_path", Default = null, Required = false)]
public string validate_atdl_path { get; set; }
[Option('s', "export_single_file", Default = false, Required = false)]
public bool export_single_file { get; set; }
}
public class FIXCommand
@@ -48,6 +60,16 @@ namespace bts
Console.WriteLine("Initiator not supported yet");
return -1;
}
else if(opt.export_atdl_path != null)
{
new ATDL(opt.algo_import_file).write_fix_atdl(opt.export_atdl_path, opt.export_single_file);
return 0;
}
else if (opt.validate_atdl_path != null)
{
ATDL.validate_fix_atdl(opt.validate_atdl_path);
return 0;
}
string[] args = Parser.Default.FormatCommandLine(opt).Split(' ');
var res = Parser.Default.ParseArguments<FIXCommandOptions>(args);
var help = CommandLine.Text.HelpText.AutoBuild(res, h => h, r => r).ToString();
+7 -3
View File
@@ -2,8 +2,13 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net471;netcoreapp2.1</TargetFrameworks>
<RuntimeIdentifiers>win7-x64;ubuntu.16.04-x64</RuntimeIdentifiers>
<TargetFramework>net471</TargetFramework>
<TargetFramework Condition = " '$(OS)' != 'Windows_NT' ">netcoreapp3.1</TargetFramework>
<RuntimeIdentifier Condition = " '$(OS)' != 'Windows_NT' ">linux-x64</RuntimeIdentifier>
<PublishTrimmed>true</PublishTrimmed>
<PublishSingleFile>true</PublishSingleFile>
<Authors>Blue Trading Systems</Authors>
<Company>Blue Trading Systems</Company>
<Product>Spark</Product>
@@ -17,7 +22,6 @@
<ProjectReference Include="../spark_api/spark_api.csproj" />
<!--<ProjectReference Include="..\spark\Spark.csproj" />-->
<ProjectReference Include="..\spark_core\spark_core.csproj" />
<ProjectReference Include="..\spark_fix\spark_fix.csproj" />
<ProjectReference Include="..\spark_test\spark_test.csproj" />
<ProjectReference Include="../spark_fix/spark_fix.csproj" />
<!--<Proto3 Include="**/*.proto" />-->
-1
View File
@@ -1 +0,0 @@
set(sources files/cert_secure_logon.txt;files/futures.coconut.xz;files/onixs_ice/ConnectivityConfiguration.APITest.xml;files/onixs_ice/ConnectivityConfiguration.PerfTest.xml;files/onixs_ice/ConnectivityConfiguration.Production.xml;files/perf_trace/compiled.css;files/perf_trace/index.html;files/perf_trace/jquery-3.3.1.min.js;files/perf_trace/main.js;files/perf_trace/perf_log.sql;files/perf_trace/perf_trace_analysis.sql;files/perf_trace/plotly-latest.min.js)
-1
View File
@@ -1 +0,0 @@
set(sources api/apicore.proto;api/apigateway.proto;api/apioptions.proto;api/core/ApiClientInterop.cpp;api/core/ApiServerInterop.cpp;api/public/ApiServer.cpp;api/public/ClientChannel.cpp;api/public/QuickbusClientChannel.cpp;api/public/ServerChannel.cpp;api/public/ServiceContext.cpp;api/service_helpers/AdminServiceUtils.cpp;api/service_helpers/AlgoServiceUtils.cpp;api/service_helpers/PositionUtilities.cpp;api/services/AdminService.proto;api/services/AlgoDefinitionService.proto;api/services/AlgoService.proto;api/services/ApiUnitTestService.proto;api/services/AuthService.proto;api/services/BasePositionService.proto;api/services/ErrorReportService.proto;api/services/HelloService.proto;api/services/MBOService.proto;api/services/MarginService.proto;api/services/MarketDataAuxiliaryService.proto;api/services/MarketDataRelay.proto;api/services/MoneyFileService.proto;api/services/OrderService.proto;api/services/OutOfProcessURLListener.proto;api/services/PersistenceService.proto;api/services/PositionService.proto;api/services/ShellDiagnosticService.proto;api/services/ShellLatencyService.proto;api/services/SyntheticSecurityService.proto;api/test/ApiTests.cpp;api/test/HelloServiceServer.cpp;config/ConfigCheck.cpp;config/ConfigDownloader.cpp;config/ConfigErrorCollector.cpp;config/ConfigLog.cpp;config/ConfigPropertyEvaluator.cpp;config/ConfigValueQueue.cpp;config/ConfigurationException.cpp;config/ConfigurationState.cpp;config/PreprocessInputStream.cpp;config/config.cpp;config/defaults/MarketData.conf;config/defaults/Ports.conf;config/defaults/Symbols.conf;config/defaults/cme_reference_data.conf;config/defaults/edge.conf;config/defaults/jetfix.conf;config/defaults/keycode.conf;config/defaults/logging.conf;config/defaults/orderman_cfg.conf;config/defaults/orders_fills_cleanup.conf;config/defaults/position_cfg.conf;config/defaults/span.conf;config/defaults/spreader.conf;config/defaults/testkeys.conf;config/defaults/threads.conf;config/defaults/toggles.conf;config/extensions/extensions.proto;config/invalid/invalid.proto;config/protos/ExchangeSimCfg.proto;config/protos/MarketData.proto;config/protos/Ports.proto;config/protos/Symbols.proto;config/protos/UI.proto;config/protos/cme_reference_data.proto;config/protos/jetfix.proto;config/protos/keycode.proto;config/protos/logging.proto;config/protos/mercury_cfg.proto;config/protos/orderman_cfg.proto;config/protos/orders_fills_cleanup.proto;config/protos/perflog_cfg.proto;config/protos/position_cfg.proto;config/protos/quickbus_cfg.proto;config/protos/span.proto;config/protos/spreader.proto;config/protos/system.proto;config/protos/testkeys.proto;config/protos/threads.proto;config/protos/toggles.proto;config/tests/HTTPServer.cpp;config/tests/config_ref_tests.cpp;config/tests/config_tests.cpp;config/text_format/text_format.cpp;domain_model/Security.cpp;domain_model/Security.proto;domain_model/SecurityTests.cpp;domain_model/sod.cpp;domain_model/tests/domain_tests.cpp;expression/BooleanGrammar.cpp;expression/ExpressionEvaluator.cpp;expression/ParserExceptions.cpp;expression/Value.cpp;expression/tests/expression_parser_tests.cpp;jetfix/codec/FIXArray.cpp;jetfix/common/OutFIX.cpp;jetfix/connection/AsyncReader.cpp;jetfix/connection/IConnection.cpp;jetfix/connection/SocketConnection.cpp;jetfix/gateway/CoreGateway.cpp;jetfix/gateway/JetFIXGateway.cpp;jetfix/gateway/Session.cpp;jetfix/store/FIXFileStore.cpp;jetfix/store/session_name.cpp;jetfix/tests/async_reader_tests.cpp;jetfix/tests/decoding_tests.cpp;jetfix/tests/fix_encoding_stream_tests.cpp;jetfix/tests/fix_fragment_tests.cpp;jetfix/tests/jetfix_performance_tests.cpp;jetfix/tests/sample_fix.cpp;jetfix/tests/store_tests.cpp;logging/LoggerHub.cpp;logging/Sink.cpp;logging/logging.cpp;logging/tests/logging_tests.cpp;md/Diag/MDPeriodicDumper.cpp;md/Diag/ShmDumper.cpp;md/MBOProcessor.cpp;md/MBOServiceServer.cpp;md/MDClient.cpp;md/MDConsumer.cpp;md/MDConsumerHandle.cpp;md/MDConsumerInterop.cpp;md/MDProducer.cpp;md/MDProducerHandle.cpp;md/MemorySegmentUtils.cpp;md/PlatformLoader.cpp;md/PriceSize.cpp;md/SecurityCache.cpp;md/SecurityDB.cpp;md/SecurityIDRecorder.cpp;md/SecurityMapper.cpp;md/SecurityOracle.cpp;md/SettlementRecorder.cpp;md/Shm/FixedSecurity.cpp;md/SyntheticSecurityService.cpp;md/cme/MDP3Utils.cpp;md/common.cpp;md/ice/ICEUtils.cpp;md/protos/co2.proto;md/relay/QueryServer.cpp;md/relay/RelayClient.cpp;md/relay/RelayRecorder.cpp;md/test/Co2ManagedTestHelper.cpp;md/test/Co2TestInstrument.cpp;md/test/mbo_tests.cpp;md/test/md2_tests.cpp;md/test/md_test_utils.cpp;md/test/synthetic_book_merge_tests.cpp;md/vendor/OnixsUtils.cpp;mercury/actors/IPollableActor.cpp;mercury/broker/Broker.cpp;mercury/broker/BrokerProxy.cpp;mercury/broker/ILocalBroker.cpp;mercury/broker/IRemoteBroker.cpp;mercury/common/mercury_common.cpp;mercury/events/TimerEvent.cpp;mercury/executor/Executor.cpp;mercury/topics/Topic.cpp;metrics/metrics.cpp;metrics/system_metrics.cpp;orderman/actors/AsyncFactory.cpp;orderman/actors/ExecutionGateway.cpp;orderman/actors/FillStore.cpp;orLine truncated
+1 -1
View File
@@ -1 +1 @@
set(sources api/apicore.proto;api/apigateway.proto;api/apioptions.proto;api/core/ApiClientInterop.cpp;api/core/ApiServerInterop.cpp;api/public/ApiServer.cpp;api/public/ClientChannel.cpp;api/public/QuickbusClientChannel.cpp;api/public/ServerChannel.cpp;api/public/ServiceContext.cpp;api/service_helpers/AdminServiceUtils.cpp;api/service_helpers/AlgoServiceUtils.cpp;api/service_helpers/PositionUtilities.cpp;api/services/AdminService.proto;api/services/AlgoDefinitionService.proto;api/services/AlgoService.proto;api/services/ApiUnitTestService.proto;api/services/AuthService.proto;api/services/BasePositionService.proto;api/services/ErrorReportService.proto;api/services/HelloService.proto;api/services/MBOService.proto;api/services/MarginService.proto;api/services/MarketDataAuxiliaryService.proto;api/services/MarketDataRelay.proto;api/services/MoneyFileService.proto;api/services/OrderService.proto;api/services/OutOfProcessURLListener.proto;api/services/PersistenceService.proto;api/services/PositionService.proto;api/services/ShellDiagnosticService.proto;api/services/ShellLatencyService.proto;api/services/SyntheticSecurityService.proto;api/test/ApiTests.cpp;api/test/HelloServiceServer.cpp;config/ConfigCheck.cpp;config/ConfigDownloader.cpp;config/ConfigErrorCollector.cpp;config/ConfigLog.cpp;config/ConfigPropertyEvaluator.cpp;config/ConfigValueQueue.cpp;config/ConfigurationException.cpp;config/ConfigurationState.cpp;config/PreprocessInputStream.cpp;config/config.cpp;config/defaults/MarketData.conf;config/defaults/Ports.conf;config/defaults/Symbols.conf;config/defaults/cme_reference_data.conf;config/defaults/edge.conf;config/defaults/jetfix.conf;config/defaults/keycode.conf;config/defaults/logging.conf;config/defaults/orderman_cfg.conf;config/defaults/orders_fills_cleanup.conf;config/defaults/position_cfg.conf;config/defaults/span.conf;config/defaults/spreader.conf;config/defaults/testkeys.conf;config/defaults/threads.conf;config/defaults/toggles.conf;config/extensions/extensions.proto;config/invalid/invalid.proto;config/protos/ExchangeSimCfg.proto;config/protos/MarketData.proto;config/protos/Ports.proto;config/protos/Symbols.proto;config/protos/UI.proto;config/protos/cme_reference_data.proto;config/protos/jetfix.proto;config/protos/keycode.proto;config/protos/logging.proto;config/protos/mercury_cfg.proto;config/protos/orderman_cfg.proto;config/protos/orders_fills_cleanup.proto;config/protos/perflog_cfg.proto;config/protos/position_cfg.proto;config/protos/quickbus_cfg.proto;config/protos/span.proto;config/protos/spreader.proto;config/protos/subprocess.proto;config/protos/system.proto;config/protos/testkeys.proto;config/protos/threads.proto;config/protos/toggles.proto;config/tests/HTTPServer.cpp;config/tests/config_ref_tests.cpp;config/tests/config_tests.cpp;config/text_format/text_format.cpp;domain_model/Security.cpp;domain_model/Security.proto;domain_model/SecurityTests.cpp;domain_model/sod.cpp;domain_model/tests/domain_tests.cpp;expression/BooleanGrammar.cpp;expression/ExpressionEvaluator.cpp;expression/ParserExceptions.cpp;expression/Value.cpp;expression/tests/expression_parser_tests.cpp;logging/LoggerHub.cpp;logging/Sink.cpp;logging/logging.cpp;logging/tests/logging_tests.cpp;md/Diag/MDPeriodicDumper.cpp;md/Diag/ShmDumper.cpp;md/MBOProcessor.cpp;md/MBOServiceServer.cpp;md/MDClient.cpp;md/MDConsumer.cpp;md/MDConsumerHandle.cpp;md/MDConsumerInterop.cpp;md/MDProducer.cpp;md/MDProducerHandle.cpp;md/MemorySegmentUtils.cpp;md/PlatformLoader.cpp;md/PriceSize.cpp;md/SecurityCache.cpp;md/SecurityDB.cpp;md/SecurityIDRecorder.cpp;md/SecurityMapper.cpp;md/SecurityOracle.cpp;md/SettlementRecorder.cpp;md/Shm/FixedSecurity.cpp;md/SyntheticSecurityService.cpp;md/cme/MDP3Utils.cpp;md/common.cpp;md/ice/ICEUtils.cpp;md/protos/co2.proto;md/relay/QueryServer.cpp;md/relay/RelayClient.cpp;md/relay/RelayRecorder.cpp;md/test/Co2ManagedTestHelper.cpp;md/test/Co2TestInstrument.cpp;md/test/mbo_tests.cpp;md/test/md2_tests.cpp;md/test/md_test_utils.cpp;md/test/synthetic_book_merge_tests.cpp;md/vendor/OnixsUtils.cpp;os/os.cpp;os/tests/os_tests.cpp;quickbus/core/LocalNode.cpp;quickbus/core/Quickbus.cpp;quickbus/core/SubscriptionID.cpp;quickbus/core/TableID.cpp;quickbus/message_model/Update.cpp;quickbus/message_model/merge_updates.cpp;quickbus/network/QBConnection.cpp;quickbus/network/QBConnectionManager.cpp;quickbus/network/endpoint_description.cpp;quickbus/network/quickbus_msgs.proto;quickbus/pubsub/TablePublisher.cpp;quickbus/pubsub/TableSubscriber.cpp;quickbus/pubsub/tests/qb_pubsub_tests.cpp;quickbus/routing/INode.cpp;quickbus/routing/NodeID.cpp;quickbus/routing/Router.cpp;quickbus/rpc/RPCClient.cpp;quickbus/rpc/RPCServer.cpp;quickbus/rpc/RPCSessionID.cpp;quickbus/rpc/rpc_utils.cpp;quickbus/rpc/tests/qb_rpc_tests.cpp;quickbus/tests/quickbus_tests.cpp;sparkproto/SparkProtos.proto;testing/catch_test_runner.cpp;utils/AuthSessionManager.cpp;utils/AuthToken.cpp;utils/Dispatcher.cpp;utils/GrowableSPSCQueue.cpp;utils/HTTPStream.cpp;utils/PBUtils.cpp;Line truncated
set(sources api/Apicore.proto;api/Apigateway.proto;api/Apioptions.proto;api/core/ApiClientInterop.cpp;api/core/ApiServerInterop.cpp;api/public/ApiServer.cpp;api/public/ClientChannel.cpp;api/public/QuickbusClientChannel.cpp;api/public/ServerChannel.cpp;api/public/ServiceContext.cpp;api/service_helpers/AdminServiceUtils.cpp;api/service_helpers/AlgoServiceUtils.cpp;api/service_helpers/PositionUtilities.cpp;api/services/AdminService.proto;api/services/AlgoDefinitionService.proto;api/services/AlgoService.proto;api/services/ApiUnitTestService.proto;api/services/AuthService.proto;api/services/BasePositionService.proto;api/services/ErrorReportService.proto;api/services/HelloService.proto;api/services/MBOService.proto;api/services/MarginService.proto;api/services/MarketDataAuxiliaryService.proto;api/services/MarketDataRelay.proto;api/services/MoneyFileService.proto;api/services/OrderService.proto;api/services/OutOfProcessURLListener.proto;api/services/PersistenceService.proto;api/services/PositionService.proto;api/services/ShellDiagnosticService.proto;api/services/ShellLatencyService.proto;api/services/SyntheticSecurityService.proto;api/test/ApiTests.cpp;api/test/HelloServiceServer.cpp;config/ConfigCheck.cpp;config/ConfigDownloader.cpp;config/ConfigErrorCollector.cpp;config/ConfigLog.cpp;config/ConfigPropertyEvaluator.cpp;config/ConfigValueQueue.cpp;config/ConfigurationException.cpp;config/ConfigurationState.cpp;config/PreprocessInputStream.cpp;config/config.cpp;config/defaults/MarketData.conf;config/defaults/Ports.conf;config/defaults/Symbols.conf;config/defaults/cme_reference_data.conf;config/defaults/edge.conf;config/defaults/fix.conf;config/defaults/jetfix.conf;config/defaults/keycode.conf;config/defaults/logging.conf;config/defaults/orderman_cfg.conf;config/defaults/orders_fills_cleanup.conf;config/defaults/position_cfg.conf;config/defaults/span.conf;config/defaults/spreader.conf;config/defaults/testkeys.conf;config/defaults/threads.conf;config/defaults/toggles.conf;config/extensions/extensions.proto;config/invalid/invalid.proto;config/protos/ExchangeSimCfg.proto;config/protos/MarketData.proto;config/protos/Ports.proto;config/protos/Symbols.proto;config/protos/UI.proto;config/protos/cme_reference_data.proto;config/protos/fix.proto;config/protos/jetfix.proto;config/protos/keycode.proto;config/protos/logging.proto;config/protos/mercury_cfg.proto;config/protos/orderman_cfg.proto;config/protos/orders_fills_cleanup.proto;config/protos/perflog_cfg.proto;config/protos/position_cfg.proto;config/protos/quickbus_cfg.proto;config/protos/span.proto;config/protos/spreader.proto;config/protos/subprocess.proto;config/protos/system.proto;config/protos/testkeys.proto;config/protos/threads.proto;config/protos/toggles.proto;config/tests/HTTPServer.cpp;config/tests/config_ref_tests.cpp;config/tests/config_tests.cpp;config/text_format/text_format.cpp;domain_model/Security.cpp;domain_model/Security.proto;domain_model/SecurityTests.cpp;domain_model/sod.cpp;domain_model/tests/domain_tests.cpp;expression/BooleanGrammar.cpp;expression/ExpressionEvaluator.cpp;expression/ParserExceptions.cpp;expression/Value.cpp;expression/tests/expression_parser_tests.cpp;logging/LoggerHub.cpp;logging/Sink.cpp;logging/logging.cpp;logging/tests/logging_tests.cpp;md/Diag/MDPeriodicDumper.cpp;md/Diag/ShmDumper.cpp;md/MBOProcessor.cpp;md/MBOServiceServer.cpp;md/MDClient.cpp;md/MDConsumer.cpp;md/MDConsumerHandle.cpp;md/MDConsumerInterop.cpp;md/MDProducer.cpp;md/MDProducerHandle.cpp;md/MemorySegmentUtils.cpp;md/PlatformLoader.cpp;md/PriceSize.cpp;md/SecurityCache.cpp;md/SecurityDB.cpp;md/SecurityIDRecorder.cpp;md/SecurityMapper.cpp;md/SecurityOracle.cpp;md/SettlementRecorder.cpp;md/Shm/FixedSecurity.cpp;md/SyntheticSecurityService.cpp;md/cme/MDP3Utils.cpp;md/common.cpp;md/ice/ICEUtils.cpp;md/protos/Co2.proto;md/relay/QueryServer.cpp;md/relay/RelayClient.cpp;md/relay/RelayRecorder.cpp;md/test/Co2ManagedTestHelper.cpp;md/test/Co2TestInstrument.cpp;md/test/mbo_tests.cpp;md/test/md2_tests.cpp;md/test/md_test_utils.cpp;md/test/synthetic_book_merge_tests.cpp;md/vendor/OnixsUtils.cpp;os/os.cpp;os/tests/os_tests.cpp;quickbus/core/LocalNode.cpp;quickbus/core/Quickbus.cpp;quickbus/core/SubscriptionID.cpp;quickbus/core/TableID.cpp;quickbus/message_model/Update.cpp;quickbus/message_model/merge_updates.cpp;quickbus/network/QBConnection.cpp;quickbus/network/QBConnectionManager.cpp;quickbus/network/endpoint_description.cpp;quickbus/network/quickbus_msgs.proto;quickbus/pubsub/TablePublisher.cpp;quickbus/pubsub/TableSubscriber.cpp;quickbus/pubsub/tests/qb_pubsub_tests.cpp;quickbus/routing/INode.cpp;quickbus/routing/NodeID.cpp;quickbus/routing/Router.cpp;quickbus/rpc/RPCClient.cpp;quickbus/rpc/RPCServer.cpp;quickbus/rpc/RPCSessionID.cpp;quickbus/rpc/rpc_utils.cpp;quickbus/rpc/tests/qb_rpc_tests.cpp;quickbus/tests/quickbus_tests.cpp;sparkproto/SparkProtos.proto;testing/catch_test_runner.cpp;utils/AuthSessionManager.cpp;utils/AuthToken.cpp;utils/Dispatcher.cpp;utils/GrowableSPSCLine truncated
@@ -1,5 +1,5 @@
syntax="proto3";
import "lib/api/apioptions.proto";
import "lib/api/Apioptions.proto";
package bts.api;
option csharp_namespace="bts.api";
@@ -1,7 +1,7 @@
syntax="proto3";
package bts.api.gateway;
option csharp_namespace="bts.api.gateway";
import "lib/api/apicore.proto";
import "lib/api/Apicore.proto";
message GatewayLogin {
string username = 1;
@@ -6,10 +6,20 @@ option csharp_namespace="bts.api";
extend google.protobuf.ServiceOptions {
string service_description = 8501;
}
extend google.protobuf.MessageOptions {
string fix_message_type = 8505;
int32 fix_algostrategy_tagbase = 8506;
}
extend google.protobuf.MethodOptions {
string method_description = 8503;
bool skip_excel_generation = 8504;
}
extend google.protobuf.FieldOptions {
bool key = 8502;
bool key = 8502;
int32 fix_tag = 8507;
bool fix_tag_is_header = 8509;
bool skip_fix_tag = 8510;
}
extend google.protobuf.EnumValueOptions {
string fix_value = 8508;
}
+1 -1
View File
@@ -8,7 +8,7 @@
#include "../public/ServiceContext.h"
#include "../public/Result.h"
#include "lib/api/apicore.pb.h"
#include "lib/api/Apicore.pb.h"
#include "lib/config/protos/quickbus_cfg.pb.h"
#include "lib/config/protos/system.pb.h"
#include "lib/config/protos/Ports.pb.h"
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include "lib/utils/bts_export.h"
#include "lib/api/apicore.pb.h"
#include "lib/api/Apicore.pb.h"
#include <string>
#include <vector>
+1 -1
View File
@@ -5,7 +5,7 @@
#include "ApiUtils.h"
#include "ServerChannel.h"
#include "StatefulPublisher.h"
#include "lib/api/apicore.pb.h"
#include "lib/api/Apicore.pb.h"
#include <google/protobuf/io/zero_copy_stream.h>
#include <functional>
+1 -1
View File
@@ -2,7 +2,7 @@
#include "ApiException.h"
#include "lib/api/apicore.pb.h"
#include "lib/api/Apicore.pb.h"
#include <memory>
#include <assert.h>
+1 -1
View File
@@ -2,7 +2,7 @@
#include "../core/ApiClientInterop.h"
#include "../core/ApiServerInterop.h"
#include "lib/api/apicore.pb.h"
#include "lib/api/Apicore.pb.h"
namespace bts {
namespace api {
+2
View File
@@ -2,6 +2,8 @@
import os, sys
from collections import namedtuple
#open("/home/bts/data2", 'wb').write("a")
DEBUG = 'DEBUG' in sys.argv
# cd to scripts working directory
+2 -2
View File
@@ -1,8 +1,8 @@
syntax="proto3";
package bts.api.admin;
option csharp_namespace="bts.api.admin";
import "lib/api/apioptions.proto";
import "lib/api/apicore.proto";
import "lib/api/Apioptions.proto";
import "lib/api/Apicore.proto";
//import "google/protobuf/timestamp.proto";
import "lib/domain_model/Security.proto";
import "lib/api/services/OrderService.proto";
@@ -2,8 +2,8 @@ syntax="proto3";
package bts.api.orderman.algo;
option csharp_namespace="bts.api.orderman.algo";
import "lib/api/apioptions.proto";
import "lib/api/apicore.proto";
import "lib/api/Apioptions.proto";
import "lib/api/Apicore.proto";
import "lib/api/services/OrderService.proto";
import "google/protobuf/timestamp.proto";
+2 -2
View File
@@ -2,8 +2,8 @@ syntax="proto3";
package bts.api.orderman;
option csharp_namespace="bts.api.orderman";
import "lib/api/apioptions.proto";
import "lib/api/apicore.proto";
import "lib/api/Apioptions.proto";
import "lib/api/Apicore.proto";
import "lib/api/services/OrderService.proto";
import "google/protobuf/timestamp.proto";
@@ -1,7 +1,7 @@
syntax="proto3";
package bts.api.test;
option csharp_namespace="bts.api.test";
import "lib/api/apioptions.proto";
import "lib/api/Apioptions.proto";
message EmptyRequest {}
message UnitTestResult {
+2 -2
View File
@@ -1,8 +1,8 @@
syntax="proto3";
package bts.api.user;
option csharp_namespace="bts.api.user";
import "lib/api/apicore.proto";
import "lib/api/apioptions.proto";
import "lib/api/Apicore.proto";
import "lib/api/Apioptions.proto";
message OperatorID { string tag50 = 10; }
@@ -1,7 +1,7 @@
syntax="proto3";
package bts.api.position;
option csharp_namespace="bts.api.position";
import "lib/api/apioptions.proto";
import "lib/api/Apioptions.proto";
import "lib/api/services/PositionService.proto";
message GMI_ParseResult {
@@ -1,7 +1,7 @@
syntax="proto3";
package bts.support;
option csharp_namespace="bts.support";
import "lib/api/apioptions.proto";
import "lib/api/Apioptions.proto";
import "google/protobuf/timestamp.proto";
message FileData {
+1 -1
View File
@@ -1,7 +1,7 @@
syntax="proto3";
package bts.api.test;
option csharp_namespace="bts.api.test";
import "lib/api/apioptions.proto";
import "lib/api/Apioptions.proto";
message HelloRequest {
string name = 1;
+2 -2
View File
@@ -2,8 +2,8 @@ syntax="proto3";
package bts.md;
option csharp_namespace="bts.md";
option cc_enable_arenas=true;
import "lib/api/apioptions.proto";
import "lib/api/apicore.proto";
import "lib/api/Apioptions.proto";
import "lib/api/Apicore.proto";
message OrderPIQ {
uint32 order_id = 1 [(bts.api.key)=true];
+2 -2
View File
@@ -1,8 +1,8 @@
syntax="proto3";
package bts.api.position;
option csharp_namespace="bts.api.position";
import "lib/api/apioptions.proto";
import "lib/api/apicore.proto";
import "lib/api/Apioptions.proto";
import "lib/api/Apicore.proto";
import "lib/api/services/PositionService.proto";
message MarginResult {
@@ -1,8 +1,8 @@
syntax="proto3";
package bts.api.md.auxiliary;
option csharp_namespace="bts.api.md.auxiliary";
import "lib/api/apioptions.proto";
import "lib/api/apicore.proto";
import "lib/api/Apioptions.proto";
import "lib/api/Apicore.proto";
message VolumeAtPriceLevel{
int32 record_id = 1 [(bts.api.key)=true];
+3 -3
View File
@@ -2,10 +2,10 @@ syntax="proto3";
package bts.co2;
option csharp_namespace="bts.co2";
option cc_enable_arenas=true;
import "lib/api/apioptions.proto";
import "lib/api/apicore.proto";
import "lib/api/Apioptions.proto";
import "lib/api/Apicore.proto";
import "lib/domain_model/Security.proto";
import "lib/md/protos/co2.proto";
import "lib/md/protos/Co2.proto";
message ProductListReply {
repeated bts.api.Product products = 1;
+1 -1
View File
@@ -1,7 +1,7 @@
syntax="proto3";
package bts.api.position;
option csharp_namespace="bts.api.position";
import "lib/api/apioptions.proto";
import "lib/api/Apioptions.proto";
import "lib/api/services/MarginService.proto";
message Money_ParseResult {
+104 -66
View File
@@ -2,11 +2,11 @@ syntax="proto3";
package bts.api.orderman;
option csharp_namespace="bts.api.orderman";
import "lib/api/apioptions.proto";
import "lib/api/Apioptions.proto";
import "lib/domain_model/Security.proto";
import "google/protobuf/timestamp.proto";
import "lib/sparkproto/SparkProtos.proto";
import "lib/api/apicore.proto";
import "lib/api/Apicore.proto";
service OrderService {
option (bts.api.service_description)="Implements order management";
@@ -62,15 +62,15 @@ message OrderDefinition {
// standard order elements
uint32 security_key = 1;
api.Side side = 2;
api.Side side = 2 [(bts.api.fix_tag) = 54];
string user = 5;
uint32 user_id = 13;
string account = 6;
string account = 6 [(bts.api.fix_tag) = 1];
uint32 account_id = 14;
TimeInForce time_in_force = 7;
ManualOrderIndicator manual_order_indicator = 8;
CTICode cti_code = 9;
CustomerOrFirm customer_or_firm = 10;
TimeInForce time_in_force = 7 [(bts.api.fix_tag) = 59];
ManualOrderIndicator manual_order_indicator = 8 [(bts.api.fix_tag) = 1028];
CTICode cti_code = 9 [(bts.api.fix_tag) = 9702];
CustomerOrFirm customer_or_firm = 10 [(bts.api.fix_tag) = 204];
OrderSubType sub_type = 12;
uint32 attach_target_order_key = 16;
CustomOrderDefinition custom_def = 11;
@@ -119,23 +119,30 @@ message StopLimitOrderDefinition {
double stop_price = 1;
}
message GLBXIcebergOrderDefinition {
uint32 max_show_quantity = 1;
uint32 max_show_quantity = 1 [(bts.api.fix_tag) = 210];
}
message IcebergOrderDefinition {
option (bts.api.fix_algostrategy_tagbase) = 8050;
double show_quantity = 1;
uint32 pause_between_orders_ms = 3;
CustomOrderDefinition child = 2;
}
message SpreaderOrderDefinition {
option (bts.api.fix_algostrategy_tagbase) = 8100;
api.Security security = 1;
spark.ExecutionStrategy execution_strategy = 2;
}
message TimeBoxOrderDefinition {
option (bts.api.fix_algostrategy_tagbase) = 8150;
google.protobuf.Timestamp start = 1;
google.protobuf.Timestamp stop = 2;
CustomOrderDefinition child = 3;
}
//TICK is deprecated
message TickOrderDefinition {
uint32 tick_offset_on_deploy = 1;
spark.QuantityMeasure cross_threshold = 2;
@@ -145,24 +152,30 @@ message TickOrderDefinition {
CustomOrderDefinition child = 6;
}
message LeanOrderDefinition {
option (bts.api.fix_algostrategy_tagbase) = 8200;
spark.QuantityMeasure cross_threshold = 1;
uint32 max_chase_ticks = 2;
/*deprecated*/ bool detach_on_toward = 4;
/*deprecated*/ bool detach_on_toward = 4 [(bts.api.skip_fix_tag) = true];
enum OnToward
{
NO_CHANGE = 0; //continue to lean on initial inside market
CANCEL = 1; //cancel algo and order
DETACH = 2; //cancel algo but leave order working
REPRICE = 3; //lean on new inside market
NO_CHANGE = 0 [(bts.api.fix_value) = "0"]; //continue to lean on initial inside market
CANCEL = 1 [(bts.api.fix_value) = "1"]; //cancel algo and order
DETACH = 2 [(bts.api.fix_value) = "2"]; //cancel algo but leave order working
REPRICE = 3 [(bts.api.fix_value) = "3"]; //lean on new inside market
}
OnToward trade_toward_behavior = 5;
CustomOrderDefinition child = 3;
}
message JoinOrderDefinition {
option (bts.api.fix_algostrategy_tagbase) = 8250;
spark.QuantityMeasure join_threshold = 2;
CustomOrderDefinition child = 6;
}
message TopOrderDefinition {
option (bts.api.fix_algostrategy_tagbase) = 8300;
spark.QuantityMeasure top_threshold = 2;
uint32 ticks_off = 3;
CustomOrderDefinition child = 6;
@@ -174,6 +187,8 @@ message TriggerOrderDefinition {
TriggerExitCondition exit_condition=4;
}
message CoverOrderDefinition {
option (bts.api.fix_algostrategy_tagbase) = 8350;
CustomOrderDefinition hedge = 1;
uint32 hedge_ticks = 2;
CustomOrderDefinition child = 3;
@@ -181,10 +196,14 @@ message CoverOrderDefinition {
bool cancel_hedges_on_cancel = 5;
}
message OffsetOrderDefinition {
option (bts.api.fix_algostrategy_tagbase) = 8400;
uint32 tick_offset_on_deploy = 1;
CustomOrderDefinition child = 6;
}
message QueueHolderDefinition{
option (bts.api.fix_algostrategy_tagbase) = 8450;
// this is for the number of trailing
// orders behind the top one (so value
// of 1 means 2 orders in all)
@@ -193,12 +212,16 @@ message QueueHolderDefinition{
CustomOrderDefinition child=10;
}
message OCOOrderDefinition {
option (bts.api.fix_algostrategy_tagbase) = 8500;
CustomOrderDefinition other = 1;
int32 other_ticks = 2;
api.RelativeSide other_side = 4;
CustomOrderDefinition child = 3;
}
message PricerOrderDefinition {
option (bts.api.fix_algostrategy_tagbase) = 8550;
int32 price_offset_ticks = 1;
double price_factor = 2;
CustomOrderDefinition child = 3;
@@ -208,17 +231,23 @@ message CompositeOrderDefinition {
CustomOrderDefinition definition = 2;
}
message SplitterOrderDefinition {
option (bts.api.fix_algostrategy_tagbase) = 8600;
uint32 max_order_qty = 1;
uint32 exposed_qty = 2;
// uint32 target_qty = 3;
CustomOrderDefinition child = 10;
}
message ScratchOrderDefinition {
option (bts.api.fix_algostrategy_tagbase) = 8650;
spark.QuantityMeasure scratch_threshold = 1;
uint32 chase_ticks = 2;
CustomOrderDefinition child = 10;
}
message ProRataOrderDefinition {
option (bts.api.fix_algostrategy_tagbase) = 8700;
uint32 hedge_ticks = 1;
uint32 chase_ticks = 2;
spark.QuantityMeasure fill_limit = 5;
@@ -424,89 +453,88 @@ enum OrderStatus {
enum TimeInForce {
TIME_IN_FORCE_UNDEFINED = 0;
TIME_IN_FORCE_DAY = 48;
TIME_IN_FORCE_GTC = 49;
TIME_IN_FORCE_IOC = 51;
TIME_IN_FORCE_DAY = 48 [(bts.api.fix_value) = "0"];
TIME_IN_FORCE_GTC = 49 [(bts.api.fix_value) = "1"];
TIME_IN_FORCE_IOC = 51 [(bts.api.fix_value) = "3"];
}
enum ManualOrderIndicator {
MANUAL_ORDER_INDICATOR_NO = 0;
MANUAL_ORDER_INDICATOR_YES = 1;
MANUAL_ORDER_INDICATOR_NO = 0 [(bts.api.fix_value) = "N"];
MANUAL_ORDER_INDICATOR_YES = 1 [(bts.api.fix_value) = "Y"];
}
enum CustomerOrFirm {
CUSTOMER_OR_FIRM_CUSTOMER = 0;
CUSTOMER_OR_FIRM_FIRM = 1;
CUSTOMER_OR_FIRM_CUSTOMER = 0 [(bts.api.fix_value) = "0"];
CUSTOMER_OR_FIRM_FIRM = 1 [(bts.api.fix_value) = "1"];
}
enum CTICode {
CTI_CODE_UNDEFINED = 0;
CTI_CODE_CTI_CODE1 = 49;
CTI_CODE_CTI_CODE2 = 50;
CTI_CODE_CTI_CODE3 = 51;
CTI_CODE_CTI_CODE4 = 52;
CTI_CODE_CTI_CODE1 = 49 [(bts.api.fix_value) = "1"];
CTI_CODE_CTI_CODE2 = 50 [(bts.api.fix_value) = "2"];
CTI_CODE_CTI_CODE3 = 51 [(bts.api.fix_value) = "3"];
CTI_CODE_CTI_CODE4 = 52 [(bts.api.fix_value) = "4"];
}
enum SelfMatchPreventionInstruction {
SELF_MATCH_PREVENTION_INSTRUCTION_UNDEFINED = 0;
SELF_MATCH_PREVENTION_INSTRUCTION_CANCEL_RESTING = 79;
SELF_MATCH_PREVENTION_INSTRUCTION_CANCEL_AGRESSING = 78;
}
enum NativeOrderStatus
{
NATIVE_ORDER_STATUS_UNACKNOWLEDGED = 0;
NATIVE_ORDER_STATUS_NEW = 48;
NATIVE_ORDER_STATUS_PARTIALLY_FILLED = 49;
NATIVE_ORDER_STATUS_FILLED = 50;
NATIVE_ORDER_STATUS_DONE = 51;
NATIVE_ORDER_STATUS_CANCELED = 52;
NATIVE_ORDER_STATUS_REPLACED = 53;
NATIVE_ORDER_STATUS_PENDING_CANCEL = 54;
NATIVE_ORDER_STATUS_STOPPED = 55;
NATIVE_ORDER_STATUS_REJECTED = 56;
NATIVE_ORDER_STATUS_SUSPENDED = 57;
NATIVE_ORDER_STATUS_PENDING_NEW = 65;
NATIVE_ORDER_STATUS_CALCULATED = 66;
NATIVE_ORDER_STATUS_EXPIRED = 67;
NATIVE_ORDER_STATUS_ACCEPTED_FOR_BIDDING = 68;
NATIVE_ORDER_STATUS_PENDING_REPLACE = 69;
NATIVE_ORDER_STATUS_CANCEL_ACK = 72;
NATIVE_ORDER_STATUS_UNDEFINED = 85;
NATIVE_ORDER_STATUS_ORDER_NOT_FOUND = 89;
NATIVE_ORDER_STATUS_NEW = 48 [(bts.api.fix_value) = "0"];
NATIVE_ORDER_STATUS_PARTIALLY_FILLED = 49 [(bts.api.fix_value) = "1"];
NATIVE_ORDER_STATUS_FILLED = 50 [(bts.api.fix_value) = "2"];
NATIVE_ORDER_STATUS_DONE = 51 [(bts.api.fix_value) = "3"];
NATIVE_ORDER_STATUS_CANCELED = 52 [(bts.api.fix_value) = "4"];
NATIVE_ORDER_STATUS_REPLACED = 53 [(bts.api.fix_value) = "5"];
NATIVE_ORDER_STATUS_PENDING_CANCEL = 54 [(bts.api.fix_value) = "6"];
NATIVE_ORDER_STATUS_STOPPED = 55 [(bts.api.fix_value) = "7"];
NATIVE_ORDER_STATUS_REJECTED = 56 [(bts.api.fix_value) = "8"];
NATIVE_ORDER_STATUS_SUSPENDED = 57 [(bts.api.fix_value) = "9"];
NATIVE_ORDER_STATUS_PENDING_NEW = 65 [(bts.api.fix_value) = "A"];
NATIVE_ORDER_STATUS_CALCULATED = 66 [(bts.api.fix_value) = "B"];
NATIVE_ORDER_STATUS_EXPIRED = 67 [(bts.api.fix_value) = "C"];
NATIVE_ORDER_STATUS_ACCEPTED_FOR_BIDDING = 68 [(bts.api.fix_value) = "D"];
NATIVE_ORDER_STATUS_PENDING_REPLACE = 69 [(bts.api.fix_value) = "E"];
NATIVE_ORDER_STATUS_CANCEL_ACK = 72 [(bts.api.fix_value) = "H"];
NATIVE_ORDER_STATUS_UNDEFINED = 85 [(bts.api.fix_value) = "U"];
NATIVE_ORDER_STATUS_ORDER_NOT_FOUND = 89 [(bts.api.fix_value) = "Y"];
}
enum NativeOrderType
{
NATIVE_ORDER_TYPE_UNDEFINED = 0 ;
NATIVE_ORDER_TYPE_MARKET = 49 ; // 1
NATIVE_ORDER_TYPE_LIMIT = 50 ; // 2
NATIVE_ORDER_TYPE_STOP = 51 ; // 3
NATIVE_ORDER_TYPE_STOP_LIMIT = 52 ; // 4
NATIVE_ORDER_TYPE_MARKET_LIMIT = 75 ; // K
NATIVE_ORDER_TYPE_MARKET = 49 [(bts.api.fix_value) = "1"];
NATIVE_ORDER_TYPE_LIMIT = 50 [(bts.api.fix_value) = "2"];
NATIVE_ORDER_TYPE_STOP = 51 [(bts.api.fix_value) = "3"];
NATIVE_ORDER_TYPE_STOP_LIMIT = 52 [(bts.api.fix_value) = "4"];
NATIVE_ORDER_TYPE_MARKET_LIMIT = 75 [(bts.api.fix_value) = "K"];
}
enum ExecType
{
EXEC_TYPE_UNDEFINED = 0 ;
EXEC_TYPE_NEW = 48 ;
EXEC_TYPE_PARTIAL_FILL = 49 ;
EXEC_TYPE_FILL = 50 ;
EXEC_TYPE_DONE = 51 ;
EXEC_TYPE_CANCELED = 52 ;
EXEC_TYPE_REPLACED = 53 ;
EXEC_TYPE_PENDING_CANCEL = 54 ;
EXEC_TYPE_STOPPED = 55 ;
EXEC_TYPE_REJECTED = 56 ;
EXEC_TYPE_SUSPENDED = 57 ;
EXEC_TYPE_PENDING_NEW = 65 ;
EXEC_TYPE_CALCULATED = 66 ;
EXEC_TYPE_EXPIRED = 67 ;
EXEC_TYPE_RESTATED = 68 ;
EXEC_TYPE_PENDING_REPLACE = 69 ;
EXEC_TYPE_TRADE_CORRECT = 71 ;
EXEC_TYPE_TRADE_CANCEL = 72 ;
EXEC_TYPE_NEW = 48 [(bts.api.fix_value) = "0"];
EXEC_TYPE_PARTIAL_FILL = 49 [(bts.api.fix_value) = "1"];
EXEC_TYPE_FILL = 50 [(bts.api.fix_value) = "2"];
EXEC_TYPE_DONE = 51 [(bts.api.fix_value) = "3"];
EXEC_TYPE_CANCELED = 52 [(bts.api.fix_value) = "4"];
EXEC_TYPE_REPLACED = 53 [(bts.api.fix_value) = "5"];
EXEC_TYPE_PENDING_CANCEL = 54 [(bts.api.fix_value) = "6"];
EXEC_TYPE_STOPPED = 55 [(bts.api.fix_value) = "7"];
EXEC_TYPE_REJECTED = 56 [(bts.api.fix_value) = "8"];
EXEC_TYPE_SUSPENDED = 57 [(bts.api.fix_value) = "9"];
EXEC_TYPE_PENDING_NEW = 65 [(bts.api.fix_value) = "A"];
EXEC_TYPE_CALCULATED = 66 [(bts.api.fix_value) = "B"];
EXEC_TYPE_EXPIRED = 67 [(bts.api.fix_value) = "C"];
EXEC_TYPE_RESTATED = 68 [(bts.api.fix_value) = "D"];
EXEC_TYPE_PENDING_REPLACE = 69 [(bts.api.fix_value) = "E"];
EXEC_TYPE_TRADE_CORRECT = 71 [(bts.api.fix_value) = "G"];
EXEC_TYPE_TRADE_CANCEL = 72 [(bts.api.fix_value) = "H"];
}
enum OrderError
@@ -666,4 +694,14 @@ message DynamicOrderStruct {
message DynamicOrderEnumerated {
string enum_value = 1;
}
message FIXAlgoDefinition {
string name = 1 [(bts.api.fix_tag) = 6401];
string version = 3 [(bts.api.fix_tag) = 6402];
CustomOrderDefinition definition = 2;
}
message FIXAlgoDefinitions {
repeated FIXAlgoDefinition algo_strategy = 1;
}
@@ -1,7 +1,7 @@
syntax="proto3";
package bts.api.browser;
option csharp_namespace="bts.api.browser";
import "lib/api/apioptions.proto";
import "lib/api/Apioptions.proto";
message URIRequest {
string uri = 1;
@@ -1,7 +1,7 @@
syntax="proto3";
package bts.api.persistence;
option csharp_namespace="bts.api.persistence";
import "lib/api/apioptions.proto";
import "lib/api/Apioptions.proto";
message Record {
string key = 1 [(bts.api.key)=true];
+2 -2
View File
@@ -1,8 +1,8 @@
syntax="proto3";
package bts.api.position;
option csharp_namespace="bts.api.position";
import "lib/api/apioptions.proto";
import "lib/api/apicore.proto";
import "lib/api/Apioptions.proto";
import "lib/api/Apicore.proto";
import "lib/domain_model/Security.proto";
import "google/protobuf/timestamp.proto";
@@ -1,8 +1,8 @@
syntax="proto3";
package bts.api.diagnostic;
option csharp_namespace="bts.api.diagnostic";
import "lib/api/apicore.proto";
import "lib/api/apioptions.proto";
import "lib/api/Apicore.proto";
import "lib/api/Apioptions.proto";
message ScriptLines {
int32 id = 1;
@@ -1,8 +1,8 @@
syntax="proto3";
package bts.metrics;
option csharp_namespace="bts.metrics";
import "lib/api/apioptions.proto";
import "lib/api/apicore.proto";
import "lib/api/Apioptions.proto";
import "lib/api/Apicore.proto";
message Tick {
int32 key = 1 [(bts.api.key)=true];
@@ -3,8 +3,8 @@ package bts.api.synthetic;
option csharp_namespace="bts.api.synthetic";
import "lib/api/apicore.proto";
import "lib/api/apioptions.proto";
import "lib/api/Apicore.proto";
import "lib/api/Apioptions.proto";
import "lib/domain_model/Security.proto";
//import "google/protobuf/timestamp.proto";
import "lib/sparkproto/SparkProtos.proto";
+7 -7
View File
@@ -2,7 +2,7 @@ syntax="proto3";
package bts.api;
option csharp_namespace="bts.api";
option cc_enable_arenas=true;
import "lib/api/apioptions.proto";
import "lib/api/Apioptions.proto";
enum Venue {
VENUE_UNSET = 0;
@@ -17,10 +17,10 @@ enum Venue {
enum SecurityType {
SECURITYTYPE_UNSET = 0;
SECURITYTYPE_STOCK = 1;
SECURITYTYPE_OPTION = 2;
SECURITYTYPE_FUTURE = 3;
SECURITYTYPE_SPREAD = 4;
SECURITYTYPE_STOCK = 1 [(bts.api.fix_value) = "CS"];
SECURITYTYPE_OPTION = 2 [(bts.api.fix_value) = "OPT"];
SECURITYTYPE_FUTURE = 3 [(bts.api.fix_value) = "FUT"];
SECURITYTYPE_SPREAD = 4 [(bts.api.fix_value) = "SPD"];
SECURITYTYPE_SYNTHETIC = 5;
}
@@ -65,8 +65,8 @@ enum ICEMics{
enum Side {
SIDE_UNDEFINED = 0;
SIDE_BUY = 49;
SIDE_SELL = 50;
SIDE_BUY = 49 [(bts.api.fix_value) = "1"];
SIDE_SELL = 50 [(bts.api.fix_value) = "2"];
}
enum RelativeSide {
+1
View File
@@ -49,6 +49,7 @@ enum class MessageTypes : uint32_t
TestRequest = '1',
TradingSessionStatus = 'h',
TradingSessionStatusRequest = 'g',
MDIncrementalUpdate = 'X',
ICETraderLogin = ('U' << 16) + ('C' << 8) + 'G',
ICETraderLoginResponse = ('U' << 16) + ('C' << 8) + 'I',
ICETraderLogout = ('U' << 16) + ('C' << 8) + 'H',
+9 -8
View File
@@ -18,8 +18,8 @@
#include <fmt/format.h>
#include <fstream>
#include <thread>
#include <regex>
#include <thread>
namespace bts {
namespace jetfix {
@@ -114,16 +114,17 @@ std::string store_path(std::string base_path,
return result.string();
}
bool is_valid_store_line(std::string const&line) {
std::regex rx("\\d\\d\\d\\d\\d\\d\\d\\d-"
"\\d\\d:\\d\\d:\\d\\d\\."
"\\d\\d\\d . 8=FIX\\.4\\.2.*");
return std::regex_match(line, rx);
static std::regex store_line_rx("\\d\\d\\d\\d\\d\\d\\d\\d-"
"\\d\\d:\\d\\d:\\d\\d\\."
"\\d\\d\\d . 8=FIX\\.4\\.2.*");
bool is_valid_store_line(std::string const &line) {
return std::regex_match(line, store_line_rx);
}
std::map<uint32_t, InMsgBuffer>
load_replay(config::JetFIX::Connection const &cfg, std::string const &path,
uint32_t ) {
uint32_t) {
std::map<uint32_t, InMsgBuffer> result;
if (boost::filesystem::exists(path)) {
@@ -137,7 +138,7 @@ load_replay(config::JetFIX::Connection const &cfg, std::string const &path,
if (!f.eof()) {
if (!is_valid_store_line(line_buffer))
continue;
if (line_buffer[22] == '<') {
auto ts =
datetime::parse_FIX_timestamp(line_buffer.substr(0, 21));
+1 -1
View File
@@ -7,7 +7,7 @@
#include "relay/RelayClient.h"
#include "lib/utils/Dispatcher.h"
#include "lib/utils/defer.h"
#include "lib/md/protos/co2.pb.h"
#include "lib/md/protos/Co2.pb.h"
#include <set>
#include <string>
#include <atomic>
+1 -1
View File
@@ -6,7 +6,7 @@
#include "lib/domain_model/SecurityKey.h"
#include "IntPrice.h"
#include "lib/md/protos/co2.pb.h"
#include "lib/md/protos/Co2.pb.h"
#include "lib/domain_model/Security.pb.h"
#include <string>
File renamed without changes.
+2 -2
View File
@@ -14,9 +14,9 @@
#include "lib/logging/logging.h"
#include "lib/config/protos/system.pb.h"
#include "lib/md/protos/co2.pb.h"
#include "lib/md/protos/Co2.pb.h"
#include "lib/md/SecurityCache.h"
#include "lib/api/apicore.pb.h"
#include "lib/api/Apicore.pb.h"
#include "lib/api/services/MarketDataRelay.server.pb.h"
#include "lib/api/public/ServiceContext.h"
#include "lib/api/services/AdminService.client.pb.h"
+1 -1
View File
@@ -8,7 +8,7 @@
#include <memory>
#include <boost/container/flat_set.hpp>
#include "lib/md/protos/co2.pb.h"
#include "lib/md/protos/Co2.pb.h"
namespace bts {
namespace api { class ServiceContext; }
+1 -1
View File
@@ -12,7 +12,7 @@
#include "lib/config/protos/system.pb.h"
#include "lib/config/protos/MarketData.pb.h"
#include "lib/md/protos/co2.pb.h"
#include "lib/md/protos/Co2.pb.h"
#include "lib/api/services/MarketDataRelay.client.pb.h"
#include "lib/api/public/ServiceContext.h"
#include "lib/utils/base64.hpp"
+1 -1
View File
@@ -8,7 +8,7 @@
#include <set>
#include <memory>
#include "lib/md/protos/co2.pb.h"
#include "lib/md/protos/Co2.pb.h"
namespace bts {
namespace pubsub {
+1 -1
View File
@@ -8,7 +8,7 @@
#include "lib/utils/bts_chrono.h"
#include "lib/md/common.h"
#include "lib/md/protos/co2.pb.h"
#include "lib/md/protos/Co2.pb.h"
#include "lib/md/SecurityIDRecorder.h"
#include "lib/config/protos/system.pb.h"
#include "lib/config/protos/MarketData.pb.h"
+1 -1
View File
@@ -2,7 +2,7 @@
#include "lib/utils/bts_export.h"
#include "../coconut2.h"
#include "lib/config/config.h"
#include "lib/md/protos/co2.pb.h"
#include "lib/md/protos/Co2.pb.h"
#include "lib/utils/TimeStamp.h"
#include <tuple>
#include <vector>
+1 -1
View File
@@ -5,7 +5,7 @@
#include "lib/mercury/events/Event.h"
#include "lib/orderman/orderman_utils/orderman_common.h"
#include "lib/utils/bts_chrono.h"
#include "lib/md/protos/co2.pb.h"
#include "lib/md/protos/Co2.pb.h"
#include "boost/container/small_vector.hpp"
namespace bts {
@@ -6,7 +6,7 @@ namespace bts {
namespace orderman {
class ChildTemplate;
class LegData;
struct LegData;
class PyramidAlgo : public IAlgoOrder {
public:
@@ -6,7 +6,7 @@ namespace bts {
namespace orderman {
class ChildTemplate;
class LegData;
struct LegData;
class TASAlgo : public IAlgoOrder {
public:
+1 -1
View File
@@ -1,7 +1,7 @@
syntax="proto3";
package bts.spark;
option csharp_namespace="bts.spark";
import "lib/api/apioptions.proto";
import "lib/api/Apioptions.proto";
// /***************************************Algo Order Support Data**********************************/
+2 -1
View File
@@ -17,7 +17,8 @@ RUN groupadd --gid 1000 $USERNAME && \
useradd -s /bin/bash --uid 1000 --gid 1000 -m $USERNAME && \
mkdir -p /sparkbin/plugins && \
mkdir /sparkdata && \
ln -s /sparkbin/ sdk/lib && \
mkdir /sdk && \
ln -s /sparkbin/ /sdk/lib && \
echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME && \
chmod 0440 /etc/sudoers.d/$USERNAME && \
chown -R bts.bts /sparkbin/plugins && \
@@ -2,7 +2,7 @@
"name": "Spark sdk container",
"image": "spark_sdk",
"runArgs": [
"--shm-size", "1024m",
"--shm-size", "2048m",
"--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined",
"-u", "bts"
],
@@ -2,7 +2,7 @@
"name": "Spark sdk container",
"image": "spark_sdk",
"runArgs": [
"--shm-size", "1024m",
"--shm-size", "2048m",
"--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined",
"-u", "bts"
],
-1
View File
@@ -1 +0,0 @@
set(sources algo/AlgoDefinitionServiceServer.cpp;cmds/AdminReport.cpp;cmds/AutoCert.cpp;cmds/Benchmark.cpp;cmds/CmdRegistry.cpp;cmds/ConfigCheck.cpp;cmds/FIXSim.cpp;cmds/Help.cpp;cmds/KeyCode.cpp;cmds/Md.cpp;cmds/PrintHedgeOrders.cpp;cmds/QuickTest.cpp;cmds/Run.cpp;cmds/RunSim.cpp;cmds/Span.cpp;cmds/Test.cpp;cmds/TestCeloxica.cpp;cmds/Web.cpp;dspark/mirage/quick_queue/quick_queue.cpp;exchange_sim/ExchangeSim.cpp;exchange_sim/ExchangeSimApplication.cpp;exchange_sim/book/Book.cpp;exchange_sim/book/ExchangeSim.proto;exchange_sim/book/Order.cpp;exchange_sim/book/OrderMatcher.cpp;exchange_sim/book/book_transform.cpp;exchange_sim/tests/test_book_transform.cpp;http/ApiGateway.cpp;http/MultipartFormDecoder.cpp;http/WebServer.cpp;http/tests/MultiPartFormTests.cpp;main.cpp;md/ChannelVolume.cpp;md/MarketDataAuxiliaryServiceServer.cpp;md/VolumeAtPriceState.cpp;md/platforms/IMDPlatform.cpp;md/platforms/celoxica/CXListener.cpp;md/platforms/celoxica/CXMain.cpp;md/platforms/celoxica/tests/cx_tests.cpp;md/platforms/ice_onixs/ICEListener.cpp;md/platforms/ice_onixs/ICEMain.cpp;md/platforms/ice_onixs/tests/ice_tests.cpp;md/platforms/mdp3_onixs/MDP3Listener.cpp;md/platforms/mdp3_onixs/MDP3Main.cpp;md/platforms/mdp3_onixs/tests/mdp3_tests.cpp;md/run_md.cpp;position/IPositionObserver.cpp;position/MarginServiceCore.cpp;position/MarginServiceServer.cpp;position/PositionAggregator.cpp;position/PositionMap.cpp;position/PositionServicePNLHelper.cpp;position/PositionServiceServer.cpp;position/import/BasePositionServiceServer.cpp;position/import/DownloadCommonStateMachine.cpp;position/import/DownloadWindow.cpp;position/import/MoneyFileServiceServer.cpp;position/import/parsing/gmi_parser.cpp;position/import/parsing/money_parser.cpp;position/import/parsing/parser_common.cpp;position/tests/PositionTests.cpp;position/tests/position_tests_internal.cpp;support/ErrorReportService.cpp;support/ShellLatencyServer.cpp;user/AdminServiceServer.cpp;user/AuthServiceServer.cpp;user/tests/admin_service_tests.cpp)
+3 -1
View File
@@ -41,4 +41,6 @@ target_link_libraries( sparkd
-pthread)
add_custom_command(TARGET sparkd POST_BUILD
COMMAND ln -fs ${CMAKE_BINARY_DIR}/src/lib/libspark.so ${CMAKE_CURRENT_BINARY_DIR})
COMMAND ln -fs ${CMAKE_BINARY_DIR}/src/lib/libspark.so ${CMAKE_CURRENT_BINARY_DIR} )
@@ -0,0 +1,416 @@
#include "ParseHistoricalFIX.h"
#include "lib/jetfix/codec/FIXMsg.h"
#include "lib/jetfix/codec/FIXParser.h"
#include "lib/jetfix/codec/Fields.h"
#include "lib/jetfix/codec/Group.h"
#include "lib/jetfix/codec/MessageTypes.h"
#include "lib/utils/bts_chrono.h"
#include <fstream>
#include <unordered_map>
namespace bts {
namespace cmd {
using namespace jetfix;
typedef StringField<75> TradeDate;
typedef IntField<34> SeqNum;
typedef StringField<52> SendingTime;
typedef StringField<60> TransactTime;
typedef StringField<5799> MatchEventIndicator;
typedef IntField<268> NoMDEntries;
typedef StringField<279> MDUpateAction;
typedef StringField<269> MDEntryType;
typedef StringField<48> SecurityID;
typedef StringField<55> Symbol;
typedef StringField<83> ReptSeq;
typedef FloatField<270> MDEntryPx;
typedef IntField<271> MDEntrySize;
typedef IntField<346> NumberOfOrders;
typedef IntField<1023> MDPriceLevel;
typedef StringField<286> OpenCloseSettlFlag;
typedef StringField<731> SettlPriceType;
typedef StringField<5797> AggressorSide;
typedef StringField<37711> MDTradeEntryID;
typedef StringField<5796> TradingReferenceDate;
typedef StringField<1149> HighLimitPrice;
typedef StringField<1148> LowLimitPrice;
typedef StringField<1143> MaxPriceVariation;
typedef StringField<1180> ApplID;
typedef IntField<9633> ReferenceID;
typedef IntField<32> LastQty;
typedef IntField<37705> NoOrderIDEntries;
typedef StringField<37> OrderID;
typedef IntField<37707> MDOrderPriority;
typedef IntField<37706> MDDisplayQty;
typedef StringField<37708> OrderUpdateAction;
typedef Group<NoOrderIDEntries, OrderID, MDDisplayQty, MDOrderPriority,
OrderUpdateAction, ReferenceID, LastQty>
OrderIDEntries;
typedef Group<NoMDEntries, MDUpateAction, MDEntryType, SecurityID, Symbol,
ReptSeq, MDEntryPx, MDEntrySize, NumberOfOrders, MDPriceLevel,
OpenCloseSettlFlag, SettlPriceType, AggressorSide, MDTradeEntryID,
TradingReferenceDate, HighLimitPrice, LowLimitPrice,
MaxPriceVariation, ApplID, ReferenceID, LastQty, OrderID,
MDOrderPriority, MDDisplayQty>
MDEntries;
typedef FIXMsg<MessageTypes::MDIncrementalUpdate, TradeDate, SeqNum,
SendingTime, TransactTime, MatchEventIndicator, MDEntries,
OrderIDEntries>
MDIncrementalUpdate;
std::string to_str(std::string const &s) { return s; }
template <class V> std::string to_str(V const &v) { return std::to_string(v); }
template <class F, class G> std::string get_if_valid(G const &update) {
if (update.template has<F>())
return to_str(update.template get<F>());
else
return "";
}
void print_msg_headers(std::ostream &out) {
out << "MsgID,"
<< "TradeDate,"
<< "SeqNum,"
<< "SendingTime,"
<< "TransactTime,"
<< "MatchEventIndicator,"
<< "NoMDEntries,"
<< "NoOrderIDEntries\n";
}
void print_msgs(size_t msg_idx, MDIncrementalUpdate const &line,
std::ostream &out) {
line.get<SeqNum>();
out << msg_idx << "," << get_if_valid<TradeDate>(line) << ","
<< get_if_valid<SeqNum>(line) << "," << get_if_valid<SendingTime>(line)
<< "," << get_if_valid<TransactTime>(line) << ","
<< get_if_valid<MatchEventIndicator>(line) << ","
<< (line.has<MDEntries>() ? line.get<MDEntries>().size() : 0) << ","
<< (line.has<OrderIDEntries>() ? line.get<OrderIDEntries>().size() : 0)
<< "\n";
}
struct PriceSize {
double price = 0;
int32_t size = 0;
};
struct Book {
Book() {
book[0].resize(10);
book[1].resize(10);
}
std::string symbol;
std::string transact_time;
std::string send_time;
uint32_t seqnum;
std::array<std::vector<PriceSize>, 2> book;
};
size_t n_printed_books = 2;
void print_book_side(std::vector<PriceSize> const &side,
std::ostream &book_stream) {
for (size_t i = 0; i < n_printed_books; i++)
if (i < side.size())
book_stream << "," << side[i].price << "," << side[i].size;
else
book_stream << "," << 0 << "," << 0;
}
void print_book_header(std::ostream &book_stream) {
book_stream << "Symbol,SendingTime,TransactTime, SeqnNum";
for (size_t i = 0; i < n_printed_books; i++)
book_stream << ",bid_p_" << i << ",bid_sz_" << i;
for (size_t i = 0; i < n_printed_books; i++)
book_stream << ",ask_p_" << i << ",ask_sz_" << i;
book_stream << ",\n";
}
void print_book(Book &b, std::ostream &book_stream) {
book_stream << b.symbol << "," << b.send_time << "," << b.transact_time
<< "," << b.seqnum;
print_book_side(b.book[0], book_stream);
print_book_side(b.book[1], book_stream);
book_stream << "\n";
}
void update_and_maybe_print_book(MDIncrementalUpdate const &update,
std::unordered_map<std::string, Book> &books,
std::ostream &book_stream) {
std::set<Book *> to_update;
if (update.has<MDEntries>()) {
auto &md_entries = update.get<MDEntries>();
for (size_t i = 0; i < md_entries.size(); i++) {
auto &entry = md_entries[i];
if (entry.has<MDPriceLevel>()) {
if (entry.get<MDEntryType>() == "0" ||
entry.get<MDEntryType>() == "1") {
auto side = entry.get<MDEntryType>()[0] - '0';
auto &sym = entry.get<Symbol>();
auto &book = books[sym];
to_update.insert(&book);
auto &book_side = book.book[side];
book.symbol = sym;
book.transact_time = update.get<TransactTime>();
book.send_time = update.get<SendingTime>();
book.transact_time = update.get<TransactTime>();
book.seqnum = update.get<SeqNum>();
auto level = entry.get<MDPriceLevel>() - 1;
if (entry.get<MDUpateAction>() == "0") // new
book_side.insert(
book_side.begin() + level,
{entry.get<MDEntryPx>(), entry.get<MDEntrySize>()});
else if (entry.get<MDUpateAction>() == "1")
book_side[level] = {entry.get<MDEntryPx>(),
entry.get<MDEntrySize>()};
else
book_side.erase(book_side.begin() + level);
}
}
}
auto indicator = update.get<MatchEventIndicator>();
if (indicator[5] == '1')
for (auto b : to_update)
print_book(*b, book_stream);
}
}
void print_trades_header(std::ostream &trade_stream) {
trade_stream << "Symbol,SendingTime,TransactTime,MDEntryPx,MDEntrySize,"
"NumberOfOrders,AggressorSide,MDTradeEntryID,AgressorOID,"
"RestingOID,PartialQty";
trade_stream << "\n";
}
struct TradeSummaryItem {
std::string symbol;
std::string sending_time;
std::string transact_time;
double md_entry_px;
uint32_t md_entry_size;
uint32_t n_orders;
std::string agressor_side;
std::string md_trade_entry_id;
};
struct TradeOrder {
std::string order_id;
uint32_t last_qty;
};
struct TradeSummaryEvent {
std::vector<TradeSummaryItem> md_entries;
std::vector<TradeOrder> orderid_entries;
};
void print_trades(TradeSummaryEvent &event, std::ostream &trade_stream) {
size_t current_order = 0;
for (auto &trade : event.md_entries) {
for (auto i = current_order; i < current_order + trade.n_orders; i++) {
trade_stream << trade.symbol << "," << trade.sending_time << ","
<< trade.transact_time << "," << trade.md_entry_px << ","
<< trade.md_entry_size << "," << trade.n_orders << ","
<< trade.agressor_side << "," << trade.md_trade_entry_id
<< "," << event.orderid_entries[current_order].order_id
<< "," << event.orderid_entries[i].order_id << ","
<< event.orderid_entries[i].last_qty << "\n";
}
current_order += trade.n_orders;
}
}
void update_and_maybe_print_trades(MDIncrementalUpdate const &update,
TradeSummaryEvent &event,
std::ostream &trade_stream) {
if (update.has<MDEntries>()) {
auto &md_entries = update.get<MDEntries>();
bool is_trade_summary = false;
for (size_t i = 0; i < md_entries.size(); i++) {
auto &entry = md_entries[i];
if (entry.get<MDEntryType>() == "2") {
is_trade_summary = true;
TradeSummaryItem item;
item.symbol = entry.get<Symbol>();
item.sending_time = update.get<SendingTime>();
item.transact_time = update.get<TransactTime>();
item.md_entry_px = entry.get<MDEntryPx>();
item.md_entry_size = entry.get<MDEntrySize>();
item.n_orders = entry.get<NumberOfOrders>();
item.agressor_side = entry.get<AggressorSide>();
item.md_trade_entry_id = entry.get<MDTradeEntryID>();
event.md_entries.emplace_back(std::move(item));
}
if (is_trade_summary) {
if (update.has<OrderIDEntries>()) {
auto &oid_entries = update.get<OrderIDEntries>();
for (size_t i = 0; i < oid_entries.size(); i++) {
auto &oid = oid_entries[i];
TradeOrder order_id_entry;
order_id_entry.order_id = oid.get<OrderID>();
order_id_entry.last_qty = oid.get<LastQty>();
event.orderid_entries.emplace_back(std::move(order_id_entry));
}
}
auto indicator = update.get<MatchEventIndicator>();
if (indicator[7] == '1') {
print_trades(event, trade_stream);
event.md_entries.clear();
event.orderid_entries.clear();
}
}
}
}
}
void print_orders_header(std::ostream &orders_stream) {
orders_stream << "Symbol,"
<< "SendingTime,"
<< "TransactTime,"
<< "MDEntryPx,"
<< "OrderID,"
<< "MDDisplayQty,"
<< "MDOrderPriority,"
<< "OrderUpdateAction,"
<< "Side"
<< "\n";
}
struct Order {
std::string sending_time;
std::string transact_time;
std::string side;
std::string order_id;
std::string order_update_action;
uint32_t md_order_priority;
uint32_t display_qty;
std::string symbol;
double md_entry_px;
};
void print_order(Order const& order, std::ostream &orders_stream) {
orders_stream << order.symbol << ","
<< order.sending_time << ","
<< order.transact_time << ","
<< order.md_entry_px << ","
<< order.order_id << ","
<< order.display_qty << ","
<< order.md_order_priority << ","
<< order.order_update_action << ","
<< order.side << "\n";
}
void print_orders(MDIncrementalUpdate const &update,std::ostream &orders_stream) {
if (update.has<MDEntries>()) {
auto &md_entries = update.get<MDEntries>();
auto & first_entry = md_entries[0];
if (first_entry.get<MDEntryType> () == "0" ||
first_entry.get<MDEntryType> () == "1") {
Order order;
order.sending_time = update.get<SendingTime>();
order.transact_time = update.get<TransactTime>();
order.side = first_entry.get<MDEntryType> ();
if (first_entry.has<MDPriceLevel>()) {
// combined template https://www.cmegroup.com/confluence/display/EPICSANDBOX/Incremental+Refresh+SBE+Template+Book+Processing
if (update.has<OrderIDEntries>()) {
auto &oid_entries = update.get<OrderIDEntries>();
for (size_t i = 0; i < oid_entries.size(); i++) {
auto &oid = oid_entries[i];
order.order_id = oid.get<OrderID>();
order.order_update_action = oid.get<OrderUpdateAction>();
order.md_order_priority = oid.get<MDOrderPriority>();
order.display_qty = oid.get<MDDisplayQty>();
auto &md_entry = update.get<MDEntries>()[oid.get<ReferenceID>()-1];
order.symbol = md_entry.get<Symbol>();
order.md_entry_px = md_entry.get<MDEntryPx>();
print_order(order, orders_stream);
}
}
}
else {
// MBO only template
for (size_t i = 0; i < md_entries.size(); i++) {
auto &entry = md_entries[i];
order.order_id = entry.get<OrderID>();
order.order_update_action = entry.get<MDUpateAction>();
order.md_order_priority = entry.get<MDOrderPriority>();
order.display_qty = entry.get<MDDisplayQty>();
order.symbol = entry.get<Symbol>();
order.md_entry_px = entry.get<MDEntryPx>();
print_order(order,orders_stream);
}
}
}
}
}
int ParseHistoricalFIX::execute(std::vector<std::string> const &args) {
std::ifstream input(args[0]);
std::ofstream books_stream(args[0] + "_books.csv");
std::ofstream msgs_stream(args[0] + "_msgs.csv");
std::ofstream trades_stream(args[0] + "_trades.csv");
std::ofstream orders_stream(args[0] + "_orders.csv");
std::unordered_map<std::string, Book> books;
TradeSummaryEvent current_trade_summary;
MDIncrementalUpdate update;
FIXParser<MDIncrementalUpdate> parser;
std::string line;
size_t c = 0;
auto ok = 0;
auto start = Timer::now();
print_book_header(books_stream);
print_msg_headers(msgs_stream);
print_trades_header(trades_stream);
print_orders_header(orders_stream);
while (std::getline(input, line)) {
c++;
auto parsed_ptr = parser.parse(InMsgBuffer(
line.data(), line.size(), std::shared_ptr<std::string>{}));
if (parsed_ptr) {
auto msg =
std::dynamic_pointer_cast<const MDIncrementalUpdate>(parsed_ptr);
update_and_maybe_print_book(*msg, books, books_stream);
print_msgs(c, *msg, msgs_stream);
update_and_maybe_print_trades(*msg, current_trade_summary,
trades_stream);
print_orders(*msg, orders_stream);
}
ok += (bool)(parsed_ptr);
}
auto sec_duration = sec_diff(Timer::now(), start);
std::cout << (int)(c / 1000 / sec_duration) << " Km/sec parsed: " << ok
<< " out of " << c << " time: " << sec_duration << " secs\n";
return 0;
}
std::string ParseHistoricalFIX::help() {
return "ParseHistoricalFIX <input> will produce 2 files, "
"<input>_mdentries.csv and <input>order_entries.csv";
}
} // namespace cmd
} // namespace bts
@@ -0,0 +1,17 @@
#pragma once
#include "ICmd.h"
namespace bts {
namespace cmd {
class ParseHistoricalFIX : public ICmd
{
public:
int execute(std::vector<std::string> const &args);
std::string help ();
};
}}
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include "lib/api/public/ServiceContext.h"
#include "lib/api/apigateway.pb.h"
#include "lib/api/Apigateway.pb.h"
#include <memory>
#include <functional>
Loaded 100 of 113 files, more files were not shown because too many files have changed in this diff. Show more