Python掘金3量化交易:historyn取值并将符合要求的股票加到股票池

coding=utf-8 historyn取值并将符合要求的股票加到股票池

from future import print_function, absolute_import, unicode_literals
import numpy as np
import pandas as pd
import tushare as ts
#import matplotlib.pyplot as plt
import talib
from gm.api import *
from datetime import timedelta

策略中必须有init方法

def init(context):
context.trade_symbols=[’’]
#context.symbol = [‘SZSE.159915’,‘SZSE.159995’]
context.symbol =[‘SZSE.000002’,‘SZSE.000049’,‘SZSE.000661’,‘SZSE.000828’,‘SZSE.000848’,‘SZSE.000858’,‘SZSE.000895’,‘SZSE.000921’,‘SZSE.002007’,‘SZSE.002117’,‘SZSE.002127’,‘SZSE.002146’,‘SZSE.002179’,‘SZSE.002236’,‘SZSE.002242’,‘SZSE.002262’,‘SZSE.002372’,‘SZSE.002555’,‘SZSE.002572’,‘SZSE.002595’,‘SZSE.002677’,‘SZSE.002690’,‘SZSE.300033’,‘SZSE.300136’,‘SZSE.300357’,‘SZSE.300406’,‘SHSE.600036’,‘SHSE.600048’,‘SHSE.600273’,‘SHSE.600276’,‘SHSE.600452

你可能感兴趣的:(Python量化交易)