Open karaolidis opened 3 years ago
Team, getting same error any solution ?
I found a workaround which is less than ideal but will have to do until we get an update from the maintainers.
I created a separate script for the bta-lib calculations that had looked something like this...
import pandas as pd
import pickle
import btalib
import sys
symbol = sys.argv[1]
with open('./data/' + symbol + '/' + symbol + '_kline.p', 'rb') as handle:
kline_df = pickle.load(handle)
sma = btalib.sma(kline_df).df
with open('./data/' + symbol + '/sma.p', 'wb') as handle:
pickle.dump(sma, handle)
...and then, from the main script, from inside the thread, I run...
subprocess.Popen(['python', 'bta.py', 'BTCEUR']).wait()
with open('./data/' + symbol + '/sma.p', 'rb') as handle:
sma = pickle.load(handle)
It's clunky but it will have to do for now.
Has anyone found a better explanation why BTA-Lib doesn't work within threading? Getting the same errors with different indicators
Take a look at the pull request section. Someone found a solution for this (thread) issue which works quite nicely.
Hello, I'm trying to use btalib and I'm having some trouble when having it run from inside a thread.
The below code works fine:
But when I try to use threads...
... I get the following error:
Any help would be appreciated!