Fix time comparison

This commit is contained in:
Sik Yoon 2024-05-25 16:15:29 +09:00
parent 9c5a3f0a93
commit 143e06b1b1
2 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ pub async fn list_up_for_buy(
supertrend_1m_map.get(symbol),
price_and_closetime,
) {
if supertrend_vec.last().unwrap().close_time > current_info.1
if supertrend_vec.last().unwrap().close_time > server_epoch
&& supertrend_vec.last().unwrap().signal.as_ref().is_some_and(|a| *a == SuperTrendSignal::BUY)
{
values.current_price = current_info.0;

View File

@ -72,7 +72,7 @@ pub async fn list_up_for_buy(
supertrend_1m_map.get(symbol),
price_and_closetime,
) {
if supertrend_vec.last().unwrap().close_time > current_info.1
if supertrend_vec.last().unwrap().close_time > server_epoch
&& supertrend_vec.last().unwrap().signal.as_ref().is_some_and(|a| *a == SuperTrendSignal::SELL)
{
values.current_price = current_info.0;