上一页 1 2 3 4 5 6 7 8 ··· 12 下一页

2024年2月20日

每日笔记-LSTM

摘要: 今天,搞了一段代码,但没有达到应有的效果 import torch import torch.nn as nn import numpy as np # 设置随机种子以便结果可重复 torch.manual_seed(42) # 定义一个更复杂的LSTM模型 class ComplexLSTMMod 阅读全文

posted @ 2024-02-20 20:41 金凯旋 阅读(21) 评论(0) 推荐(0)

2023年12月8日

**kwargs用法举例

摘要: def test_kwarges(out : bool = False, **kwargs): a = kwargs.get("a", "test-a") x = kwargs.get("x", "test-x") print(a, x) print(out) kwargs = {"a":1, "b 阅读全文

posted @ 2023-12-08 16:48 金凯旋 阅读(47) 评论(0) 推荐(0)

2023年12月4日

量化小工具

摘要: 一些数据是取自然日,但实际交易日是第二天,在某些时候,需要做转换: def get_market_day(kline_datetime): """获取k线所对应的交易日""" kline_dt = datetime.datetime.fromtimestamp(kline_datetime // 1 阅读全文

posted @ 2023-12-04 14:47 金凯旋 阅读(39) 评论(0) 推荐(0)

2023年11月30日

QLib安装小记

摘要: 先搜索了gitee , 发现没有合适的复制版本。 还是取github 上看readme.md 提示python多个版本的支持功能(踩坑开始).似乎3.8 比较合适,而我电脑上装了 两个版本,3.10,3.11 . 为了简单起见,装aconda. 创建conda 环境。 conda info -e # 阅读全文

posted @ 2023-11-30 14:12 金凯旋 阅读(548) 评论(0) 推荐(0)

多python 目录注意要点

摘要: python 是根据path路径优先级找执行文件的。 pip 是在scripts 下的, 设置 path 优先级时,两个路径最好一起设置 VScode 的prompt 下执行的python 和编辑环境有可能不一致。 执行: python -m pip install xxx 能保证pip 安装的内容 阅读全文

posted @ 2023-11-30 09:11 金凯旋 阅读(11) 评论(0) 推荐(0)

2023年11月10日

tqsdk 应用笔记 一 回测

摘要: from datetime import date from tqsdk import TqApi, TqAuth, TqBacktest, TargetPosTask # 在创建 api 实例时传入 TqBacktest 就会进入回测模式, 开启图形化界面 api = TqApi(backtest 阅读全文

posted @ 2023-11-10 10:00 金凯旋 阅读(295) 评论(0) 推荐(0)

2023年10月31日

(1045, "Access denied for user ...错误解决

摘要: GRANT ALL PRIVILEGES ON mydb.* to 'myuser'@'%'; 遇到问题: 增加了访问权限,依然不能访问。 修改用户权限: ALTER USER 'myuser'@'%' IDENTIFIED WITH mysql_native_password BY 'my_pas 阅读全文

posted @ 2023-10-31 13:23 金凯旋 阅读(38) 评论(0) 推荐(0)

2023年9月13日

Qt Debug 不下去的一个解决方法

摘要: 今天遇到一个难题。 在debug 时, 使用 qt 函数载入自写的dll时,载入时,崩溃。 如果不用 F5可以顺利运行 删除 临时文件文件夹等方式都试过,问题依然存在。 当我删除所有的断点后,重新编译,然后设置断点,跟踪运行正常。 问题原因没有找到。 错误关键词: ZwMapViewOfSectio 阅读全文

posted @ 2023-09-13 13:52 金凯旋 阅读(172) 评论(0) 推荐(0)

2023年8月31日

建立mysql 索引的简单教程

摘要: 问: 有一个mysql表,我用的最频繁的查询语句是: select symbol,sum(position) from dayposition where orderid in ( select max(orderid) from dayposition where account='' and d 阅读全文

posted @ 2023-08-31 13:41 金凯旋 阅读(17) 评论(0) 推荐(0)

2023年8月27日

多用户git设置样本

摘要: 0 准备: 如果之前用过git,需要清空global设置: # 取消全局配置 git config --global --unset user.name git config --global --unset user.email 2 在本地建立仓库 3 在该仓库下设置: # 每个项目Repo设置自 阅读全文

posted @ 2023-08-27 14:29 金凯旋 阅读(14) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 8 ··· 12 下一页

导航