-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
149 additions
and
142 deletions.
There are no files selected for viewing
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
market/src/strategy_manager/broker.rs → market/src/broker.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
use serde::Deserialize; | ||
|
||
use super::{trade_error::TradeError, Order}; | ||
use crate::api::alert::AlertData; | ||
|
||
#[derive(Debug, Clone, Deserialize)] | ||
#[serde(rename_all = "lowercase")] | ||
pub enum Broker { | ||
Alpaca, | ||
// TODO: ?add more brokers | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use serde::Deserialize; | ||
use uuid::Uuid; | ||
use crate::broker::Broker; | ||
|
||
#[derive(Debug, Deserialize, Clone)] | ||
pub struct Strategy { | ||
pub id: Uuid, | ||
pub name: String, | ||
pub enabled: bool, | ||
pub broker: Broker, | ||
pub max_order_retries: u8, | ||
pub order_retry_delay: f64, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use std::sync::Arc; | ||
|
||
use uuid::Uuid; | ||
|
||
use crate::{ | ||
api::alert::{WebhookAlertData, AlertType}, | ||
App, | ||
}; | ||
|
||
// pub mod alpaca_client; | ||
// pub mod order; | ||
|
||
// pub trait TradeManager { | ||
// fn get_account(&self) -> Result<(), ()>; | ||
// } | ||
|
||
// pub struct Account { | ||
// id: Uuid, | ||
// } | ||
|
||
pub struct TradeExecutor; | ||
|
||
// type TradeExecutorResult = Result<u64, TradeError>; | ||
|
||
// impl TradeExecutor { | ||
// // pub fn new(app: Arc<App>) -> Self { | ||
// // Self { app } | ||
// // } | ||
|
||
// pub async fn execute_order(&self, order: &Order) -> TradeExecutorResult { | ||
// match order.order_type { | ||
// AlertType::Long => {} | ||
// AlertType::Short => {} | ||
// AlertType::StopLoss => {} | ||
// }; | ||
|
||
// Ok(chrono::Utc::now().timestamp() as u64) | ||
// } | ||
// } |
Oops, something went wrong.