跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[投资] 交流下可视化回测框架

发表于

回测框架主要有: 1.云平台:聚宽等,不熟悉,有好用的可以推荐下(平台亮点是啥)。 2.自建:获取 k 线数据的 api ,开源可视化框架的选择( python 下)

主要讲一下,昨天花了半天时间,用 cursor ( ai 写代码)写了个简单可视化回测框架,cursor 很香,不知道阿里的通义灵码怎么样,过段时间体验下。 api:baostack ,不收费。 可视化回测框架:backtrader 。一个 python 文件就可以写一个简单的 trade 策略了。 有更好的方式和方案选择也可以推荐下。

trade 策略: 投资宽基指数 etf (上证指数),资金分份( 5 份),每下跌固定百分比( 4%)买一份,持有总收益涨一定幅度并回落卖出(涨 6%回落 1%),第一份买入必须是从高点下降一定幅度( 8%)才买入,这样性价比相对高一些(也可以通过大周期技术指标判断高低点择时买入第一份)。

回测从 2020-1-1 至今 2024-8-19 的数据。新账号不能发图,自己 base64 解码看把。aHR0cHM6Ly9pLmltZ3VyLmNvbS9NRkltMExwLmpwZWc=

最大投入资金份数为 3 ,3 年多总收益是总金额的 13%,比较低-_-。

总结: 收益率比较低,资金占用率还好,可以用剩余前买短期无风险的基金(债券,货币,国债逆回购)。 对下行周期品种比较友好,对于持续上涨品种此策略无法把握。 对比定投收益低很多,胜在回撤相对来说比较小。可以作为价值投资的底仓,不同风险偏好只需要设置不同资金份数就可以了。

投资大佬们,技术大佬们,多提提建议,有好的方案分享交流下。

TODO: 1.策略和每次买卖需要持久化存储,展示和数据管理。 2.买卖点的每日提醒。

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.