策略分享

这个代码为什么无法设置初始资金?

由bq7frnbl创建,最终由bq7frnbl 被浏览 39 用户

导入必要的库 import numpy as np import pandas as pd import talib as ta from scipy import stats from sklearn.manifold import MDS from scipy.cluster import hierarchy

初始化函数,设置要操作的股票池、基准等等 def initialize(context):

设置要交易的股票池,这里以沪深300指数成份股为例

context.stock_pool = index_components('000300.SH')

设置初始资金,默认为1000000

context.initial_capital = 1000000

\

标签

pandas
{link}