In all of these links there are examples of how to use live trading for Oanda or other providers. you can inspire your work based on the implementation of the latters.
I hope it helps.
@dasch :facepalm: Thank you so much! It's so obvious now, the only reason it was working before with non-live data was because preload parameter defaults to true with non-liva data. If I manually set preload as false when using GenericCSVData, the same behaviour occurs & the current value of the indicator is alway nan.
Updated my strategy so it now looks at the indicator values in the past, it is working as intended.
To those that may come across this thread, I cannot explain why the issue is occurring, but if you pass a name to the default data when utilizing 'adddata', the legend will look normal again. Fixed
#Don't use this:
cerebro.adddata(data)
#Use a name with the data:
cerebro.adddata(data, name='OHLCV_jt')
The name comes across in the heading / legend of the master Bokeh plot as so:
snapshot1.PNG
@vladisld thank you for reply. Yes, I was asking about internal timezone for live data feed. So, you need add "tz" argument to Datafactory(tz=timezone). But if you want show in logs same timezone, need add to cerebro.run():
This annoying error means that Pandas can not find your column name in your dataframe. Before doing anything with the data frame, use print(df.columns) to see dataframe column exist or not.
print(df.columns)
I was getting a similar kind of error in one of my codes. Turns out, that particular index was missing from my data frame as I had dropped the empty dataframe 2 rows. If this is the case, you can do df.reset_index(inplace=True) and the error should be resolved.
@boblef In addition, I have already generated API token on my Oanda account and defined it and account id in my local code so you don't see them in the code I provided.
A sample of the returned value would be needed. Else use the native Quandl support available in the last release. It has only been tested with the WIKI dataset though.