Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config["API"] using Oanda not found #104

Open
sc-lin opened this issue Apr 26, 2024 · 1 comment
Open

config["API"] using Oanda not found #104

sc-lin opened this issue Apr 26, 2024 · 1 comment

Comments

@sc-lin
Copy link

sc-lin commented Apr 26, 2024

Hi, I was trying to use autotrader with oanda as the data source for both backtesting and paper trading at the moment. I found that in the autotrader/brokers/oanda.py the broker setup is misaligned with the keys.yaml. The config in that I print out in `

{'feed': 'oanda', 'environment': 'paper', 'global_config': {'OANDA': {'LIVE_API': 'api-fxtrade.oanda.com', 'LIVE_ACCESS_TOKEN': '123123asdasd', 'PRACTICE_API': 'api-fxpractice.oanda.com', 'PRACTICE_ACCESS_TOKEN': '123123asdasd', 'DEFAULT_ACCOUNT_ID': '123123', 'PORT': 443}, 'CCXT:EXCHANGE': {'api_key': 'xxxx', 'secret': 'xxxx', 'base_currency': 'USDT'}, 'dYdX': {'ETH_ADDRESS': '0xxxxx', 'ETH_PRIV_KEY': 'xxxxx'}}, 'base_currency': 'USD', 'exchange': 'oanda', 'datastreamer': <class 'autotrader.utilities.LocalDataStream'>, 'backtest_mode': True, 'data_start': datetime.datetime(2024, 1, 1, 0, 0, tzinfo=<UTC>), 'data_end': datetime.datetime(2024, 1, 4, 0, 0, tzinfo=<UTC>), 'data_dict': None, 'data_path_mapper': None, 'directory': None, 'dynamic_data': False, 'logging_options': {'stdout_level': 30, 'stdout': False}}

Yet in line 20 to 23 in autotrader/brokers/oanda.py: it is looking for
self.API = config["API"] self.ACCESS_TOKEN = config["ACCESS_TOKEN"] self.port = config["PORT"] self.ACCOUNT_ID = config["ACCOUNT_ID"] self.api = v20.Context( hostname=self.API, token=self.ACCESS_TOKEN, port=self.port )

this is my runfile.py

`
from autotrader.autotrader import AutoTrader

at = AutoTrader()
at.configure(verbosity=1, home_currency='USD', broker='oanda', feed='oanda')
at.add_strategy("macd")

at.backtest(start="1/1/2024", end="4/1/2024", localize_to_utc=True)
at.virtual_account_config(initial_balance=1000, leverage=30, exchange='oanda')
at.run()
`

I am using autotrader[oanda]==1.1.2, not sure if it is a known issue or do I set anything wrong here? Thank you!

@t4vvd
Copy link

t4vvd commented Apr 28, 2024

Hello Kieran , I am only beginning on GitHub trying to run the Deriv API to include the epoch , expected payout, Volatility 10 index, 'basic connection ' ,
I,m just needing to know where the heading must begin, though I know how to make estimations on epoch settings and payouts.
Just also need to know if I can start the heading as ' Volatility 10 index - $19 ' per $10 stake .
and then API connect= (_ API.Token )
(Login _ id)
Once I have copied the connection do I paste it into the ' code ' under the Volatility 10 index - $19 ... header ?
and thereafter all my own preferred content of copy and paste of all the API. call schemas ?
Thanks Paul.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants