scuriolus 0.1.0

Scuriolus is a modular trading bot platform. It can apply different strategies to various markets, as described below.
Documentation
use tokio::sync::Notify;
use std::sync::Arc;

use super::super::{Amount, Crypto, Market};
use super::{AtomicState, Core, State, Strategy, StrategyBase};



pub struct SimpleStrategy<M: Market> {
    core: Core<M>,
    state: Arc<AtomicState>,
    notify: Notify,
    asset: Crypto,
    amount: Amount,
    currency: Crypto,
}

impl<M: Market> SimpleStrategy<M> {
    pub fn new(core: Core<M>, asset: Crypto, amount: Amount, currency: Crypto) -> Self {
        let state = Arc::new(AtomicState::new(State::Stopped));
        let notify = Notify::new();
        Self {
            core,
            state,
            notify,
            asset,
            amount,
            currency,
        }
    }
}

impl<M:Market> StrategyBase for SimpleStrategy<M> {
    fn state(&self) -> &Arc<AtomicState> {
        &self.state
    }

    fn notify(&self) -> &Notify {
        &self.notify
    }
}

impl<M: Market> Strategy for SimpleStrategy<M> {
    async fn run(self) {

    }
}