Refactored codebase to Strategy instead of plugin
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
use crate::{
|
||||
general::{EventLog, Signal},
|
||||
terminal::MarketItem,
|
||||
};
|
||||
use hypersdk::hypercore::{Candle, CandleInterval, Incoming, Subscription};
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct StrategyManifest {
|
||||
pub name: String,
|
||||
pub description: String,
|
||||
pub author: String,
|
||||
pub version: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub enum StrategyMessage {
|
||||
Log(EventLog),
|
||||
|
||||
GetWatchList,
|
||||
|
||||
GetCandlestick {
|
||||
symbol: String,
|
||||
interval: CandleInterval,
|
||||
count: u32,
|
||||
},
|
||||
|
||||
Subscribe(Subscription),
|
||||
|
||||
Unsubscribe(Subscription),
|
||||
|
||||
UnsubscribeAll,
|
||||
|
||||
Signal(Signal),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub enum StrategyEngineMessage {
|
||||
Initialize,
|
||||
|
||||
WatchList(Vec<MarketItem>),
|
||||
|
||||
Command {
|
||||
command: String,
|
||||
args: Vec<String>,
|
||||
},
|
||||
|
||||
Incoming(Incoming),
|
||||
|
||||
Candlestick {
|
||||
symbol: String,
|
||||
interval: CandleInterval,
|
||||
candles: Vec<Candle>,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user