|
Slick Trader 0.11.0
Multi-broker algorithmic trading engine with plugin strategies and a live web dashboard
|
#include <slick-trader/core/position.hpp>
Public Member Functions | |
| Position ()=default | |
| Position (std::string_view inst) | |
| bool | is_flat () const |
| bool | is_long () const |
| bool | is_short () const |
| double | get_unrealized_pnl (price_t mark_price) const |
| double | get_total_pnl (price_t mark_price) const |
Public Attributes | |
| std::string | instrument |
| qty_t | quantity {0} |
| price_t | avg_price {0} |
| price_t | realized_pnl {0} |
| price_t | realized_fees {0} |
| price_t | open_fees {0} |
| double | multiplier {1.0} |
| uint64_t | last_update_time {0} |
Definition at line 11 of file position.hpp.
|
default |
|
inline |
Definition at line 22 of file position.hpp.
References instrument.
|
inline |
Definition at line 34 of file position.hpp.
References slick::trader::from_price_t(), get_unrealized_pnl(), and realized_pnl.
|
inline |
Definition at line 29 of file position.hpp.
References avg_price, slick::trader::from_price_t(), slick::trader::from_qty_t(), is_flat(), multiplier, and quantity.
Referenced by get_total_pnl().
|
inline |
Definition at line 24 of file position.hpp.
References quantity.
Referenced by get_unrealized_pnl().
|
inline |
Definition at line 25 of file position.hpp.
References quantity.
|
inline |
Definition at line 26 of file position.hpp.
References quantity.
| price_t slick::trader::Position::avg_price {0} |
Definition at line 14 of file position.hpp.
Referenced by slick::trader::PositionTracker::attach_store(), slick::trader::PositionStore::for_each(), get_unrealized_pnl(), and slick::trader::PositionStore::save().
| std::string slick::trader::Position::instrument |
Definition at line 12 of file position.hpp.
Referenced by Position(), slick::trader::PositionTracker::attach_store(), and slick::trader::PositionStore::save().
| uint64_t slick::trader::Position::last_update_time {0} |
Definition at line 19 of file position.hpp.
Referenced by slick::trader::PositionStore::for_each(), and slick::trader::PositionStore::save().
| double slick::trader::Position::multiplier {1.0} |
Definition at line 18 of file position.hpp.
Referenced by slick::trader::PositionTracker::attach_store(), slick::trader::PositionStore::for_each(), get_unrealized_pnl(), and slick::trader::PositionStore::save().
| price_t slick::trader::Position::open_fees {0} |
Definition at line 17 of file position.hpp.
Referenced by slick::trader::PositionStore::for_each(), and slick::trader::PositionStore::save().
| qty_t slick::trader::Position::quantity {0} |
Definition at line 13 of file position.hpp.
Referenced by slick::trader::PositionTracker::attach_store(), slick::trader::PositionStore::for_each(), get_unrealized_pnl(), is_flat(), is_long(), is_short(), and slick::trader::PositionStore::save().
| price_t slick::trader::Position::realized_fees {0} |
Definition at line 16 of file position.hpp.
Referenced by slick::trader::PositionStore::for_each(), and slick::trader::PositionStore::save().
| price_t slick::trader::Position::realized_pnl {0} |
Definition at line 15 of file position.hpp.
Referenced by slick::trader::PositionTracker::attach_store(), slick::trader::PositionStore::for_each(), get_total_pnl(), and slick::trader::PositionStore::save().