量化交易 均线

MA5 短 MA10 MA20 月度 MA60 趋势

金叉 MA5>MA10

死叉 MA5<MA10

上涨时候 均线是支撑跌倒均线 会反弹

下跌时候 均线是压力 涨到均线 会回落

股价在均线上 强势

股价在均线下 弱势

与当前股价比较

均线 60 长期

均线 20 短期 小于20 谨慎 大于20 可以考虑

越小越短

import akshare as ak
import pandas as pd

# 日
# df = ak.stock_zh_a_hist(symbol="000021", period="daily", start_date="20250101", end_date="20260313", adjust="qfq")
# 周
# df = ak.stock_zh_a_hist(symbol="000021", period="weekly", start_date="20250101", end_date="20260313", adjust="qfq")



# df.to_csv("000021z.csv", index=False)
# print("数据已保存,共", len(df), "行")

df=pd.read_csv("000021z.csv")
# print(df.head())

# df["日期"] = pd.to_datetime(df["日期"])  # 转为时间格式
# df.sort_values("日期", inplace=True)    # 按日期正序排列


df['ma5']=df["收盘"].rolling(window=5).mean()
df['ma10']=df["收盘"].rolling(window=10).mean()
df['ma20']=df["收盘"].rolling(window=20).mean()
df['ma60']=df["收盘"].rolling(window=60).mean()

df_valid = df.dropna(subset=["ma5", "ma10"]).copy()

# 后期使用df_valid去实现数据

df.iloc[-1]['ma5']
df.iloc[-1]['ma10']

df.iloc[-2]['ma5']
df.iloc[-2]['ma10']

Jin = False
Si = False
Duo = False
Kong = False

#金
Jin=(df.iloc[-1]['ma5']>df.iloc[-1]['ma10'])&(df.iloc[-2]['ma5']<df.iloc[-2]['ma10'])
#死
Si=(df.iloc[-1]['ma5']<df.iloc[-1]['ma10'])&(df.iloc[-2]['ma5']>df.iloc[-2]['ma10'])
#2日多
Duo=(df.iloc[-1]['ma5']>df.iloc[-1]['ma10'])&(df.iloc[-2]['ma5']>df.iloc[-2]['ma10'])
#2日空
Kong=(df.iloc[-1]['ma5']<df.iloc[-1]['ma10'])&(df.iloc[-2]['ma5']<df.iloc[-2]['ma10'])

print(df.iloc[-1]['日期'])
print(Jin,Si,Duo,Kong)

# 需要加入周线【周线 加 日线】

#当时股价与均线比较即可 df.iloc[-1]['ma60']
发表在 None | 留下评论

SKILL入门

SKILL 让大模型按照说明书去自动化的做事情

第一 执行的步骤你需要自己清楚

第二 你可以将步骤转化为流程图,最好是代码

第三 你用skill说明: 做什么what 怎么做how 何时做when

SKILL 必须有名字和描述,且调用代码是CLI模式,在 scripts目录下的代码不是使用import,是直接执行调用

发表在 None | 留下评论

windows安装openclaw 全部命令

GIT python

python 阿里源

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple

nvm install 22
nvm use 22.22.1
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
npm config set registry https://registry.npmmirror.com
iwr -useb https://openclaw.ai/install.ps1 | iex
openclaw onboard 

code 1

npm uninstall -g openclaw

code 128

git config –global url.”https://github.com/”.insteadOf “ssh://git@github.com/”

code 128

git config --global url."https://bgithub.xyz/".insteadOf "https://github.com/"
git config --global url."https://bgithub.xyz/".insteadOf "git@github.com:"
发表在 None | 留下评论

astrbot

pip install uv –user

uv tool install astrbot

astrbot init # 只需要在第一次部署时执行,后续启动不需要执行 astrbot

发表在 None | 留下评论

windows安装openclaw龙虾以及使用

需要安装 git python 3.12 否则闪退哦
首先进行NVM安装
https://github.com/coreybutler/nvm-windows/releases

nvm下载加速:https://bgithub.xyz/coreybutler/nvm-windows/releases

安装(此处安装版本更具最新的版本来可能是22.22.2 下面使用的版本必须相同)

nvm install 22 

# 使用指令

nvm use 22.22.1

Powershell,右击管理员方式打开 执行

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

选择Y

设置国内node源

npm config set registry https://registry.npmmirror.com

在执行安装命令

iwr -useb https://openclaw.ai/install.ps1 | iex

安装好就进入设置,如果关闭必须重新设置,下面是设置的代码。

