algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::strategy::TargetPosition Struct Reference

The position a strategy wants to hold in one instrument. More...

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

Collaboration diagram for algotradelib::strategy::TargetPosition:

Public Attributes

InstrumentId instrument_
 The instrument.
Decimal64 target_quantity_
 The position to hold, signed: negative is short, and zero means flat.
std::optional< Price > limit_
 The limit price for the orders the runner places; without one they are market orders.
std::string tag_
 A label carried to the orders and their fills.

Detailed Description

The position a strategy wants to hold in one instrument.

The runner compares the target with the current position and the orders still working, and places only what is needed to reach it. Prefer it to OrderIntent: emitting "buy 100" again after 40 filled and 60 are working would buy 100 more, while a target of 100 buys nothing more. Submit it with ctx.submit(target).

Definition at line 451 of file intent.hpp.

Member Data Documentation

◆ instrument_

InstrumentId algotradelib::strategy::TargetPosition::instrument_

The instrument.

Definition at line 453 of file intent.hpp.

Referenced by algotradelib::strategy::reconcile(), and algotradelib::strategy::weight_target().

◆ limit_

std::optional<Price> algotradelib::strategy::TargetPosition::limit_

The limit price for the orders the runner places; without one they are market orders.

Definition at line 457 of file intent.hpp.

Referenced by algotradelib::strategy::reconcile(), and algotradelib::strategy::weight_target().

◆ tag_

std::string algotradelib::strategy::TargetPosition::tag_

A label carried to the orders and their fills.

Definition at line 459 of file intent.hpp.

Referenced by algotradelib::strategy::reconcile(), and algotradelib::strategy::weight_target().

◆ target_quantity_

Decimal64 algotradelib::strategy::TargetPosition::target_quantity_

The position to hold, signed: negative is short, and zero means flat.

Definition at line 455 of file intent.hpp.

Referenced by algotradelib::strategy::reconcile(), and algotradelib::strategy::weight_target().


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