Reputation: 51
I use the CCXT module to communicate with multiple cryptocurrency exchanges. However when trying to request my trades or other orders I get the error "Key error symbol" even tho i use a Valid symbol and other functions work.
Code :
cftx = ccxt.ftx({"apiKey":ftx_keys.api,
"secret":ftx_keys.secret})
print(cftx.fetch_my_trades(symbol="BTC-PERP",limit=100))
Error:
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\ccxt\ftx.py", line 564, in parse_trade
symbol = market['symbol']
KeyError: 'symbol'
I have tried other symbols and markets but without succses
Upvotes: 1
Views: 3037
Reputation: 1645
You should call load_markets()
before trying to fetch anything related to markets.
Change your code like below:
cftx = ccxt.ftx({"apiKey":ftx_keys.api,
"secret":ftx_keys.secret})
markets = cftx.load_markets()
print(cftx.fetch_my_trades(symbol="BTC-PERP",limit=100))
Upvotes: 3