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

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

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

Collaboration diagram for algotradelib::runner::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 442 of file intent.hpp.

Member Data Documentation

◆ instrument_

◆ limit_

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

Definition at line 448 of file intent.hpp.

◆ tag_

A label carried to the orders and their fills.

Definition at line 450 of file intent.hpp.

◆ target_quantity_

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

Definition at line 446 of file intent.hpp.


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