Slick Trader 0.11.0
Multi-broker algorithmic trading engine with plugin strategies and a live web dashboard
Loading...
Searching...
No Matches
slick::trader::PositionTracker Class Reference

#include <slick-trader/core/position_tracker.hpp>

Collaboration diagram for slick::trader::PositionTracker:

Public Member Functions

 PositionTracker ()=default
 ~PositionTracker ()=default
void attach_store (PositionStore &store)
void on_fill (const std::string &strategy_id, const OrderFillEvent &fill)
bool fill_handled (const OrderFillEvent &fill) const noexcept
void fill_dispatched (const OrderFillEvent &fill) noexcept
Position get_position (const std::string &strategy_id, std::string_view instrument) const
std::unordered_map< std::string, Position > get_all_positions (const std::string &strategy_id) const
std::unordered_map< std::string, std::unordered_map< std::string, Position > > get_all_positions () const
void clear_strategy_positions (const std::string &strategy_id)
void clear_all ()
bool set_contract_multiplier (std::string_view instrument, double multiplier)
double get_contract_multiplier (std::string_view instrument) const
void set_fee_structure (FeeStructure fee_structure)
const FeeStructure & get_fee_structure () const

Detailed Description

Definition at line 20 of file position_tracker.hpp.

Constructor & Destructor Documentation

◆ PositionTracker()

slick::trader::PositionTracker::PositionTracker ( )
default

◆ ~PositionTracker()

slick::trader::PositionTracker::~PositionTracker ( )
default

Member Function Documentation

◆ attach_store()

◆ clear_all()

void slick::trader::PositionTracker::clear_all ( )

Definition at line 272 of file position_tracker.cpp.

◆ clear_strategy_positions()

void slick::trader::PositionTracker::clear_strategy_positions ( const std::string & strategy_id)

Definition at line 264 of file position_tracker.cpp.

◆ fill_dispatched()

void slick::trader::PositionTracker::fill_dispatched ( const OrderFillEvent & fill)
noexcept

◆ fill_handled()

bool slick::trader::PositionTracker::fill_handled ( const OrderFillEvent & fill) const
inlinenoexcept

Definition at line 40 of file position_tracker.hpp.

◆ get_all_positions() [1/2]

std::unordered_map< std::string, std::unordered_map< std::string, Position > > slick::trader::PositionTracker::get_all_positions ( ) const

Definition at line 250 of file position_tracker.cpp.

◆ get_all_positions() [2/2]

std::unordered_map< std::string, Position > slick::trader::PositionTracker::get_all_positions ( const std::string & strategy_id) const

Definition at line 233 of file position_tracker.cpp.

◆ get_contract_multiplier()

double slick::trader::PositionTracker::get_contract_multiplier ( std::string_view instrument) const

Definition at line 212 of file position_tracker.cpp.

Referenced by on_fill().

◆ get_fee_structure()

const FeeStructure & slick::trader::PositionTracker::get_fee_structure ( ) const
inline

Definition at line 78 of file position_tracker.hpp.

◆ get_position()

Position slick::trader::PositionTracker::get_position ( const std::string & strategy_id,
std::string_view instrument ) const

Definition at line 217 of file position_tracker.cpp.

◆ on_fill()

◆ set_contract_multiplier()

bool slick::trader::PositionTracker::set_contract_multiplier ( std::string_view instrument,
double multiplier )

Definition at line 192 of file position_tracker.cpp.

Referenced by on_fill().

◆ set_fee_structure()

void slick::trader::PositionTracker::set_fee_structure ( FeeStructure fee_structure)
inline

Definition at line 77 of file position_tracker.hpp.


The documentation for this class was generated from the following files: