NOTSUBSCRIBED Issue
-
Hello,
I am using the sample code below. I get the following output.
Started
Account Cash = 0.0
Account Value = 0.0
***** DATA NOTIF: NOTSUBSCRIBEDmade sure that the balance has funds. The api token and account number are correct as I double checked them. What could be the problem?
import argparse import datetime import backtrader as bt apikey = 'xxxxxxxx' acc = 'yyyyyyyyy' # Create a Stratey class TestStrategy(bt.Strategy): def __init__(self): pass #Provides any noticficaitons about the data. def notify_data(self, data, status, *args, **kwargs): print('*' * 5, 'DATA NOTIF:', data._getstatusname(status), *args) def notify_store(self, msg, *args, **kwargs): print('*' * 5, 'STORE NOTIF:', msg) def next(self): # Simply log the closing price of the series from the reference print('O: {} H: {} L: {} C: {}'.format( self.data.open[0], self.data.high[0], self.data.low[0], self.data.close[0], )) def start(self): if self.data0.contractdetails is not None: print('-- Contract Details:') print(self.data0.contractdetails) print('Started') acc_cash = cerebro.broker.getcash() acc_val = cerebro.broker.getvalue() print('Account Cash = {}'.format(acc_cash)) print('Account Value = {}'.format(acc_val)) if __name__ == '__main__': cerebro = bt.Cerebro() print("apikey", apikey) print("acc", acc) oandastore = bt.stores.OandaStore(token=apikey, account=acc, practice=True) cerebro.broker = oandastore.getbroker() data0 = oandastore.getdata(dataname="GBP_USD", timeframe=bt.TimeFrame.Ticks, compression=1, backfill_start=False, backfill=False) #This is setting what timeframe we want to use. cerebro.resampledata(data0, timeframe=bt.TimeFrame.Minutes, compression=5) cerebro.addstrategy(TestStrategy) cerebro.run()
-
Your API key and account have been redacted. But someone or web bots may hav already cached the details. You should immediately invalidate the API token.
You probably have a v20 account. You may want to have a look at this:
-
Is there a way to create an account that is not v20, so it would be compatible?
Also, what is the status of this repo? Is it still in development or something that I can use? -
It seems Oanda no longer creates v1 accounts even if you contact the customer service.
@ahmed-sobhy said in NOTSUBSCRIBED Issue:
Also, what is the status of this repo? Is it still in development or something that I can use?
You will have to ask the repo (i.e.: the team on GitHub)