JoinQuant 量化接口:https://gitee.com/l2gogogo
如果是第一次开发joinquant策略,所以先梳理好策略开发流程,再研究策略的编写。
以下是代码示例:
import jqdata def initialize(context): #g.security = '601318.XSHG' set_benchmark('000300.XSHG') g.security = get_index_stocks('000300.XSHG') set_option('use_real_price', True) set_order_cost(OrderCost(open_tax=0, close_tax=0.001,open_commission=0.0003, close_commission=0.0003, min_commission=5), type='stock') #print(g.security) def handle_data(context, data): #print(get_current_data()['601318.XSHG'].day_open) #print(attribute_history('601318.XSHG', 5)) #order('601318.XSHG', 10000) #一般情况下先卖后买 tobuy = [] for stock in g.security: p = get_current_data()[stock].da