INNER CODE UNIT · Python

get_account

flukelaster/ai-trading-agent · mt5_bridge/main.py:219

async def get_account():
    if not ensure_connected():
        return mt5_response(False, error="MT5 not connected")
    info = mt5.account_info()
    if info is None:
        return mt5_response(False, error="Cannot get account info")
    return mt5_response(True, data={
        "balance": info.balance,
        "equity": info.equity,
        "margin": info.margin,
        "free_margin": info.margin_free,
        "profit": info.profit,
        "currency": info.currency,
    })


@app.get("/positions", dependencies=[Depends(verify_api_key)])
async def get_positions():

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…