Order making
This commit is contained in:
@@ -209,7 +209,8 @@ impl StrategyEngine {
|
||||
};
|
||||
|
||||
let order = BatchOrder {
|
||||
orders: vec![OrderRequest {
|
||||
orders: vec![
|
||||
OrderRequest {
|
||||
asset: asset_id,
|
||||
is_buy: matches!(signal.kind, Direction::Buy),
|
||||
limit_px: signal.price.0,
|
||||
@@ -219,7 +220,34 @@ impl StrategyEngine {
|
||||
tif: TimeInForce::Gtc,
|
||||
},
|
||||
cloid: Default::default(),
|
||||
}],
|
||||
},
|
||||
OrderRequest {
|
||||
asset: asset_id,
|
||||
is_buy: matches!(signal.kind, Direction::Buy),
|
||||
limit_px: signal.price.0,
|
||||
sz: signal.size,
|
||||
reduce_only: true,
|
||||
order_type: OrderTypePlacement::Trigger {
|
||||
is_market: true,
|
||||
trigger_px: signal.take_profit.0,
|
||||
tpsl: hypercore::TpSl::Tp,
|
||||
},
|
||||
cloid: Default::default(),
|
||||
},
|
||||
OrderRequest {
|
||||
asset: asset_id,
|
||||
is_buy: matches!(signal.kind, Direction::Buy),
|
||||
limit_px: signal.price.0,
|
||||
sz: signal.size,
|
||||
reduce_only: true,
|
||||
order_type: OrderTypePlacement::Trigger {
|
||||
is_market: true,
|
||||
trigger_px: signal.stop_loss.0,
|
||||
tpsl: hypercore::TpSl::Sl,
|
||||
},
|
||||
cloid: Default::default(),
|
||||
},
|
||||
],
|
||||
grouping: hypercore::OrderGrouping::Na,
|
||||
builder: None,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user