openclaw onboard --flow quickstart

openclaw onboard --install-daemon

#NPM安装选下面一个

#NPM安装
npm install -g openclaw

#[错误1 表示要先卸载之前的安装再清理缓存,下面有步骤]

地址::http://127.0.0.1:18789/

安装插件

openclaw plugins install @m1heng-clawd/feishu

可能失败但是对策

应对闪退,没有信息跳出请使用:

iwr -useb https://openclaw.ai/install.ps1 -OutFile "$env:Desktop\install.ps1"

#然后执行

& "$env:Desktop\install.ps1"

#查看具体闪退信息

配置:切换大模型【Qwen家目前不要钱】

openclaw config

安装SKILL 【ZIP安装 记得安装pip包】

安装Clawhub.ai 首先

npm i -g clawhub

在Clawhub上找到需要的SKILL然后执行下载

clawhub install 名称

比如下面的WPS的skill https://clawhub.ai/lilei0311/wps-office 名称就是最后的wps-office

clawhub install wps-office

该命令用于清楚缓存

clawhub clear cache

使用ZIP安装 下载zip 解压保存在skill文件夹

在你的SKILL中有个workspace里面有 有些需要安装其他有的服务pip可能不显示

重启网关

openclaw gateway restart

python下pip使用阿里云的节点

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

使用openclaw方法

使用akshare-stock 分析601138近期股价及财务数据 ,并更具你分析的信息推测未来一周内的股价,及其概率
# 必须在对话里面明确调用的SKILL名称才能使用。

通讯飞书

插件plugins 安装方法如下
openclaw plugins install @m1heng-clawd/feishu
目前已经集成飞书

使用openclaw config 重新配置即可

选择channels

open.feishu.cn 登入 创建应用》添加应用能力【机器人】

在权限中”批量导入权限“导入下面的JSON

{
  "scopes": {
    "tenant": [
      "aily:file:read",
      "aily:file:write",
      "application:application.app_message_stats.overview:readonly",
      "application:application:self_manage",
      "application:bot.menu:write",
      "cardkit:card:write",
      "contact:user.employee_id:readonly",
      "corehr:file:download",
      "docs:document.content:read",
      "event:ip_list",
      "im:chat",
      "im:chat.access_event.bot_p2p_chat:read",
      "im:chat.members:bot_access",
      "im:message",
      "im:message.group_at_msg:readonly",
      "im:message.group_msg",
      "im:message.p2p_msg:readonly",
      "im:message:readonly",
      "im:message:send_as_bot",
      "im:resource",
      "sheets:spreadsheet",
      "wiki:wiki:readonly"
    ],
    "user": [
      "aily:file:read",
      "aily:file:write",
      "im:chat.access_event.bot_p2p_chat:read"
    ]
  }
}

上面的图片中 顶部的 ”创建版本“ 发布即可

然后需要在openclaw中设置id和key

在openclaw里面配置后,飞书事件配置

选择

已添加事件 – 消息与群组
已添加事件 – 身份验证
已添加事件 – 通讯录

全选

需要重启网关

openclaw config set channels.feishu.dmPolicy open

openclaw gateway restart

启动openclaw 电脑关机后启动服务

openclaw gateway start

Ollama本地化LLM

安装最新的ollama,使用ollama pull下载模型 必须是最新的模型qwen3.5,不然无法支持openclaw的tools

ollama launch openclaw

然后在页面中选择你要使用的服务即可!

安装失败:

node.exe : npm error code 128 网络问题,因为需要使用github大概率有问题

node.exe : npm error code 1 已经安装过一次了需要卸载

npm cache clean –force

npm uninstall -g openclaw

NPM安装失败

git config --global url."https://github.com/".insteadOf "ssh://git@github.com/"

#修改GIT中安装时候使用SSH 改为HTTPS【默认需要安装openclaw 包依赖的 libsignal-node 库使用了 SSH 协议】,再执行安装命令。
npm install -g  openclaw

网关令牌缺失

安装完成后会自动跳转到浏览器,如果没有跳转直接打开http://127.0.0.1:18789 会显示网关令牌缺失。请使用命令行生成带有验证的链接 openclaw dashboard

code 128 使用镜像替换

git config --global url."https://bgithub.xyz/".insteadOf "https://github.com/" 
git config --global url."https://bgithub.xyz/".insteadOf "git@github.com:"

code 128 有时候也可以通过重复安装完成,主要看你网络,清晨 几率高一点

发表在 None | 留下评论