(feat) adapt pages to time

This commit is contained in:
cardosofede
2024-05-30 13:27:41 -05:00
parent 4e89571498
commit 6fb923cd8a
4 changed files with 4 additions and 4 deletions

View File

@@ -51,7 +51,7 @@ with c3:
# Fetch and process data
candle_data = get_candles(connector_name, trading_pair, interval, max_records)
df = pd.DataFrame(candle_data)
df.index = pd.to_datetime(df['timestamp'], unit='ms')
df.index = pd.to_datetime(df['timestamp'], unit='s')
df = add_indicators(df, macd_fast, macd_slow, macd_signal, diff_lookback)
# Prepare data for signals

View File

@@ -91,7 +91,7 @@ with c2:
# Load candle data
candle_data = get_candles(connector_name=candles_connector, trading_pair=candles_trading_pair, interval=interval, max_records=max_records)
df = pd.DataFrame(candle_data)
df.index = pd.to_datetime(df['timestamp'], unit='ms')
df.index = pd.to_datetime(df['timestamp'], unit='s')
candles_processed = add_indicators(df, observation_covariance, transition_covariance)

View File

@@ -23,6 +23,6 @@ def get_candles(connector_name="binance", trading_pair="BTC-USDT", interval="1m"
df = pd.DataFrame(backend_client.get_historical_candles(connector_name, trading_pair, interval,
start_time=int(start_time.timestamp() * 1000),
end_time=int(end_time.timestamp() * 1000)))
df.index = pd.to_datetime(df.timestamp, unit='ms')
df.index = pd.to_datetime(df.timestamp, unit='s')
return df

View File

@@ -35,7 +35,7 @@ if get_data_button:
)
candles_df = pd.DataFrame(candles)
candles_df.index = pd.to_datetime(candles_df["timestamp"], unit='ms')
candles_df.index = pd.to_datetime(candles_df["timestamp"], unit='s')
# Plotting the candlestick chart
fig = go.Figure(data=[go.Candlestick(