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());