| pub mod compiler; |
| pub mod data; |
| pub mod engine; |
| pub mod ui; |
|
|
| use eframe::egui; |
| use ui::backtest_panel::BacktestPanel; |
|
|
| struct MqlRustApp { |
| backtest_panel: BacktestPanel, |
| } |
|
|
| impl MqlRustApp { |
| fn new(_cc: &eframe::CreationContext<'_>) -> Self { |
| Self { |
| backtest_panel: BacktestPanel::new(), |
| } |
| } |
| } |
|
|
| impl eframe::App for MqlRustApp { |
| fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { |
| egui::CentralPanel::default().show(ctx, |ui| { |
| ui.heading("MQL-Rust Compiler & Backtester"); |
| ui.separator(); |
| |
| |
| if let Some(config) = self.backtest_panel.draw(ui) { |
| |
| self.backtest_panel.compiler_log.push_str(&format!( |
| "\n> Starting backtest with Deposit: ${}, Leverage: 1:{}, Spread Modifier: {}", |
| config.initial_deposit, config.leverage, config.spread_modifier |
| )); |
| |
| } |
| }); |
| } |
| } |
|
|
| fn main() -> eframe::Result<()> { |
| let options = eframe::NativeOptions { |
| viewport: egui::ViewportBuilder::default() |
| .with_inner_size([600.0, 700.0]) |
| .with_title("MQL-Rust"), |
| ..Default::default() |
| }; |
| |
| eframe::run_native( |
| "MQL-Rust Console", |
| options, |
| Box::new(|cc| Ok(Box::new(MqlRustApp::new(cc)))), |
| ) |
| } |
|
|