V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
datayes2015
V2EX  ›  投资

通联情绪指标策略,回测结果还不错

  •  
  •   datayes2015 · 2015-07-10 15:33:16 +08:00 · 3126 次点击
    这是一个创建于 3237 天前的主题,其中的信息可能已经有所发展或是发生改变。
    start = pd.datetime(2013, 11, 1)
    end = pd.datetime(2014, 11, 1)
    benchmark = 'HS300'
    universe = read('3b_ticker.txt').split(',')
    capital_base = 100000
    csvs = ['3b_news.csv']

    def initialize(account):
    add_history('hist1', 1)

    def handle_data(account, data):
    for stock in universe:
    if (stock not in account.hist1) or ('emotion' not in account.hist1[stock].columns):
    continue

    sig = account.hist1[stock].iloc[0,:]['emotion']
    if sig > 0.2 and account.position.stkpos.get(stock, 0)==0:
    order(stock, 100)
    elif sig < 0 and account.position.stkpos.get(stock, 0)>0:
    order_to(stock, 0)

    年化收益率
    24.4%
    基准年化收益率
    5.3%
    阿尔法
    0.19
    贝塔
    0.77
    夏普比率
    1.08
    收益波动率
    0.19
    信息比率
    1.18
    最大回撤
    17.9%

    原帖地址: https://uqer.io/community/share/548111daf9f06c8e7733670a
    1 条回复    2015-07-13 14:03:43 +08:00
    geeklian
        1
    geeklian  
       2015-07-13 14:03:43 +08:00 via iPhone
    技术分析现在A股没啥用...
    中央领导一句话,结果要么千股涨停要么跌停...
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2948 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 11:07 · PVG 19:07 · LAX 04:07 · JFK 07:07
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.