algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::runner::CancelIntent< Broker > Struct Template Reference

A request to cancel one working order. More...

#include <algotradelib/src/strategy/intent.hpp>

Public Attributes

OrderRef< Broker > ref_
 The order to cancel.
std::string tag_
 A label for attribution.

Detailed Description

template<typename Broker>
struct algotradelib::runner::CancelIntent< Broker >

A request to cancel one working order.

A strategy does not name the broker type: take the reference from the portfolio with auto and pass it to ctx.cancel(...):

template <class Ctx>
void on_bar(Ctx& ctx, const BarEvent&) {
for (const auto& working : ctx.portfolio().working_) {
ctx.cancel(working.ref_);
}
}
One bar, delivered to on_bar.
Definition event.hpp:202
Template Parameters
BrokerThe broker tag; a reference from one broker cannot be passed to another.

Definition at line 471 of file intent.hpp.

Member Data Documentation

◆ ref_

template<typename Broker>
OrderRef<Broker> algotradelib::strategy::CancelIntent< Broker >::ref_

The order to cancel.

Definition at line 473 of file intent.hpp.

◆ tag_

template<typename Broker>
std::string algotradelib::strategy::CancelIntent< Broker >::tag_

A label for attribution.

Definition at line 475 of file intent.hpp.


The documentation for this struct was generated from the following file: