摘要:/strategy 重定向到 /strategy/随机id 因为重定向缓存每次重定向到一个固定地址 python去掉/strategy路由也没起作用
阅读全文
摘要:Json概述以及python对json的相关操作
阅读全文
摘要:def initialize(context): # context: UserContext对象, 存放有当前的账户/股票持仓信息 # portfolio Portfolio对象 # current_dt 当前单位时间的开始时间, datetime.datetime对象 # universe 此策略操作的股票池 # 定义一个全局变量, 保...
阅读全文
摘要:algo_volatility 策略波动率 Algorithm Volatility algorithm_period_return 策略收益 alpha Alpha(阿尔法) 非系统性风险 benchmark_period_return 基准收益 benchmark_volatility 基准波动
阅读全文
摘要:启动 __main__.py 静态文件 static/ 模板 templates/ 路由 比如tree/handlers.py default_handlers WebSocket ws://localhost:8888/api/kernels/f0164f9e-87c4-4fb8-a730-454
阅读全文
摘要:python __future__ package的几个特性
阅读全文
摘要:图形界面 from tkinter import * import tkinter.messagebox as messagebox class Application(Frame): def __init__(self, master=None): Frame.__init__(self, mas
阅读全文
摘要:import sys def check_version(): v = sys.version_info if v.major == 3 and v.minor >= 4: return True print('Your current python is %d.%d. Please use Pyt
阅读全文
摘要:0 值的整型 / 浮点型、空字符串('')、空列表([])、 空元组((,))、空字典({})、空集合(set())都等价于 False,但是不等于 None thing = None if thing: print("It's some thing") else: print("It's no t
阅读全文
摘要:#!/usr/bin/env python3 # -*- coding: utf-8 -*- #info #warning def log(message): print('------------------------------') print(message) print('--------
阅读全文
摘要:os.path.sep 路径分隔符 linux下就用这个了’/’ os.path.altsep 根目录 os.path.curdir 当前目录 os.path.pardir 父目录 os.path.abspath(path) 绝对路径 os.path.join() 常用来链接路径 os.path.s
阅读全文
摘要:if __name__ == '__main__': 的解析 是否直接执行
阅读全文
摘要:Unofficial Windows Binaries for Python Extension Packages Python资源
阅读全文
摘要:age = 3 if age >= 18: print('adult') elif age >= 6: print('teenager') else: print('kid') s = input('birth:') birth = int(s) if birth < 2000: print('00
阅读全文
摘要:量化投资策略 量化分析 风险指标 Total Returns(策略收益)Benchmark Returns(基准收益)Alpha(阿尔法)Beta(贝塔)Sharpe(夏普比率)Sortino(索提诺比率)Information Ratio(信息比率)Algorithm Volatility(策略波
阅读全文
摘要:装饰器 如果decorator本身需要传入参数 不需要编写wrapper.__name__ = func.__name__这样的代码,Python内置的functools.wraps就是干这个事的 相当于: now = log(now)now = log('execute')(now)
阅读全文
摘要:IPython 4.0发布:Jupyter和IPython分离后的首个版本
阅读全文