Disable threading

This commit is contained in:
Sik Yoon 2024-01-14 18:02:29 +09:00
parent 2d82a17f0e
commit 53f53a1af1
4 changed files with 9 additions and 38 deletions

View File

@ -12,7 +12,7 @@ use super::{
// SuperTrend length: 20, multiplier: 1.5, BUY signal
// ADX(10, 10) < 25.0
pub async fn list_up_for_buy(
alldata: AllData,
alldata: &AllData,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
// print rt_price for debugging
// let a = alldata.rt_price_30m_vec.iter().position(|a| a.0 == "BTCUSDT");

View File

@ -11,7 +11,7 @@ use super::{
// BB 30m lowerband + BB 1m lowerband
// SuperTrend length: 10, multiplier: 2.5
pub async fn list_up_for_buy(
alldata: AllData,
alldata: &AllData,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
// print rt_price for debugging
// let a = alldata.rt_price_30m_vec.iter().position(|a| a.0 == "BTCUSDT");

View File

@ -12,7 +12,7 @@ use super::{
// SuperTrend length: 20, multiplier: 1.5, BUY signal
// ADX(10, 10) < 25.0
pub async fn list_up_for_buy(
alldata: AllData,
alldata: &AllData,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
// print rt_price for debugging
// let a = alldata.rt_price_30m_vec.iter().position(|a| a.0 == "BTCUSDT");

View File

@ -32,39 +32,11 @@ struct Record {
pub async fn execute_list_up_for_buy(
all_data: &AllData,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let mut task_vec = Vec::new();
let all_data_c1 = all_data.clone();
let all_data_c2 = all_data.clone();
// let all_data_c3 = all_data.clone();
let all_data_c4 = all_data.clone();
// let all_data_c5 = all_data.clone();
let all_data_c6 = all_data.clone();
crate::strategy_team::strategy_001::list_up_for_buy(all_data).await;
crate::strategy_team::strategy_002::list_up_for_buy(all_data).await;
crate::strategy_team::strategy_004::list_up_for_buy(all_data).await;
task_vec.push(tokio::spawn(async move {
crate::strategy_team::strategy_001::list_up_for_buy(all_data_c1).await;
}));
task_vec.push(tokio::spawn(async move {
crate::strategy_team::strategy_002::list_up_for_buy(all_data_c2).await;
}));
// task_vec.push(tokio::spawn(async move {
// crate::strategy_team::strategy_003::list_up_for_buy(all_data_c3).await;
// }));
task_vec.push(tokio::spawn(async move {
crate::strategy_team::strategy_004::list_up_for_buy(all_data_c4).await;
}));
// task_vec.push(tokio::spawn(async move {
// crate::strategy_team::strategy_005::list_up_for_buy(all_data_c5).await;
// }));
task_vec.push(tokio::spawn(async move {
crate::strategy_team::strategy_006::list_up_for_buy(all_data_c6).await;
}));
// let all_data_ct = all_data.clone();
// task_vec.push(tokio::spawn(async move {
// crate::strategy_team::strategy_test::strategist_test(all_data_ct).await;
// }));
try_join_all(task_vec).await?;
Ok(())
}
@ -73,10 +45,9 @@ pub async fn execute_list_up_for_sell(
exchange_info_vec: &Vec<ExchangeInfo>,
trade_fee_vec: &Vec<TradeFee>,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
crate::strategy_team::strategy_001::list_up_for_sell(&all_data, &exchange_info_vec, &trade_fee_vec).await?;
crate::strategy_team::strategy_002::list_up_for_sell(&all_data, &exchange_info_vec, &trade_fee_vec).await?;
crate::strategy_team::strategy_004::list_up_for_sell(&all_data, &exchange_info_vec, &trade_fee_vec).await?;
crate::strategy_team::strategy_006::list_up_for_sell(&all_data, &exchange_info_vec, &trade_fee_vec).await?;
crate::strategy_team::strategy_001::list_up_for_sell(&all_data, &exchange_info_vec, &trade_fee_vec).await;
crate::strategy_team::strategy_002::list_up_for_sell(&all_data, &exchange_info_vec, &trade_fee_vec).await;
crate::strategy_team::strategy_004::list_up_for_sell(&all_data, &exchange_info_vec, &trade_fee_vec).await;
Ok(())
}