Cooldown config
This commit is contained in:
@@ -54,7 +54,7 @@ impl Engine {
|
||||
loop {
|
||||
refresh.tick().await;
|
||||
|
||||
let watch_list = &self.config.lock().await.watchlist.symbols;
|
||||
let watch_list = &self.config.lock().await.watchlist;
|
||||
|
||||
match crate::fetch::fetch_watch_list(&client, watch_list).await {
|
||||
Ok(watch_list) => {
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
#[derive(Debug, Default, serde::Serialize, serde::Deserialize)]
|
||||
pub struct WatchList {
|
||||
pub symbols: Vec<String>,
|
||||
}
|
||||
use hypersdk::hypercore::CandleInterval;
|
||||
|
||||
#[derive(Debug, Default, serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Debug, serde::Serialize, serde::Deserialize)]
|
||||
pub struct Config {
|
||||
pub watchlist: WatchList,
|
||||
pub watchlist: Vec<String>,
|
||||
pub strategy: String,
|
||||
pub risk: String,
|
||||
pub cooldown: CandleInterval,
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
watchlist: vec!["BTC".to_string(), "SOL".to_string(), "ETH".to_string()],
|
||||
strategy: String::new(),
|
||||
risk: String::new(),
|
||||
cooldown: CandleInterval::ThirtyMinutes,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Config {
|
||||
|
||||
@@ -69,7 +69,7 @@ impl TerminalServer {
|
||||
risk: engine.strategy.risk.manifest.lock().await.clone(),
|
||||
mode: Mode::Auto,
|
||||
state: ItemState::Running,
|
||||
cooldown: hypersdk::hypercore::CandleInterval::ThirtyMinutes,
|
||||
cooldown: engine.config.lock().await.cooldown,
|
||||
}),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Reference in New Issue
Block a user