Skip to content

Commit

Permalink
:buf: fix: Correção para casos de Expiration Time Error quando era en…
Browse files Browse the repository at this point in the history
…viada uma ordem com timeframe inferior a 60 segundos.
  • Loading branch information
cleitonleonel committed Jan 30, 2025
1 parent dfe5e84 commit c158f26
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
5 changes: 2 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,13 +552,12 @@ async def get_realtime_candle():
print(asset_name, asset_data)
if asset_data[2]:
print("Asset Open")
client.start_candles_stream(asset_name, 60)
while True:
candles = await client.get_realtime_candles(asset_name, period)
print(candles)
"""for _, candle in candles.items():
for _, candle in candles.items():
open_price = candle["open"]
print(f"Vela atual ({asset_name}): abertura = {open_price}", end="\r")
"""
await asyncio.sleep(1)
else:
print("ERRO: Asset is closed.")
Expand Down
12 changes: 6 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ The documentation is organized in the following sections:
- Market Data Retrieval
- Account Management
- Technical Indicators
- WebSocket Management
- WebSocket
- Utilities and Helpers
- Technical Aspects
- Basic Examples
- Technical Aspects
- Considerations and Warnings

📚 Documentation is available in here [English](en/index.md).
Expand All @@ -34,10 +34,10 @@ La documentación está organizada en las siguientes secciones:
- Obtención de Datos del Mercado
- Gestión de Cuenta
- Indicadores Técnicos
- Gestión de WebSocket
- WebSocket
- Utilidades y Helpers
- Aspectos Técnicos
- Ejemplos Básicos
- Aspectos Técnicos
- Consideraciones y Advertencias

📚 La documentación está disponible aquí [Español](es/index.md).
Expand All @@ -55,10 +55,10 @@ A documentação está organizada nas seguintes seções:
- Recuperação de Dados do Mercado
- Gerenciamento de Conta
- Indicadores Técnicos
- Gerenciamento de WebSocket
- WebSocket
- Utilitários e Helpers
- Aspectos Técnicos
- Exemplos Básicos
- Aspectos Técnicos
- Considerações e Avisos

📚 A documentação está disponível aqui [Português](pt/index.md).
Expand Down
2 changes: 1 addition & 1 deletion quotexapi/expiration.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_expiration_time_quotex(timestamp, duration):
if now_date.second >= 30:
shift = 1
exp_date = now_date.replace(second=0, microsecond=0)
exp_date = exp_date + timedelta(minutes=int(duration / 60) + shift)
exp_date = exp_date + timedelta(minutes=int(duration / duration) + shift)
return date_to_timestamp(exp_date)


Expand Down

0 comments on commit c158f26

Please sign in to comment.