diff --git a/src/strategy_team/mod.rs b/src/strategy_team/mod.rs index d5e9020..c2c6cdb 100644 --- a/src/strategy_team/mod.rs +++ b/src/strategy_team/mod.rs @@ -25,6 +25,7 @@ use crate::value_estimation_team::indicators::sma::{sma, sma_opclo, SmaData}; use crate::value_estimation_team::indicators::stoch_rsi::{stoch_rsi, StochRsiData}; use crate::value_estimation_team::indicators::supertrend::{supertrend, SupertrendData, SuperTrendArea, SuperTrendSignal}; use crate::value_estimation_team::indicators::adx::{AdxData, adx}; +use crate::value_estimation_team::indicators::dema::{DemaData, dema}; use futures::future::try_join_all; use reqwest::{Client, ClientBuilder}; use rust_decimal::{prelude::FromPrimitive, prelude::ToPrimitive, Decimal, RoundingStrategy}; diff --git a/src/strategy_team/strategy_006.rs b/src/strategy_team/strategy_006.rs index 8b4b132..1bb4d91 100644 --- a/src/strategy_team/strategy_006.rs +++ b/src/strategy_team/strategy_006.rs @@ -3,7 +3,7 @@ use super::{ limit_order_sell, rsi, select_filled_buy_orders, stoch_rsi, supertrend, try_join_all, AllData, Arc, Client, ClientBuilder, Decimal, EmaData, ExchangeInfo, FilteredDataValue, Mutex, RealtimePriceData, RoundingStrategy, RsiData, StochRsiData, SupertrendData, TradeFee, update_record3, adx, AdxData, get_server_epoch, MacdData, ema_macd, - BollingerBandData, ToPrimitive, duplicate_filter, HashMap, HashSet, remove_keys, SuperTrendArea, SuperTrendSignal, get_current_price + BollingerBandData, ToPrimitive, duplicate_filter, HashMap, HashSet, remove_keys, SuperTrendArea, SuperTrendSignal, get_current_price, dema, DemaData }; // BUY conditions @@ -24,6 +24,10 @@ pub async fn list_up_for_buy( filtered_data.insert(symbol.clone(), FilteredDataValue::new()); } + // for debugging dema + let dema_filtering = dema(9, &alldata.rt_price_1d_vec, &filtered_data).await?; + println!("{:?}", dema_filtering.get("API3USDT")); + // 2nd filtering: 1d MACD (3, 7, 30) cross let mut keys_to_remove: HashSet = HashSet::new(); let macd_1d_map = ema_macd(3, 7, 30, &alldata.rt_price_1d_vec, &filtered_data).await?;