From 95a2093dc3ca72175d901f56017fdbb229876508 Mon Sep 17 00:00:00 2001 From: Taha Afzal Date: Tue, 3 Nov 2020 17:34:35 -0500 Subject: [PATCH] SniperPolygon was not getting the pid assigned --- src/lib/orderman/orders/algo/algo_orders/SniperAlgo.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/orderman/orders/algo/algo_orders/SniperAlgo.cpp b/src/lib/orderman/orders/algo/algo_orders/SniperAlgo.cpp index 05b6ad4aa..62141c95e 100644 --- a/src/lib/orderman/orders/algo/algo_orders/SniperAlgo.cpp +++ b/src/lib/orderman/orders/algo/algo_orders/SniperAlgo.cpp @@ -94,11 +94,16 @@ struct SniperLeg{ // Polygon representation, legs and its evaluation struct SniperPolygon{ - uint32_t pid; + const uint32_t pid; std::vector legs; // last 2 computed values PriceQty prev_cross_value, curr_cross_value; + SniperPolygon(uint32_t pid) + : + pid(pid){ + } + bool has_working_order() const{ for(const auto& l : legs) if(l.working_order.has_value()) @@ -480,7 +485,7 @@ bool SniperAlgo::_onetime_setup(IBeforeLaunchAlgoServices& serv, // creates a SniperPolygon from a FilePolygon and // adds it to the state auto add_polygon = [&](const auto& file_poly){ - SniperPolygon rv; + SniperPolygon rv(file_poly.pid); for (const auto& l : file_poly.legs){ auto it = me->sec_map.find(l.resolved_key); bts_assert(it != me->sec_map.end());