mirror of
https://github.com/KhizarImran/backtestingfx.git
synced 2026-08-09 02:07:53 +00:00
29 lines
656 B
Rust
29 lines
656 B
Rust
|
|
#[derive(Debug, Clone)]
|
||
|
|
pub struct Bar { // Initialises the interface for the bar
|
||
|
|
pub timestamp: i64,
|
||
|
|
pub open: f64,
|
||
|
|
pub high: f64,
|
||
|
|
pub low: f64,
|
||
|
|
pub close: f64,
|
||
|
|
pub volume: f64,
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Debug, Clone)]
|
||
|
|
pub struct Position { // this is for the trading position
|
||
|
|
pub entry_price: f64,
|
||
|
|
pub lot_size: f64,
|
||
|
|
pub is_long: bool,
|
||
|
|
pub entry_timestamp: i64
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Debug, Clone)]
|
||
|
|
pub struct Trade { // the actual trade
|
||
|
|
pub entry_price: f64,
|
||
|
|
pub exit_price: f64,
|
||
|
|
pub lot_size: f64,
|
||
|
|
pub is_long: bool,
|
||
|
|
pub pnl: f64,
|
||
|
|
pub entry_timestamp: i64,
|
||
|
|
pub exit_timestamp:i64
|
||
|
|
}
|