pub trait Bot<MD>
where
MD: MarketDepth,
{
type Error;
fn current_timestamp(&self) -> i64;
fn num_assets(&self) -> usize;
fn position(&self, asset_no: usize) -> f64;
fn state_values(&self, asset_no: usize) -> &StateValues;
fn depth(&self, asset_no: usize) -> &MD;
fn last_trades(&self, asset_no: usize) -> &[Event];
fn orders(&self, asset_no: usize) -> &HashMap<OrderId, Order>;
fn submit_buy_order(
&mut self,
asset_no: usize,
order_id: OrderId,
price: f64,
qty: f64,
time_in_force: TimeInForce,
order_type: OrdType,
wait: bool,
) -> Result<ElapseResult, Self::Error>;
fn submit_sell_order(
&mut self,
asset_no: usize,
order_id: OrderId,
price: f64,
qty: f64,
time_in_force: TimeInForce,
order_type: OrdType,
wait: bool,
) -> Result<ElapseResult, Self::Error>;
fn cancel(
&mut self,
asset_no: usize,
order_id: OrderId,
wait: bool,
) -> Result<ElapseResult, Self::Error>;
fn elapse(&mut self, duration: i64) -> Result<ElapseResult, Self::Error>;
// ... additional methods
}