摘要: 代码 weeknum_=4 #5 fig,ax=gs.plt.subplots() import candleplotter as cplt title='' col_cycler=gs.mpl.rcParams['axes.prop_cycle'] # print(cycler.__iter__( 阅读全文
posted @ 2024-02-03 19:37 duanqs 阅读(40) 评论(0) 推荐(0) 编辑
摘要: 代码 # -*- coding: utf-8 -*- import os, math; import openpyxl import datetime, time; import pandas as pd, numpy as np from collections import namedtuple 阅读全文
posted @ 2024-01-31 23:17 duanqs 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 代码片 # -*- coding: utf-8 -*- """ 计算涨停价和跌停价, 给定品种和昨天收盘价. Parameters lc : 前收盘价, 浮点数 stype : 整型, optional 证券品种(0=可转债, 1=股票). The default is 0. Returns Non 阅读全文
posted @ 2024-01-31 23:11 duanqs 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 代码片 # -*- coding: utf-8 -*- import sys import getopt # from qsutil import gspace as gs from qsutil import pkl fname='c:\\GTJA\\RichEZ\\newVer\\cnt.pkl 阅读全文
posted @ 2024-01-31 23:08 duanqs 阅读(22) 评论(0) 推荐(0) 编辑
摘要: main script # jungle.py # import sys, io, os, inspect import numpy as np, pandas as pd; _=np pd.set_option('display.precision', 6) import matplotlib.p 阅读全文
posted @ 2022-01-27 20:26 duanqs 阅读(69) 评论(0) 推荐(0) 编辑
摘要: IntradayOrder class IntradayOrder(ba.Order): def __init__(self, ohlc, ind, key=None): super().__init__(ohlc, ind) self.key = key # 'o2c_wk1' self.algo 阅读全文
posted @ 2021-12-27 20:52 duanqs 阅读(42) 评论(0) 推荐(0) 编辑
摘要: pc2c o2c pc2o pc2o_kt class Broker(object): def __init__(self, cfg, **kwargs,): self.code = cfg.code self.onehand = 1 if self.code[:2]=='39' else 100 阅读全文
posted @ 2021-12-25 22:23 duanqs 阅读(47) 评论(0) 推荐(0) 编辑
摘要: tf代码 # momentums.py # import sys, io, os, inspect import numpy as np, pandas as pd; _=np pd.set_option('display.precision', 6) # import matplotlib.pyp 阅读全文
posted @ 2021-12-24 16:08 duanqs 阅读(434) 评论(0) 推荐(0) 编辑
摘要: code import datetime import numpy as np, pandas as pd import matplotlib.pyplot as plt # 个性配置文件: C:\Users\Administrator\.matplotlib\matplotlibrc from m 阅读全文
posted @ 2021-12-13 22:59 duanqs 阅读(78) 评论(0) 推荐(0) 编辑
摘要: 剔除星期四 代码 def delThursday_strat(df): ''' 4. 制定策略,执行回测,评估性能: "剔除星期四"策略: 星期四收盘买入, 下个星期三收盘卖出''' df['roc1_delThursday'] = df.apply( lambda x: 0 if x.weekda 阅读全文
posted @ 2021-12-13 21:13 duanqs 阅读(363) 评论(0) 推荐(0) 编辑