Refactored entry price
This commit is contained in:
@@ -21,7 +21,7 @@ pub struct Signal {
|
|||||||
pub symbol: String,
|
pub symbol: String,
|
||||||
pub side: Side,
|
pub side: Side,
|
||||||
pub confidence: f32,
|
pub confidence: f32,
|
||||||
pub price: Decimal,
|
pub entry_price: Decimal,
|
||||||
pub take_profit: Decimal,
|
pub take_profit: Decimal,
|
||||||
pub stop_loss: Decimal,
|
pub stop_loss: Decimal,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ impl Engine {
|
|||||||
OrderRequest {
|
OrderRequest {
|
||||||
asset: asset_id,
|
asset: asset_id,
|
||||||
is_buy: matches!(signal.side, Side::Bid),
|
is_buy: matches!(signal.side, Side::Bid),
|
||||||
limit_px: signal.price,
|
limit_px: signal.entry_price,
|
||||||
sz: 0.into(),
|
sz: 0.into(),
|
||||||
reduce_only: false,
|
reduce_only: false,
|
||||||
order_type: OrderTypePlacement::Limit {
|
order_type: OrderTypePlacement::Limit {
|
||||||
@@ -46,7 +46,7 @@ impl Engine {
|
|||||||
OrderRequest {
|
OrderRequest {
|
||||||
asset: asset_id,
|
asset: asset_id,
|
||||||
is_buy: matches!(signal.side, Side::Bid),
|
is_buy: matches!(signal.side, Side::Bid),
|
||||||
limit_px: signal.price,
|
limit_px: signal.entry_price,
|
||||||
sz: 0.into(),
|
sz: 0.into(),
|
||||||
reduce_only: true,
|
reduce_only: true,
|
||||||
order_type: OrderTypePlacement::Trigger {
|
order_type: OrderTypePlacement::Trigger {
|
||||||
@@ -59,7 +59,7 @@ impl Engine {
|
|||||||
OrderRequest {
|
OrderRequest {
|
||||||
asset: asset_id,
|
asset: asset_id,
|
||||||
is_buy: matches!(signal.side, Side::Bid),
|
is_buy: matches!(signal.side, Side::Bid),
|
||||||
limit_px: signal.price,
|
limit_px: signal.entry_price,
|
||||||
sz: 0.into(),
|
sz: 0.into(),
|
||||||
reduce_only: true,
|
reduce_only: true,
|
||||||
order_type: OrderTypePlacement::Trigger {
|
order_type: OrderTypePlacement::Trigger {
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ impl Formatted for SignalStatus {
|
|||||||
format!("\x1b[31mSELL\x1b[0m")
|
format!("\x1b[31mSELL\x1b[0m")
|
||||||
},
|
},
|
||||||
format_symbol(&signal.symbol),
|
format_symbol(&signal.symbol),
|
||||||
format_usd(signal.price.as_f64()),
|
format_usd(signal.entry_price.as_f64()),
|
||||||
format!("\x1b[33mAPR {}\x1b[0m", signal.confidence),
|
format!("\x1b[33mAPR {}\x1b[0m", signal.confidence),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ impl Formatted for SignalStatus {
|
|||||||
format!("\x1b[31mSELL\x1b[0m")
|
format!("\x1b[31mSELL\x1b[0m")
|
||||||
},
|
},
|
||||||
format_symbol(&signal.symbol),
|
format_symbol(&signal.symbol),
|
||||||
format_usd(signal.price.as_f64()),
|
format_usd(signal.entry_price.as_f64()),
|
||||||
format!("\x1b[33mAPR {}\x1b[0m", signal.confidence),
|
format!("\x1b[33mAPR {}\x1b[0m", signal.confidence),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user