import requests
from concurrent.futures import ThreadPoolExecutor
BASE = "https://wiremt-api.newedgeflow.com"
HEADERS = {"Content-Type": "application/json", "x-api-key": "wmt_live_your_key_here"}
# Your connected client account IDs
CLIENTS = [
{"id": "acc_b3ed7fc4b0d84f16", "multiplier": 1.0},
{"id": "acc_6821bbde5dfd489f", "multiplier": 2.0},
{"id": "acc_ac672166e4c84af3", "multiplier": 0.5},
]
def copy_trade(client, symbol, side, base_volume):
volume = round(base_volume * client["multiplier"], 2)
resp = requests.post(f"{BASE}/v1/trade", json={
"id": client["id"],
"symbol": symbol,
"side": side,
"volume": volume,
"comment": "copy-trade"
}, headers=HEADERS)
return {"client": client["id"], "result": resp.json()}
# When master signal fires: fan out to all clients
with ThreadPoolExecutor(max_workers=10) as pool:
futures = [pool.submit(copy_trade, c, "XAUUSD", "buy", 0.01) for c in CLIENTS]
results = [f.result() for f in futures]
print(results)