Skip to content

Commit 33f4c4e

Browse files
committed
Rename
1 parent b1db701 commit 33f4c4e

38 files changed

+76
-76
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# GoTrader
1+
# CREX
22

33
[README](README.md) | [English README](README_en.md)
44

5-
### GoTrader
6-
GoTrader 是一个用Golang语言开发的量化交易库。支持tick级别数字币期货平台的回测和实盘。
5+
### CREX
6+
CREX 是一个用Golang语言开发的量化交易库。支持tick级别数字币期货平台的回测和实盘。
77

88
### 标准 CSV 数据格式
99
* 列定界符: , (逗号)
@@ -33,10 +33,10 @@ t,asks[0].price,asks[0].amount,asks[1].price,asks[1].amount,asks[2].price,asks[2
3333
```
3434

3535
### 回测
36-
示例 [@backtest](https://github.com/coinrust/gotrader/blob/master/examples/backtest/main.go)
36+
示例 [@backtest](https://github.com/coinrust/crex/blob/master/examples/backtest/main.go)
3737

3838
### 实盘
39-
示例 [@live trading](https://github.com/coinrust/gotrader/blob/master/examples/live/main.go)
39+
示例 [@live trading](https://github.com/coinrust/crex/blob/master/examples/live/main.go)
4040

4141
### 主要特性
4242
* 使用简单
@@ -46,19 +46,19 @@ t,asks[0].price,asks[0].amount,asks[1].price,asks[1].amount,asks[2].price,asks[2
4646
### 支持交易所
4747
| 交易所 | 回测 | 实盘 | Broker |
4848
| ----------------------------------------------------- |------------------ | ----------------- | ----------------- |
49-
| [BitMEX](https://www.bitmex.com/register/o0Duru) | Yes | Yes | [Sim](https://github.com/coinrust/gotrader/tree/master/brokers/bitmex-sim-broker) / [Live](https://github.com/coinrust/gotrader/tree/master/brokers/bitmex-broker) |
50-
| [Deribit](https://www.deribit.com/reg-7357.93) | Yes | Yes | [Sim](https://github.com/coinrust/gotrader/tree/master/brokers/deribit-sim-broker) / [Live](https://github.com/coinrust/gotrader/tree/master/brokers/deribit-broker) |
51-
| [Bybit](https://www.bybit.com/app/register?ref=qQggy) | No | Yes | [Live](https://github.com/coinrust/gotrader/tree/master/brokers/bybit-broker) |
52-
| [Huobi DM](https://www.huobi.vc/zh-cn/topic/invited/?invite_code=7hzc5) | No | Yes | [Live](https://github.com/coinrust/gotrader/tree/master/brokers/huobi-broker) |
53-
| [OKEXFutures](https://www.okex.me/join/1890951) | No | Yes | [Live](https://github.com/coinrust/gotrader/tree/master/brokers/okex-broker) |
49+
| [BitMEX](https://www.bitmex.com/register/o0Duru) | Yes | Yes | [Sim](https://github.com/coinrust/crex/tree/master/brokers/bitmex-sim-broker) / [Live](https://github.com/coinrust/crex/tree/master/brokers/bitmex-broker) |
50+
| [Deribit](https://www.deribit.com/reg-7357.93) | Yes | Yes | [Sim](https://github.com/coinrust/crex/tree/master/brokers/deribit-sim-broker) / [Live](https://github.com/coinrust/crex/tree/master/brokers/deribit-broker) |
51+
| [Bybit](https://www.bybit.com/app/register?ref=qQggy) | No | Yes | [Live](https://github.com/coinrust/crex/tree/master/brokers/bybit-broker) |
52+
| [Huobi DM](https://www.huobi.vc/zh-cn/topic/invited/?invite_code=7hzc5) | No | Yes | [Live](https://github.com/coinrust/crex/tree/master/brokers/huobi-broker) |
53+
| [OKEXFutures](https://www.okex.me/join/1890951) | No | Yes | [Live](https://github.com/coinrust/crex/tree/master/brokers/okex-broker) |
5454

5555
### 示例
5656
```golang
5757
package main
5858

5959
import (
60-
. "github.com/coinrust/gotrader"
61-
"github.com/coinrust/gotrader/brokers"
60+
. "github.com/coinrust/crex"
61+
"github.com/coinrust/crex/brokers"
6262
"log"
6363
"time"
6464
)

README_en.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# GoTrader
1+
# CREX
22

33
[README](README.md) | [English README](README_en.md)
44

5-
### GoTrader
5+
### CREX
66
A real-time quantitative trading/backtesting library in Golang.
77

88
### Standard CSV data types formats
@@ -33,10 +33,10 @@ t,asks[0].price,asks[0].amount,asks[1].price,asks[1].amount,asks[2].price,asks[2
3333
```
3434

3535
### Backtesting
36-
See [@backtest](https://github.com/coinrust/gotrader/blob/master/examples/backtest/main.go)
36+
See [@backtest](https://github.com/coinrust/crex/blob/master/examples/backtest/main.go)
3737

3838
### Live trading
39-
See [@live trading](https://github.com/coinrust/gotrader/blob/master/examples/live/main.go)
39+
See [@live trading](https://github.com/coinrust/crex/blob/master/examples/live/main.go)
4040

4141
### Main Features
4242
* Ease of use.
@@ -47,19 +47,19 @@ See [@live trading](https://github.com/coinrust/gotrader/blob/master/examples/li
4747
| Exchange Name | Backtesting | Live trading | Broker |
4848
| ----------------------------------------------------- |------------------ | ----------------- | ----------------- |
4949
| ----------------------------------------------------- |------------------ | ----------------- | ----------------- |
50-
| [BitMEX](https://www.bitmex.com/register/o0Duru) | Yes | Yes | [Sim](https://github.com/coinrust/gotrader/tree/master/brokers/bitmex-sim-broker) / [Live](https://github.com/coinrust/gotrader/tree/master/brokers/bitmex-broker) |
51-
| [Deribit](https://www.deribit.com/reg-7357.93) | Yes | Yes | [Sim](https://github.com/coinrust/gotrader/tree/master/brokers/deribit-sim-broker) / [Live](https://github.com/coinrust/gotrader/tree/master/brokers/deribit-broker) |
52-
| [Bybit](https://www.bybit.com/app/register?ref=qQggy) | No | Yes | [Live](https://github.com/coinrust/gotrader/tree/master/brokers/bybit-broker) |
53-
| [Huobi DM](https://www.huobi.vc/zh-cn/topic/invited/?invite_code=7hzc5) | No | Yes | [Live](https://github.com/coinrust/gotrader/tree/master/brokers/huobi-broker) |
54-
| [OKEXFutures](https://www.okex.me/join/1890951) | No | Yes | [Live](https://github.com/coinrust/gotrader/tree/master/brokers/okex-broker) |
50+
| [BitMEX](https://www.bitmex.com/register/o0Duru) | Yes | Yes | [Sim](https://github.com/coinrust/crex/tree/master/brokers/bitmex-sim-broker) / [Live](https://github.com/coinrust/crex/tree/master/brokers/bitmex-broker) |
51+
| [Deribit](https://www.deribit.com/reg-7357.93) | Yes | Yes | [Sim](https://github.com/coinrust/crex/tree/master/brokers/deribit-sim-broker) / [Live](https://github.com/coinrust/crex/tree/master/brokers/deribit-broker) |
52+
| [Bybit](https://www.bybit.com/app/register?ref=qQggy) | No | Yes | [Live](https://github.com/coinrust/crex/tree/master/brokers/bybit-broker) |
53+
| [Huobi DM](https://www.huobi.vc/zh-cn/topic/invited/?invite_code=7hzc5) | No | Yes | [Live](https://github.com/coinrust/crex/tree/master/brokers/huobi-broker) |
54+
| [OKEXFutures](https://www.okex.me/join/1890951) | No | Yes | [Live](https://github.com/coinrust/crex/tree/master/brokers/okex-broker) |
5555

5656
### Example
5757
```golang
5858
package main
5959

6060
import (
61-
. "github.com/coinrust/gotrader"
62-
"github.com/coinrust/gotrader/brokers"
61+
. "github.com/coinrust/crex"
62+
"github.com/coinrust/crex/brokers"
6363
"log"
6464
"time"
6565
)

accountsummary.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package gotrader
1+
package crex
22

33
type AccountSummary struct {
44
Balance float64

backtest/backtest.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package backtest
22

33
import (
4-
. "github.com/coinrust/gotrader"
5-
data "github.com/coinrust/gotrader/data"
4+
. "github.com/coinrust/crex"
5+
data "github.com/coinrust/crex/data"
66
"log"
77
"time"
88
)

bar.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package gotrader
1+
package crex
22

33
type Bar struct {
44
Event

broker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package gotrader
1+
package crex
22

33
type Broker interface {
44
// 订阅事件

brokers/bitmex-broker/broker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package bitmex_broker
22

33
import (
4-
. "github.com/coinrust/gotrader"
4+
. "github.com/coinrust/crex"
55
"github.com/frankrap/bitmex-api"
66
"github.com/frankrap/bitmex-api/swagger"
77
"strings"

brokers/bitmex-broker/broker_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package bitmex_broker
22

33
import (
4-
. "github.com/coinrust/gotrader"
4+
. "github.com/coinrust/crex"
55
"github.com/frankrap/bitmex-api"
66
"testing"
77
)

brokers/bitmex-sim-broker/helper.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package bitmex_sim_broker
22

33
import (
4-
"github.com/coinrust/gotrader"
4+
"github.com/coinrust/crex"
55
)
66

77
// 计算收益
88
// pnl: 收益(BTC/ETH)
99
// pnlUsd: 收益(USD)
10-
func CalcPnl(side gotrader.Direction, positionSize float64, entryPrice float64, exitPrice float64) (pnl float64, pnlUsd float64) {
10+
func CalcPnl(side crex.Direction, positionSize float64, entryPrice float64, exitPrice float64) (pnl float64, pnlUsd float64) {
1111
//side := "Short" // "Short"
1212
//positionSize := 3850.0
1313
//entryPrice := 3850.0
@@ -17,10 +17,10 @@ func CalcPnl(side gotrader.Direction, positionSize float64, entryPrice float64,
1717
if positionSize == 0 {
1818
return
1919
}
20-
if side == gotrader.Buy {
20+
if side == crex.Buy {
2121
pnl = (((entryPrice - exitPrice) / exitPrice) * (positionSize / entryPrice)) * -1
2222
pnlUsd = ((entryPrice - exitPrice) * (positionSize / entryPrice)) * -1
23-
} else if side == gotrader.Sell {
23+
} else if side == crex.Sell {
2424
pnl = ((entryPrice - exitPrice) / exitPrice) * (positionSize / entryPrice)
2525
pnlUsd = (entryPrice - exitPrice) * (positionSize / entryPrice)
2626
}

brokers/bitmex-sim-broker/simbroker.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package bitmex_sim_broker
33
import (
44
"errors"
55
"fmt"
6-
. "github.com/coinrust/gotrader"
7-
"github.com/coinrust/gotrader/data"
8-
"github.com/coinrust/gotrader/util2"
6+
. "github.com/coinrust/crex"
7+
"github.com/coinrust/crex/data"
8+
"github.com/coinrust/crex/util2"
99
"log"
1010
"math"
1111
"time"

0 commit comments

Comments
 (0)