Renaming
This commit is contained in:
parent
5937ee9be0
commit
87cde15b37
|
|
@ -21,7 +21,6 @@ use sqlx::FromRow;
|
|||
use std::collections::HashMap;
|
||||
use tokio::time::*;
|
||||
use super::{hmac_signature, REAL, SIMUL, TEST, RUNNING_MODE, FUTURES_URL, FUTURES_URL_TEST, API_KEY, API_KEY_TESTNET, FuturesExchangeInfo, PositionCoinList, FuturesTradeFee, EntryCoinInfo, select_listuped_positions};
|
||||
use crate::strategy_team::future_strategy;
|
||||
|
||||
pub enum TimeInForce {
|
||||
Gtc,
|
||||
|
|
|
|||
|
|
@ -29,30 +29,31 @@ pub async fn list_up_for_buy(
|
|||
for symbol in &alldata.valid_symbol_vec {
|
||||
filtered_data.insert(symbol.clone(), FilteredDataValue::new());
|
||||
}
|
||||
let server_epoch = get_server_epoch().await;
|
||||
// current Tema(30) < current Tema(60)
|
||||
|
||||
// current Tema(15) < current Tema(60)
|
||||
let mut keys_to_remove: HashSet<String> = HashSet::new();
|
||||
let tema_15 = tema(15, &alldata.rt_price_1m_vec, &filtered_data).await?;
|
||||
let tema_60 = tema(60, &alldata.rt_price_1m_vec, &filtered_data).await?;
|
||||
let server_epoch = get_server_epoch().await;
|
||||
|
||||
let mut do_buy = false;
|
||||
if let (Some(tema15_vec), Some(tema60_vec)) = (tema_15.get("BTCUSDT"), tema_60.get("BTCUSDT")) {
|
||||
if tema15_vec.len() > 10
|
||||
&& tema60_vec.len() > 10
|
||||
&& tema15_vec.last().unwrap().close_time == tema60_vec.last().unwrap().close_time
|
||||
&& tema15_vec.last().unwrap().close_time > server_epoch
|
||||
&& tema60_vec.last().unwrap().close_time > server_epoch
|
||||
{
|
||||
if tema15_vec.last().unwrap().tema_value < tema60_vec.last().unwrap().tema_value {
|
||||
do_buy = true;
|
||||
for (symbol, values) in &mut filtered_data {
|
||||
let mut do_buy = false;
|
||||
if let (Some(tema15_vec), Some(tema60_vec)) = (tema_15.get(symbol), tema_60.get(symbol)) {
|
||||
if tema15_vec.len() > 10
|
||||
&& tema60_vec.len() > 10
|
||||
&& tema15_vec.last().unwrap().close_time == tema60_vec.last().unwrap().close_time
|
||||
&& tema15_vec.last().unwrap().close_time > server_epoch
|
||||
&& tema60_vec.last().unwrap().close_time > server_epoch
|
||||
{
|
||||
if tema15_vec.last().unwrap().tema_value < tema60_vec.last().unwrap().tema_value {
|
||||
do_buy = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if do_buy == false {
|
||||
return Ok(());
|
||||
}
|
||||
if do_buy == false {
|
||||
keys_to_remove.insert(symbol.clone());
|
||||
}
|
||||
}
|
||||
remove_keys(&mut filtered_data, keys_to_remove).await;
|
||||
|
||||
// Heatmap volume: filtering close price with Extra High is over the previous candle from 30 previous candles
|
||||
let mut keys_to_remove: HashSet<String> = HashSet::new();
|
||||
|
|
@ -8,7 +8,7 @@ pub mod strategy_007;
|
|||
pub mod strategy_008;
|
||||
pub mod strategy_009;
|
||||
pub mod strategy_010;
|
||||
pub mod future_strategy;
|
||||
pub mod future_strategy_short;
|
||||
pub mod future_strategy_long;
|
||||
// pub mod strategy_test;
|
||||
pub mod strategy_manager;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ pub async fn execute_list_up_for_buy(
|
|||
// crate::strategy_team::strategy_008::list_up_for_buy(all_data).await;
|
||||
// crate::strategy_team::strategy_009::list_up_for_buy(all_data).await;
|
||||
crate::strategy_team::future_strategy_long::list_up_for_buy(all_data, &future_exchange_info_map).await;
|
||||
crate::strategy_team::future_strategy::list_up_for_buy(all_data, &future_exchange_info_map).await;
|
||||
crate::strategy_team::future_strategy_short::list_up_for_buy(all_data, &future_exchange_info_map).await;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ pub async fn execute_list_up_for_sell(
|
|||
// )
|
||||
// .await;
|
||||
crate::strategy_team::future_strategy_long::list_up_for_sell().await;
|
||||
crate::strategy_team::future_strategy::list_up_for_sell().await;
|
||||
crate::strategy_team::future_strategy_short::list_up_for_sell().await;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user