有没有一种快速生成随机股票的方法,比如数据序列?
我的意思是看起来像股票、温度或季节图的数据序列,即不是锯齿状的起伏,而更像是基于时间的曲线。
发布于 2020-11-29 07:02:29
我编码的一个可能的答案是:
def gen(value, steps=10, trend=0, low=-10, high=10):
new = value
rv = []
for i in range(steps) :
new = trend + new + np.random.randint(low,high)
rv.append(new)
return rv
plot(gen(100,steps=50))
https://stackoverflow.com/questions/65053666
复制相似问题