pyquotex is a Python library designed to easily integrate with the Quotex API, enabling automated trading operations. Fully open-source and licensed under MIT, the library provides features like order execution, balance checking, real-time market data collection, and more. Perfect for traders and developers looking to build efficient and customized solutions.
The project follows a modular structure organized as follows:
π¦ pyquotex/
β£ π docs/ # Documentation
β£ π examples/ # Usage examples
β β£ π custom_config.py # Custom configuration
β β£ π monitoring_assets.py # Asset monitoring
β β£ π trade_bot.py # Trading bot
β β π user_test.py # User tests
β£ π quotexapi/ # API Core
β β£ π http/ # HTTP modules
β β β£ π login.py
β β β£ π logout.py
β β β π settings.py
β β£ π utils/ # Utilities
β β£ π ws/ # WebSocket
β β β£ π channels/ # WS channels
β β β π objects/ # WS objects
β β£ π api.py # Main API
β β π stable_api.py # Stable API
The API is built on a client-server architecture using WebSocket as the main communication protocol. The main components are:
The API implements various WebSocket channels for different functionalities:
The system implements sophisticated session handling including:
async def authenticate(self):
status, message = await self.login(
self.username,
self.password,
self.user_data_dir
)
if status:
global_value.SSID = self.session_data.get("token")
self.is_logged = True
return status, message
session.json
filessl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
ssl_context.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1 | ssl.OP_NO_TLSv1_2
ssl_context.minimum_version = ssl.TLSVersion.TLSv1_3
try:
await self.connect()
except Exception as e:
logger.error(f"Connection error: {e}")
await self.reconnect()
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s %(message)s'
)