Skip to content

Commit

Permalink
doc: update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoZhengZhao committed Nov 4, 2024
1 parent 002c824 commit 716a6db
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
### Change Log

## v0.0.34
- 修复了前端的 `自定义策略` 支持代码自动提示不正确的问题
- 增加了2个自定义函数 `IsAsc` 是否是升序数组, `IsDesc` 是否是降序数组

## v0.0.33
- 重构了 `自定义策略` 的逻辑,更新 `自定义策略` 文档
- 编写 `自定义策略` 支持代码自动提示和测试功能
Expand Down
27 changes: 25 additions & 2 deletions STRATEGY.CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,33 @@ ema_4h_3.Data[0] > ema_4h_7.Data[0] && ema_4h_3.Data[1] < ema_4h_7.Data[1]
#### 内置函数
> https://expr-lang.org/docs/language-definition#array-functions
##### 其它
##### 其它函数

###### Kdj

```
/**
* 是否只产生过一次金叉(短线穿越长线一次,没有反复穿越)
* @param ma1 短线
* @param ma2 长线
* @param num 检查数量
* @returns Boolean
*/
func Kdj(ma1 []float64, ma2[]float64, num int) bool
```

###### IsDesc

```
// 是否是一个降序数组
func IsDesc(arr []float64) bool
```

###### IsAsc

```
todo
// 是否是一个升序数组
func IsAsc(arr []float64) bool
```

#### 技术指标生成的变量
Expand Down
27 changes: 25 additions & 2 deletions STRATEGY.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,33 @@ ema_4h_3.Data[0] > ema_4h_7.Data[0] && ema_4h_3.Data[1] < ema_4h_7.Data[1]
#### Built in function
> https://expr-lang.org/docs/language-definition#array-functions
##### other
##### other function

###### Kdj

```
/**
* Has there only been one golden cross (short-term crossing over long-term once, without repeated crossing)
* @param ma1 short-term
* @param ma2 long-term
* @param num num
* @returns Boolean
*/
func Kdj(ma1 []float64, ma2[]float64, num int) bool
```

###### IsDesc

```
// Is it a descending array
func IsDesc(arr []float64) bool
```

###### IsAsc

```
todo
// Is it an ascending array
func IsAsc(arr []float64) bool
```

