diff --git a/src/lib/config/protos/toggles.proto b/src/lib/config/protos/toggles.proto index 5c3c87ee0..787cbf7e0 100644 --- a/src/lib/config/protos/toggles.proto +++ b/src/lib/config/protos/toggles.proto @@ -61,4 +61,10 @@ message EnsureOnScreenWithWorkAreaRect { message IgnoreNansInDayPnL { optional bool enabled = 1 [default = true]; +} + +message DynamicAlgos{ + optional bool enable_dorman = 1 [default = false]; + optional bool enable_pyramid = 2 [default = false]; + optional bool enable_tas = 3 [default = false]; } \ No newline at end of file diff --git a/src/lib/orderman/orders/algo/algo_orders/RegisterDorman.cpp b/src/lib/orderman/orders/algo/algo_orders/RegisterDorman.cpp index 29930db8b..70cecbb4b 100644 --- a/src/lib/orderman/orders/algo/algo_orders/RegisterDorman.cpp +++ b/src/lib/orderman/orders/algo/algo_orders/RegisterDorman.cpp @@ -3,6 +3,8 @@ #include "lib/api/services/OrderService.pb.h" #include "lib/logging/logging.h" #include "lib/orderman/orderman_utils/orderman_utils.h" +#include "lib/config/protos/toggles.pb.h" +#include "lib/config/config.h" #include "DormanAlgo.h" #include "PyramidAlgo.h" #include "TASAlgo.h" @@ -159,8 +161,13 @@ extern "C" void init_tas_plugin(bts::SparkServices& srv) { } extern "C" void init_spark_plugin(bts::SparkServices &srv) { - init_dorman_plugin(srv); - init_tas_plugin(srv); + auto dyn_algo_config = config::get(); + if(dyn_algo_config.enable_dorman()) + init_dorman_plugin(srv); + if(dyn_algo_config.enable_pyramid()) + init_pyramid_plugin(srv); + if(dyn_algo_config.enable_tas()) + init_tas_plugin(srv); } }}} \ No newline at end of file