Spaces:
Sleeping
Sleeping
File size: 576 Bytes
d96a847 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # file: agent_system/debug_alpaca_2.py
import ccxt
import os
from dotenv import load_dotenv
load_dotenv()
def debug():
api_key = os.getenv("ALPACA_API_KEY")
secret = os.getenv("ALPACA_SECRET")
exchange = ccxt.alpaca({
'apiKey': api_key,
'secret': secret,
})
if api_key.startswith("PK"):
exchange.set_sandbox_mode(True)
m = exchange.load_markets()
print("Market Keys (First 20):")
for s in list(m.keys())[:20]:
print(f"{s}: {m[s].get('type')} / {m[s].get('spot')}")
if __name__ == "__main__":
debug()
|