HellAmbro / Trading212API

Unofficial Trading212 API
MIT License
57 stars 27 forks source link

CFDOrder class missing from __init__.py #29

Closed FinMcLees closed 1 year ago

FinMcLees commented 1 year ago

An error is thrown when attempting to import CFDOrder from pytrading212 init.py is missing the CFDOrder class module from .order

Trialled locally adding the class into the init.py file with success: from .order import EquityOrder, MarketOrder, LimitOrder, StopOrder, StopLimitOrder, ValueOrder, CFDMarketOrder, \ CFDLimitStopOrder, CFDOCOOrder, CFDOrder

HellAmbro commented 1 year ago

Hi, are you trying to init a CFDOrder class directly? If yes, you shouldn't do it. Instead use CFDMarketOrder, CFDLimitStopOrder, CFDOCOOrder. order=CFDOrder(...) is not allowed since i want to prevent errors because content bodies and endpoints of CFD orders are all different and i want to manage them directly from API. If you are using the Wrappers instead, as mentioned above, i will investigate this issue. Let me know.