use tokio::time::{delay_for, Duration}; use crate::bot::BfxBot; use crate::connectors::BfxWrapper; use crate::currency::{Symbol, SymbolPair}; use crate::events::SignalKind; use crate::strategy::TrailingStop; use std::thread::JoinHandle; mod bot; mod connectors; mod currency; mod events; mod managers; mod models; mod pairs; mod strategy; mod ticker; pub type BoxError = Box; #[tokio::main] async fn main() -> Result<(), BoxError> { let test_api_key = "P1EVE68DJByDAkGQvpIkTwfrbYXd2Vo2ZaIhTYb9vx2"; let test_api_secret = "1nicg8z0zKVEt5Rb7ZDpIYjVYVTgvCaCPMZqB0niFli"; let bfx = BfxWrapper::new(test_api_key, test_api_secret) .with_affiliate_code(Some("XPebOgHxA".into())); let mut bot = BfxBot::new( bfx, vec![Symbol::TESTBTC], Symbol::TESTUSD, Duration::new(20, 0), ) .with_strategy(Box::new(TrailingStop::new())); Ok(bot.start_loop().await?) }