You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
934 B
Python
37 lines
934 B
Python
2 years ago
|
from core.exchanges import BaseExchange
|
||
|
from oandapyV20 import API
|
||
|
from oandapyV20.endpoints import trades
|
||
|
from oandapyV20.endpoints import positions
|
||
|
|
||
|
class OANDAExchange(BaseExchange):
|
||
|
def connect(self):
|
||
|
self.client = API(access_token=self.account.api_secret)
|
||
|
self.account_id = self.account.api_key
|
||
|
|
||
|
def get_supported_assets(self):
|
||
|
raise NotImplementedError
|
||
|
|
||
|
def get_balance(self):
|
||
|
raise NotImplementedError
|
||
|
|
||
|
def get_market_value(self, symbol):
|
||
|
raise NotImplementedError
|
||
|
|
||
|
def post_trade(self, trade):
|
||
|
raise NotImplementedError
|
||
|
|
||
|
def get_trade(self, trade_id):
|
||
|
raise NotImplementedError
|
||
|
|
||
|
def update_trade(self, trade):
|
||
|
raise NotImplementedError
|
||
|
|
||
|
def cancel_trade(self, trade_id):
|
||
|
raise NotImplementedError
|
||
|
|
||
|
def get_position_info(self, asset_id):
|
||
|
raise NotImplementedError
|
||
|
|
||
|
def get_all_positions(self):
|
||
|
pass
|