Slick Sim 0.10.1
Exchange simulator that shadows real venues for risk-free strategy testing
Loading...
Searching...
No Matches
slick::sim::Order Struct Reference

#include <common/order.hpp>

Inheritance diagram for slick::sim::Order:
Collaboration diagram for slick::sim::Order:

Public Member Functions

void resetFillAccounting (qty_t new_qty=0) noexcept
 Order ()=default
bool restsRemainder () const noexcept
 Whether what matching leaves of it rests on the book; otherwise it is cancelled.
double price_double () const noexcept
double qty_double () const noexcept
double cum_qty_double () const noexcept
double leaves_qty_double () const noexcept
double last_fill_qty_double () const noexcept
double last_fill_price_double () const noexcept
double avg_fill_price_double () const noexcept

Public Attributes

uint64_t id
uint64_t priority = 0
uint64_t request_tag = 0
 Request::request_tag of the last request this order accepted, echoed on its responses.
Side side = Side::BUY
OrderType type = OrderType::MARKET
OrderStatus status = OrderStatus::NEW
TimeInForce time_in_force = TimeInForce::DAY
ProductType product_type = ProductType::UNKNOWN
bool post_only = false
bool pending_cancel = false
bool size_in_quote = false
price_t price = 0
qty_t quantity = 0
qty_t leaves_quantity = 0
price_t avg_fill_price = 0
qty_t cum_quantity = 0
cum_value_t cum_value = 0
price_t last_fill_price = 0
qty_t last_fill_qty = 0
uint32_t num_fills = 0
double fee = 0
double filled_value = 0
int client_id = -1
uint64_t created_time = utils::get_current_time_ns()
uint64_t last_update_time = created_time
std::optional< uint64_t > last_fill_time
std::string end_time
std::string reject_message
std::string cancel_message
json edit_history = json::array()
Public Attributes inherited from slick::sim::OrderIdentity
utils::fixed_string< 32 > symbol
utils::fixed_string< 37 > user_id
utils::fixed_string< 37 > client_order_id
utils::fixed_string< 37 > order_id

Detailed Description

Definition at line 299 of file order.hpp.

Constructor & Destructor Documentation

◆ Order()

slick::sim::Order::Order ( )
default

Member Function Documentation

◆ avg_fill_price_double()

double slick::sim::Order::avg_fill_price_double ( ) const
inlinenoexcept

Definition at line 386 of file order.hpp.

References avg_fill_price, and slick::sim::to_price_double().

◆ cum_qty_double()

double slick::sim::Order::cum_qty_double ( ) const
inlinenoexcept

Definition at line 370 of file order.hpp.

References cum_quantity, and slick::sim::to_qty_double().

Referenced by slick::sim::order_gateway::coinbase::to_json().

◆ last_fill_price_double()

double slick::sim::Order::last_fill_price_double ( ) const
inlinenoexcept

Definition at line 382 of file order.hpp.

References last_fill_price, and slick::sim::to_price_double().

◆ last_fill_qty_double()

double slick::sim::Order::last_fill_qty_double ( ) const
inlinenoexcept

Definition at line 378 of file order.hpp.

References last_fill_qty, and slick::sim::to_qty_double().

◆ leaves_qty_double()

double slick::sim::Order::leaves_qty_double ( ) const
inlinenoexcept

◆ price_double()

double slick::sim::Order::price_double ( ) const
inlinenoexcept

Definition at line 362 of file order.hpp.

References price, and slick::sim::to_price_double().

◆ qty_double()

double slick::sim::Order::qty_double ( ) const
inlinenoexcept

Definition at line 366 of file order.hpp.

References quantity, and slick::sim::to_qty_double().

Referenced by slick::sim::order_gateway::coinbase::to_json().

◆ resetFillAccounting()

void slick::sim::Order::resetFillAccounting ( qty_t new_qty = 0)
inlinenoexcept

◆ restsRemainder()

bool slick::sim::Order::restsRemainder ( ) const
inlinenodiscardnoexcept

Whether what matching leaves of it rests on the book; otherwise it is cancelled.

A market order has no price to rest at, whatever its time in force.

Definition at line 356 of file order.hpp.

References slick::sim::DAY, slick::sim::GOOD_TILL_CANCEL, slick::sim::GOOD_TILL_DATE, slick::sim::NULL_PRICE, price, and time_in_force.

Referenced by slick::sim::exch::Symbol::addOrder(), and slick::sim::engine::detail::cancelUnrestableRemainder().

Member Data Documentation

◆ avg_fill_price

◆ cancel_message

std::string slick::sim::Order::cancel_message

◆ client_id

◆ created_time

◆ cum_quantity

◆ cum_value

cum_value_t slick::sim::Order::cum_value = 0

Definition at line 319 of file order.hpp.

Referenced by slick::sim::utils::executeOrder(), and resetFillAccounting().

◆ edit_history

json slick::sim::Order::edit_history = json::array()

Definition at line 336 of file order.hpp.

Referenced by slick::sim::order_gateway::coinbase::to_json().

◆ end_time

std::string slick::sim::Order::end_time

Definition at line 332 of file order.hpp.

◆ fee

double slick::sim::Order::fee = 0

Definition at line 323 of file order.hpp.

Referenced by resetFillAccounting(), and slick::sim::order_gateway::coinbase::to_json().

◆ filled_value

double slick::sim::Order::filled_value = 0

◆ id

◆ last_fill_price

◆ last_fill_qty

◆ last_fill_time

std::optional<uint64_t> slick::sim::Order::last_fill_time

◆ last_update_time

◆ leaves_quantity

◆ num_fills

◆ pending_cancel

bool slick::sim::Order::pending_cancel = false

◆ post_only

◆ price

◆ priority

uint64_t slick::sim::Order::priority = 0

◆ product_type

◆ quantity

◆ reject_message

std::string slick::sim::Order::reject_message

◆ request_tag

uint64_t slick::sim::Order::request_tag = 0

◆ side

◆ size_in_quote

bool slick::sim::Order::size_in_quote = false

Definition at line 312 of file order.hpp.

◆ status

◆ time_in_force

◆ type


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