Skip to main content

Socketrade Python client

Minimal client for the Socketrade MT5 API. Only requests is required.

pip install socketrade
import os
from socketrade import Socketrade

sr = Socketrade(os.environ["SOCKETRADE_KEY"])

print(sr.usage())

account = sr.add_account(
    number="41299492",
    password=os.environ["MT5_PASSWORD"],
    server="Deriv-Demo",
    name="Demo",
)
sr.connect(account["id"])

print(sr.status(account["id"]))
for p in sr.positions(account["id"])["positions"]:
    print(p["symbol"], p["volume"], p["profit"])

order = sr.order_send(account["id"], "EURUSD", 0.01, "buy")
sr.position_close(account["id"], order["ticket"])
  • One seat covers one MT5 account.
  • Wait for status == "ready" before placing an order.
  • Use a demo account first.
  • The WebSocket streams price ticks; positions and history are REST reads.
  • Docs: https://www.socketrade.com/developers

Metadata

Release files for socketrade 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for socketrade 0.1.0
File Size Uploaded Provenance Actions
socketrade-0.1.0.tar.gz 4.1 kB Without provenance Details for socketrade-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for socketrade 0.1.0
File Interpreter ABI Platform Actions
socketrade-0.1.0-py3-none-any.whl Python 3 none any Details for socketrade-0.1.0-py3-none-any.whl

Total release size: 8.9 kB

Release files / socketrade-0.1.0.tar.gz

Download URL socketrade-0.1.0.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d89b1c33da18c119b8921c5a4480f5a7c3bc8a53880a2e51e96a7f1eaf8f18b5
BLAKE2b-256 checksum
How to use checksums
6f42100a21f75b624a949b94096f2f973f1cfe494eda832ffc91d11be5f70d73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / socketrade-0.1.0-py3-none-any.whl

Download URL socketrade-0.1.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7e64a9890df3a40e80df6e070198f1bcb7859774774c022f6f2291c5bfea62c
BLAKE2b-256 checksum
How to use checksums
55c5c9b85ee89c9388c0ebfe41d6bc4efa9bd834b11a2fcf5d8be7813025f0e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Security for socketrade 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page