In [1]:
%matplotlib inline
%time from hikyuu.interactive import *
std::cout are redirected to python::stdout
std::cerr are redirected to python::stderr
2020-08-05 23:46:14.760 [HKU-I] - Loading market information... [loadBaseInfo]
2020-08-05 23:46:14.760 [HKU-I] - Loading stock type information... [loadBaseInfo]
2020-08-05 23:46:14.761 [HKU-I] - Loading stock information... [loadBaseInfo]
2020-08-05 23:46:15.021 [HKU-I] - Loading KData... [init]
2020-08-05 23:46:15.053 [HKU-I] - Preloading all day kdata to buffer! [setKDataDriver]
2020-08-05 23:46:20.038 [HKU-I] - 5.02s Loaded Data. [init]
CPU times: user 5.34 s, sys: 350 ms, total: 5.69 s
Wall time: 5.7 s
In [2]:
k = get_kdata('sh000001', -100)
In [3]:
import pickle

with open("temp", 'wb') as f:
    pickle.dump(k, f)
---------------------------------------------------------------------------
UnicodeDecodeError                        Traceback (most recent call last)
<ipython-input-3-0dca45fb1a27> in <module>
      2 
      3 with open("temp", 'wb') as f:
----> 4     pickle.dump(k, f)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9c in position 133: invalid start byte
In [5]:
hku_save(k, "temp")
In [7]:
k2 = KData()
hku_load(k2, "temp")
In [8]:
k2.plot()
In [ ]: