Removed risk
This commit is contained in:
+1
-31
@@ -6,7 +6,7 @@ pub use hypersdk;
|
||||
|
||||
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
||||
|
||||
use crate::plugin::{RiskEngineMessage, StrategyEngineMessage};
|
||||
use crate::plugin::StrategyEngineMessage;
|
||||
|
||||
pub mod prelude {
|
||||
pub use crate::general::*;
|
||||
@@ -112,33 +112,3 @@ pub trait Strategy {
|
||||
unimplemented!("Strategy::candlestick")
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(async_fn_in_trait)]
|
||||
pub trait Risk {
|
||||
engine_methods!(prelude::RiskMessage);
|
||||
|
||||
async fn on_raw(&self, data: &[u8]) -> tokio::io::Result<()> {
|
||||
match map_postcard_err(postcard::from_bytes(&data))? {
|
||||
RiskEngineMessage::Initialize => self.initialize().await,
|
||||
RiskEngineMessage::Command { command, args } => self.command(command, args).await,
|
||||
RiskEngineMessage::WatchList(watchlist) => self.watchlist(watchlist).await,
|
||||
RiskEngineMessage::Signal(signal) => self.signal_request(signal).await,
|
||||
}
|
||||
}
|
||||
|
||||
async fn initialize(&self) -> tokio::io::Result<()> {
|
||||
unimplemented!("Risk::initialize")
|
||||
}
|
||||
|
||||
async fn command(&self, _command: String, _args: Vec<String>) -> tokio::io::Result<()> {
|
||||
unimplemented!("Risk::command")
|
||||
}
|
||||
|
||||
async fn watchlist(&self, _watchlist: Vec<prelude::MarketItem>) -> tokio::io::Result<()> {
|
||||
unimplemented!("Risk::watchlist")
|
||||
}
|
||||
|
||||
async fn signal_request(&self, _signal: prelude::StrategySignal) -> tokio::io::Result<()> {
|
||||
unimplemented!("Risk::signal_request")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user