#### variables generated by technical indicators
Expand Down
4 changes: 2 additions & 2 deletions feature/strategy/line/line7.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (TradeLine TradeLine7) GetCanLongOrShort(symbol string) (canLong bool, canS
if err != nil {
return false, false
}
kline_2, err := binance.GetKlineData(symbol, "1d", limit)
kline_2, err := binance.GetKlineData(symbol, "12h", limit)
if err != nil {
return false, false
}
Expand All @@ -53,7 +53,7 @@ func (TradeLine TradeLine7) GetCanLongOrShort(symbol string) (canLong bool, canS
// 最近10根k线最低价格在kc2下轨之下
if low1[i] < lower2[i] {
// 大级别看起来是上升通道
if (utils.IsDesc(close2[0:3])) {
if (utils.IsDesc(close2[0:2])) {
return true, false
}
}
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion static/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=renderer content=webkit><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><link rel=icon href=/favicon.ico><title>币安量化交易</title><link href=/static/css/app.efb72e8a.css rel=preload as=style><link href=/static/css/chunk-libs.3dfb7769.css rel=preload as=style><link href=/static/js/app.839250ad.js rel=preload as=script><link href=/static/js/chunk-elementUI.0a9cbfa2.js rel=preload as=script><link href=/static/js/chunk-libs.0904226e.js rel=preload as=script><link href=/static/css/chunk-libs.3dfb7769.css rel=stylesheet><link href=/static/css/app.efb72e8a.css rel=stylesheet></head><body><div id=app></div><script>(function(e){function n(n){for(var c,r,o=n[0],d=n[1],f=n[2],h=0,i=[];h<o.length;h++)r=o[h],Object.prototype.hasOwnProperty.call(a,r)&&a[r]&&i.push(a[r][0]),a[r]=0;for(c in d)Object.prototype.hasOwnProperty.call(d,c)&&(e[c]=d[c]);l&&l(n);while(i.length)i.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,n=0;n<u.length;n++){for(var t=u[n],c=!0,r=1;r<t.length;r++){var o=t[r];0!==a[o]&&(c=!1)}c&&(u.splice(n--,1),e=d(d.s=t[0]))}return e}var c={},r={runtime:0},a={runtime:0},u=[];function o(e){return d.p+"static/js/"+({}[e]||e)+"."+{"chunk-135456f2":"445101eb","chunk-248e925b":"9758a7aa","chunk-2d2105d3":"f51ab7bf","chunk-2d230fe7":"1a45108d","chunk-38157ba2":"54cb485e","chunk-3b6cce88":"0bf5b908","chunk-4aaec48c":"c8b93b79","chunk-5a209b0c":"d046965b","chunk-526a1183":"bb52ef1a","chunk-65d81035":"e12cbb45","chunk-ac436e52":"8ec55275","chunk-16403627":"bd703fd2","chunk-3bfd2e43":"d8e907e7","chunk-1ccfa144":"adacf295","chunk-03db9806":"f329d5a4","chunk-c12a8234":"fddbdaea","chunk-6f894a6d":"bd29aa18","chunk-71a7dfa2":"9a2ce340","chunk-c504c1b2":"a37cd66b","chunk-d696a108":"0e3e7205"}[e]+".js"}function d(n){if(c[n])return c[n].exports;var t=c[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,d),t.l=!0,t.exports}d.e=function(e){var n=[],t={"chunk-135456f2":1,"chunk-248e925b":1,"chunk-3b6cce88":1,"chunk-5a209b0c":1,"chunk-526a1183":1,"chunk-3bfd2e43":1,"chunk-03db9806":1,"chunk-c12a8234":1,"chunk-d696a108":1};r[e]?n.push(r[e]):0!==r[e]&&t[e]&&n.push(r[e]=new Promise((function(n,t){for(var c="static/css/"+({}[e]||e)+"."+{"chunk-135456f2":"804344b2","chunk-248e925b":"f387d929","chunk-2d2105d3":"31d6cfe0","chunk-2d230fe7":"31d6cfe0","chunk-38157ba2":"31d6cfe0","chunk-3b6cce88":"13a7e89e","chunk-4aaec48c":"31d6cfe0","chunk-5a209b0c":"40849d1f","chunk-526a1183":"53be0b48","chunk-65d81035":"31d6cfe0","chunk-ac436e52":"31d6cfe0","chunk-16403627":"31d6cfe0","chunk-3bfd2e43":"73a2bedf","chunk-1ccfa144":"31d6cfe0","chunk-03db9806":"0729eea3","chunk-c12a8234":"0729eea3","chunk-6f894a6d":"31d6cfe0","chunk-71a7dfa2":"31d6cfe0","chunk-c504c1b2":"31d6cfe0","chunk-d696a108":"b1dd7a76"}[e]+".css",a=d.p+c,u=document.getElementsByTagName("link"),o=0;o<u.length;o++){var f=u[o],h=f.getAttribute("data-href")||f.getAttribute("href");if("stylesheet"===f.rel&&(h===c||h===a))return n()}var i=document.getElementsByTagName("style");for(o=0;o<i.length;o++){f=i[o],h=f.getAttribute("data-href");if(h===c||h===a)return n()}var l=document.createElement("link");l.rel="stylesheet",l.type="text/css",l.onload=n,l.onerror=function(n){var c=n&&n.target&&n.target.src||a,u=new Error("Loading CSS chunk "+e+" failed.\n("+c+")");u.code="CSS_CHUNK_LOAD_FAILED",u.request=c,delete r[e],l.parentNode.removeChild(l),t(u)},l.href=a;var b=document.getElementsByTagName("head")[0];b.appendChild(l)})).then((function(){r[e]=0})));var c=a[e];if(0!==c)if(c)n.push(c[2]);else{var u=new Promise((function(n,t){c=a[e]=[n,t]}));n.push(c[2]=u);var f,h=document.createElement("script");h.charset="utf-8",h.timeout=120,d.nc&&h.setAttribute("nonce",d.nc),h.src=o(e);var i=new Error;f=function(n){h.onerror=h.onload=null,clearTimeout(l);var t=a[e];if(0!==t){if(t){var c=n&&("load"===n.type?"missing":n.type),r=n&&n.target&&n.target.src;i.message="Loading chunk "+e+" failed.\n("+c+": "+r+")",i.name="ChunkLoadError",i.type=c,i.request=r,t[1](i)}a[e]=void 0}};var l=setTimeout((function(){f({type:"timeout",target:h})}),12e4);h.onerror=h.onload=f,document.head.appendChild(h)}return Promise.all(n)},d.m=e,d.c=c,d.d=function(e,n,t){d.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},d.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.t=function(e,n){if(1&n&&(e=d(e)),8&n)return e;if(4&n&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(d.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var c in e)d.d(t,c,function(n){return e[n]}.bind(null,c));return t},d.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return d.d(n,"a",n),n},d.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},d.p="/",d.oe=function(e){throw console.error(e),e};var f=window["webpackJsonp"]=window["webpackJsonp"]||[],h=f.push.bind(f);f.push=n,f=f.slice();for(var i=0;i<f.length;i++)n(f[i]);var l=h;t()})([]);</script><script src=/static/js/chunk-elementUI.0a9cbfa2.js></script><script src=/static/js/chunk-libs.0904226e.js></script><script src=/static/js/app.839250ad.js></script></body></html>
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=renderer content=webkit><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><link rel=icon href=/favicon.ico><title>币安量化交易</title><link href=/static/css/app.efb72e8a.css rel=preload as=style><link href=/static/css/chunk-libs.3dfb7769.css rel=preload as=style><link href=/static/js/app.f7ac1fd6.js rel=preload as=script><link href=/static/js/chunk-elementUI.0a9cbfa2.js rel=preload as=script><link href=/static/js/chunk-libs.0904226e.js rel=preload as=script><link href=/static/css/chunk-libs.3dfb7769.css rel=stylesheet><link href=/static/css/app.efb72e8a.css rel=stylesheet></head><body><div id=app></div><script>(function(e){function n(n){for(var c,r,o=n[0],d=n[1],f=n[2],h=0,i=[];h<o.length;h++)r=o[h],Object.prototype.hasOwnProperty.call(u,r)&&u[r]&&i.push(u[r][0]),u[r]=0;for(c in d)Object.prototype.hasOwnProperty.call(d,c)&&(e[c]=d[c]);l&&l(n);while(i.length)i.shift()();return a.push.apply(a,f||[]),t()}function t(){for(var e,n=0;n<a.length;n++){for(var t=a[n],c=!0,r=1;r<t.length;r++){var o=t[r];0!==u[o]&&(c=!1)}c&&(a.splice(n--,1),e=d(d.s=t[0]))}return e}var c={},r={runtime:0},u={runtime:0},a=[];function o(e){return d.p+"static/js/"+({}[e]||e)+"."+{"chunk-135456f2":"445101eb","chunk-248e925b":"9758a7aa","chunk-2d2105d3":"f51ab7bf","chunk-2d230fe7":"1a45108d","chunk-38157ba2":"54cb485e","chunk-3b6cce88":"0bf5b908","chunk-4aaec48c":"c8b93b79","chunk-5a209b0c":"d046965b","chunk-526a1183":"bb52ef1a","chunk-65d81035":"e12cbb45","chunk-ac436e52":"8ec55275","chunk-16403627":"bd703fd2","chunk-3bfd2e43":"d8e907e7","chunk-1ccfa144":"adacf295","chunk-040d747d":"097dd3d4","chunk-ec488008":"a6bf7cd1","chunk-6f894a6d":"bd29aa18","chunk-71a7dfa2":"9a2ce340","chunk-c504c1b2":"a37cd66b","chunk-d696a108":"0e3e7205"}[e]+".js"}function d(n){if(c[n])return c[n].exports;var t=c[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,d),t.l=!0,t.exports}d.e=function(e){var n=[],t={"chunk-135456f2":1,"chunk-248e925b":1,"chunk-3b6cce88":1,"chunk-5a209b0c":1,"chunk-526a1183":1,"chunk-3bfd2e43":1,"chunk-040d747d":1,"chunk-ec488008":1,"chunk-d696a108":1};r[e]?n.push(r[e]):0!==r[e]&&t[e]&&n.push(r[e]=new Promise((function(n,t){for(var c="static/css/"+({}[e]||e)+"."+{"chunk-135456f2":"804344b2","chunk-248e925b":"f387d929","chunk-2d2105d3":"31d6cfe0","chunk-2d230fe7":"31d6cfe0","chunk-38157ba2":"31d6cfe0","chunk-3b6cce88":"13a7e89e","chunk-4aaec48c":"31d6cfe0","chunk-5a209b0c":"40849d1f","chunk-526a1183":"53be0b48","chunk-65d81035":"31d6cfe0","chunk-ac436e52":"31d6cfe0","chunk-16403627":"31d6cfe0","chunk-3bfd2e43":"73a2bedf","chunk-1ccfa144":"31d6cfe0","chunk-040d747d":"0729eea3","chunk-ec488008":"0729eea3","chunk-6f894a6d":"31d6cfe0","chunk-71a7dfa2":"31d6cfe0","chunk-c504c1b2":"31d6cfe0","chunk-d696a108":"b1dd7a76"}[e]+".css",u=d.p+c,a=document.getElementsByTagName("link"),o=0;o<a.length;o++){var f=a[o],h=f.getAttribute("data-href")||f.getAttribute("href");if("stylesheet"===f.rel&&(h===c||h===u))return n()}var i=document.getElementsByTagName("style");for(o=0;o<i.length;o++){f=i[o],h=f.getAttribute("data-href");if(h===c||h===u)return n()}var l=document.createElement("link");l.rel="stylesheet",l.type="text/css",l.onload=n,l.onerror=function(n){var c=n&&n.target&&n.target.src||u,a=new Error("Loading CSS chunk "+e+" failed.\n("+c+")");a.code="CSS_CHUNK_LOAD_FAILED",a.request=c,delete r[e],l.parentNode.removeChild(l),t(a)},l.href=u;var s=document.getElementsByTagName("head")[0];s.appendChild(l)})).then((function(){r[e]=0})));var c=u[e];if(0!==c)if(c)n.push(c[2]);else{var a=new Promise((function(n,t){c=u[e]=[n,t]}));n.push(c[2]=a);var f,h=document.createElement("script");h.charset="utf-8",h.timeout=120,d.nc&&h.setAttribute("nonce",d.nc),h.src=o(e);var i=new Error;f=function(n){h.onerror=h.onload=null,clearTimeout(l);var t=u[e];if(0!==t){if(t){var c=n&&("load"===n.type?"missing":n.type),r=n&&n.target&&n.target.src;i.message="Loading chunk "+e+" failed.\n("+c+": "+r+")",i.name="ChunkLoadError",i.type=c,i.request=r,t[1](i)}u[e]=void 0}};var l=setTimeout((function(){f({type:"timeout",target:h})}),12e4);h.onerror=h.onload=f,document.head.appendChild(h)}return Promise.all(n)},d.m=e,d.c=c,d.d=function(e,n,t){d.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},d.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.t=function(e,n){if(1&n&&(e=d(e)),8&n)return e;if(4&n&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(d.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var c in e)d.d(t,c,function(n){return e[n]}.bind(null,c));return t},d.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return d.d(n,"a",n),n},d.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},d.p="/",d.oe=function(e){throw console.error(e),e};var f=window["webpackJsonp"]=window["webpackJsonp"]||[],h=f.push.bind(f);f.push=n,f=f.slice();for(var i=0;i<f.length;i++)n(f[i]);var l=h;t()})([]);</script><script src=/static/js/chunk-elementUI.0a9cbfa2.js></script><script src=/static/js/chunk-libs.0904226e.js></script><script src=/static/js/app.f7ac1fd6.js></script></body></html>
2 changes: 1 addition & 1 deletion static/js/app.839250ad.js → static/js/app.f7ac1fd6.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion static/js/chunk-03db9806.f329d5a4.js

This file was deleted.

1 change: 1 addition & 0 deletions static/js/chunk-040d747d.097dd3d4.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion static/js/chunk-c12a8234.fddbdaea.js

This file was deleted.

1 change: 1 addition & 0 deletions static/js/chunk-ec488008.a6bf7cd1.js

Large diffs are not rendered by default.

0 comments on commit 716a6db

Please sign in to comment.