Skip to content

Instantly share code, notes, and snippets.

@robin2015
robin2015 / test.py
Last active November 13, 2019 09:06
def fun():
pass
from ycyj_kline.tools.log_ext import init_logger
def main():
init_logger("ycyj_hangqing_app")
# coding=utf-8
import sys
import os
if __name__ == '__main__':
sys.path.insert(0, os.path.dirname(
os.path.dirname(os.path.realpath(__file__))))
sys.path.insert(0, os.path.abspath('./dzh_pb2/'))
def all_thread_action():
scheduler = BackgroundScheduler()
# 交易日 更新
jiao_yi_ri_cache_action()
trigger1 = CronTrigger(hour='00', minute='00', second='10')
scheduler.add_job(id='cache_jiaoyiri', func=jiao_yi_ri_cache_action, trigger=trigger1, jitter=10, max_instances=6)
if __name__ == '__main__':
sys.path.insert(0,os.path.dirname(
os.path.dirname(os.path.realpath(__file__))))
def calc_zhangfu(self, col):
# logger.info('计算分钟涨幅')
# {'$match': {'t': {'$gte': int(st), '$lte': int(et)}}},
cursor = col.aggregate_raw_batches([
{
'$group': {
'_id': "$yj_code",
'begin_dtime': {'$min': '$ts'},
'end_dtime': {'$max': '$ts'},
'open1': {'$first': '$price'},
winrm service 的基础配置,执行之后提示选择的时候选中y:
winrm quickconfig
查看winrm service listener(分为http和https):
winrm e winrm/config/listener
为winrm service 配置auth:
winrm set winrm/config/service/auth @{Basic="true"}
为winrm service 配置加密方式为允许非加密:
# coding = utf-8
# k线相关的数据库
import pymongo
class MongodbOpt:
"""MongoDb 业务 数据库 操作"""
def __init__(self):
# coding=utf-8
# Redis 封装
# r-uf6xlhoskq9ei4x09o.redis.rds.aliyuncs.com
# r.hmset('xx', {'k1':'v1', 'k2': 'v2'})
import redis
@robin2015
robin2015 / kaifa.md
Last active November 14, 2019 02:07

行情数据

  • ycyj_tdxhq 版
    • hangqing, kline, f10 写一起,3个启动程序, app_f10_tdx, app_kline_tdx

游资交易服务

  • 重构接口, 记录日志
  • 脚本部署管理 winrm