From 33f4c4e52d9eac78c16e5f080bcc97abce890069 Mon Sep 17 00:00:00 2001 From: Frank Zhou <529808348@qq.com> Date: Wed, 25 Mar 2020 08:03:24 +0800 Subject: [PATCH] Rename --- README.md | 24 ++++++++++---------- README_en.md | 22 +++++++++--------- accountsummary.go | 2 +- backtest/backtest.go | 4 ++-- bar.go | 2 +- broker.go | 2 +- brokers/bitmex-broker/broker.go | 2 +- brokers/bitmex-broker/broker_test.go | 2 +- brokers/bitmex-sim-broker/helper.go | 8 +++---- brokers/bitmex-sim-broker/simbroker.go | 6 ++--- brokers/builder.go | 12 +++++----- brokers/bybit-broker/broker.go | 2 +- brokers/deribit-broker/broker.go | 2 +- brokers/deribit-broker/broker_test.go | 2 +- brokers/deribit-broker/orderbook_local.go | 2 +- brokers/deribit-broker/orderbook_manager.go | 2 +- brokers/deribit-sim-broker/helper.go | 2 +- brokers/deribit-sim-broker/helper_test.go | 2 +- brokers/deribit-sim-broker/simbroker.go | 6 ++--- brokers/deribit-sim-broker/simbroker_test.go | 2 +- brokers/hbdm-broker/broker.go | 2 +- brokers/hbdm-broker/broker_test.go | 2 +- brokers/okex-broker/broker.go | 2 +- brokers/okex-broker/broker_test.go | 2 +- consts.go | 2 +- data/csv_dataloader.go | 2 +- data/data.go | 2 +- data/dataloader.go | 2 +- event.go | 2 +- examples/backtest/main.go | 8 +++---- examples/live/main.go | 4 ++-- go.mod | 2 +- logitem.go | 2 +- order.go | 2 +- orderbook.go | 2 +- position.go | 2 +- stats.go | 2 +- strategy.go | 2 +- 38 files changed, 76 insertions(+), 76 deletions(-) diff --git a/README.md b/README.md index 1f49ccb..d76b3cd 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# GoTrader +# CREX [README](README.md) | [English README](README_en.md) -### GoTrader -GoTrader 是一个用Golang语言开发的量化交易库。支持tick级别数字币期货平台的回测和实盘。 +### CREX +CREX 是一个用Golang语言开发的量化交易库。支持tick级别数字币期货平台的回测和实盘。 ### 标准 CSV 数据格式 * 列定界符: , (逗号) @@ -33,10 +33,10 @@ t,asks[0].price,asks[0].amount,asks[1].price,asks[1].amount,asks[2].price,asks[2 ``` ### 回测 -示例 [@backtest](https://github.com/coinrust/gotrader/blob/master/examples/backtest/main.go) +示例 [@backtest](https://github.com/coinrust/crex/blob/master/examples/backtest/main.go) ### 实盘 -示例 [@live trading](https://github.com/coinrust/gotrader/blob/master/examples/live/main.go) +示例 [@live trading](https://github.com/coinrust/crex/blob/master/examples/live/main.go) ### 主要特性 * 使用简单 @@ -46,19 +46,19 @@ t,asks[0].price,asks[0].amount,asks[1].price,asks[1].amount,asks[2].price,asks[2 ### 支持交易所 | 交易所 | 回测 | 实盘 | Broker | | ----------------------------------------------------- |------------------ | ----------------- | ----------------- | -| [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) | -| [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) | -| [Bybit](https://www.bybit.com/app/register?ref=qQggy) | No | Yes | [Live](https://github.com/coinrust/gotrader/tree/master/brokers/bybit-broker) | -| [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) | -| [OKEXFutures](https://www.okex.me/join/1890951) | No | Yes | [Live](https://github.com/coinrust/gotrader/tree/master/brokers/okex-broker) | +| [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) | +| [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) | +| [Bybit](https://www.bybit.com/app/register?ref=qQggy) | No | Yes | [Live](https://github.com/coinrust/crex/tree/master/brokers/bybit-broker) | +| [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) | +| [OKEXFutures](https://www.okex.me/join/1890951) | No | Yes | [Live](https://github.com/coinrust/crex/tree/master/brokers/okex-broker) | ### 示例 ```golang package main import ( - . "github.com/coinrust/gotrader" - "github.com/coinrust/gotrader/brokers" + . "github.com/coinrust/crex" + "github.com/coinrust/crex/brokers" "log" "time" ) diff --git a/README_en.md b/README_en.md index 5186d24..620295a 100644 --- a/README_en.md +++ b/README_en.md @@ -1,8 +1,8 @@ -# GoTrader +# CREX [README](README.md) | [English README](README_en.md) -### GoTrader +### CREX A real-time quantitative trading/backtesting library in Golang. ### 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 ``` ### Backtesting -See [@backtest](https://github.com/coinrust/gotrader/blob/master/examples/backtest/main.go) +See [@backtest](https://github.com/coinrust/crex/blob/master/examples/backtest/main.go) ### Live trading -See [@live trading](https://github.com/coinrust/gotrader/blob/master/examples/live/main.go) +See [@live trading](https://github.com/coinrust/crex/blob/master/examples/live/main.go) ### Main Features * Ease of use. @@ -47,19 +47,19 @@ See [@live trading](https://github.com/coinrust/gotrader/blob/master/examples/li | Exchange Name | Backtesting | Live trading | Broker | | ----------------------------------------------------- |------------------ | ----------------- | ----------------- | | ----------------------------------------------------- |------------------ | ----------------- | ----------------- | -| [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) | -| [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) | -| [Bybit](https://www.bybit.com/app/register?ref=qQggy) | No | Yes | [Live](https://github.com/coinrust/gotrader/tree/master/brokers/bybit-broker) | -| [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) | -| [OKEXFutures](https://www.okex.me/join/1890951) | No | Yes | [Live](https://github.com/coinrust/gotrader/tree/master/brokers/okex-broker) | +| [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) | +| [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) | +| [Bybit](https://www.bybit.com/app/register?ref=qQggy) | No | Yes | [Live](https://github.com/coinrust/crex/tree/master/brokers/bybit-broker) | +| [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) | +| [OKEXFutures](https://www.okex.me/join/1890951) | No | Yes | [Live](https://github.com/coinrust/crex/tree/master/brokers/okex-broker) | ### Example ```golang package main import ( - . "github.com/coinrust/gotrader" - "github.com/coinrust/gotrader/brokers" + . "github.com/coinrust/crex" + "github.com/coinrust/crex/brokers" "log" "time" ) diff --git a/accountsummary.go b/accountsummary.go index b35e522..340f96d 100644 --- a/accountsummary.go +++ b/accountsummary.go @@ -1,4 +1,4 @@ -package gotrader +package crex type AccountSummary struct { Balance float64 diff --git a/backtest/backtest.go b/backtest/backtest.go index 38c3398..41daeb2 100644 --- a/backtest/backtest.go +++ b/backtest/backtest.go @@ -1,8 +1,8 @@ package backtest import ( - . "github.com/coinrust/gotrader" - data "github.com/coinrust/gotrader/data" + . "github.com/coinrust/crex" + data "github.com/coinrust/crex/data" "log" "time" ) diff --git a/bar.go b/bar.go index 4697595..539246f 100644 --- a/bar.go +++ b/bar.go @@ -1,4 +1,4 @@ -package gotrader +package crex type Bar struct { Event diff --git a/broker.go b/broker.go index af5936f..6ea2be9 100644 --- a/broker.go +++ b/broker.go @@ -1,4 +1,4 @@ -package gotrader +package crex type Broker interface { // 订阅事件 diff --git a/brokers/bitmex-broker/broker.go b/brokers/bitmex-broker/broker.go index 5d636b9..d2fb39c 100644 --- a/brokers/bitmex-broker/broker.go +++ b/brokers/bitmex-broker/broker.go @@ -1,7 +1,7 @@ package bitmex_broker import ( - . "github.com/coinrust/gotrader" + . "github.com/coinrust/crex" "github.com/frankrap/bitmex-api" "github.com/frankrap/bitmex-api/swagger" "strings" diff --git a/brokers/bitmex-broker/broker_test.go b/brokers/bitmex-broker/broker_test.go index a667208..0edd13b 100644 --- a/brokers/bitmex-broker/broker_test.go +++ b/brokers/bitmex-broker/broker_test.go @@ -1,7 +1,7 @@ package bitmex_broker import ( - . "github.com/coinrust/gotrader" + . "github.com/coinrust/crex" "github.com/frankrap/bitmex-api" "testing" ) diff --git a/brokers/bitmex-sim-broker/helper.go b/brokers/bitmex-sim-broker/helper.go index e4c0d29..cd1ce88 100644 --- a/brokers/bitmex-sim-broker/helper.go +++ b/brokers/bitmex-sim-broker/helper.go @@ -1,13 +1,13 @@ package bitmex_sim_broker import ( - "github.com/coinrust/gotrader" + "github.com/coinrust/crex" ) // 计算收益 // pnl: 收益(BTC/ETH) // pnlUsd: 收益(USD) -func CalcPnl(side gotrader.Direction, positionSize float64, entryPrice float64, exitPrice float64) (pnl float64, pnlUsd float64) { +func CalcPnl(side crex.Direction, positionSize float64, entryPrice float64, exitPrice float64) (pnl float64, pnlUsd float64) { //side := "Short" // "Short" //positionSize := 3850.0 //entryPrice := 3850.0 @@ -17,10 +17,10 @@ func CalcPnl(side gotrader.Direction, positionSize float64, entryPrice float64, if positionSize == 0 { return } - if side == gotrader.Buy { + if side == crex.Buy { pnl = (((entryPrice - exitPrice) / exitPrice) * (positionSize / entryPrice)) * -1 pnlUsd = ((entryPrice - exitPrice) * (positionSize / entryPrice)) * -1 - } else if side == gotrader.Sell { + } else if side == crex.Sell { pnl = ((entryPrice - exitPrice) / exitPrice) * (positionSize / entryPrice) pnlUsd = (entryPrice - exitPrice) * (positionSize / entryPrice) } diff --git a/brokers/bitmex-sim-broker/simbroker.go b/brokers/bitmex-sim-broker/simbroker.go index 0201d4c..b981617 100644 --- a/brokers/bitmex-sim-broker/simbroker.go +++ b/brokers/bitmex-sim-broker/simbroker.go @@ -3,9 +3,9 @@ package bitmex_sim_broker import ( "errors" "fmt" - . "github.com/coinrust/gotrader" - "github.com/coinrust/gotrader/data" - "github.com/coinrust/gotrader/util2" + . "github.com/coinrust/crex" + "github.com/coinrust/crex/data" + "github.com/coinrust/crex/util2" "log" "math" "time" diff --git a/brokers/builder.go b/brokers/builder.go index b04451a..6f945b4 100644 --- a/brokers/builder.go +++ b/brokers/builder.go @@ -2,12 +2,12 @@ package brokers import ( "fmt" - . "github.com/coinrust/gotrader" - bitmex_broker "github.com/coinrust/gotrader/brokers/bitmex-broker" - bybit_broker "github.com/coinrust/gotrader/brokers/bybit-broker" - deribit_broker "github.com/coinrust/gotrader/brokers/deribit-broker" - hbdm_broker "github.com/coinrust/gotrader/brokers/hbdm-broker" - okex_broker "github.com/coinrust/gotrader/brokers/okex-broker" + . "github.com/coinrust/crex" + bitmex_broker "github.com/coinrust/crex/brokers/bitmex-broker" + bybit_broker "github.com/coinrust/crex/brokers/bybit-broker" + deribit_broker "github.com/coinrust/crex/brokers/deribit-broker" + hbdm_broker "github.com/coinrust/crex/brokers/hbdm-broker" + okex_broker "github.com/coinrust/crex/brokers/okex-broker" "github.com/frankrap/bitmex-api" "github.com/frankrap/deribit-api" "log" diff --git a/brokers/bybit-broker/broker.go b/brokers/bybit-broker/broker.go index e9b3b6b..7505102 100644 --- a/brokers/bybit-broker/broker.go +++ b/brokers/bybit-broker/broker.go @@ -2,7 +2,7 @@ package bybit_broker import ( "errors" - . "github.com/coinrust/gotrader" + . "github.com/coinrust/crex" "github.com/frankrap/bybit-api/rest" "log" "strings" diff --git a/brokers/deribit-broker/broker.go b/brokers/deribit-broker/broker.go index 5bf87c5..0ce8587 100644 --- a/brokers/deribit-broker/broker.go +++ b/brokers/deribit-broker/broker.go @@ -3,7 +3,7 @@ package deribit_broker import ( "errors" "github.com/chuckpreslar/emission" - . "github.com/coinrust/gotrader" + . "github.com/coinrust/crex" "github.com/frankrap/deribit-api" "github.com/frankrap/deribit-api/models" "time" diff --git a/brokers/deribit-broker/broker_test.go b/brokers/deribit-broker/broker_test.go index dbc273d..747094c 100644 --- a/brokers/deribit-broker/broker_test.go +++ b/brokers/deribit-broker/broker_test.go @@ -1,7 +1,7 @@ package deribit_broker import ( - . "github.com/coinrust/gotrader" + . "github.com/coinrust/crex" "github.com/frankrap/deribit-api" "log" "testing" diff --git a/brokers/deribit-broker/orderbook_local.go b/brokers/deribit-broker/orderbook_local.go index 3a84756..96b9a58 100644 --- a/brokers/deribit-broker/orderbook_local.go +++ b/brokers/deribit-broker/orderbook_local.go @@ -1,7 +1,7 @@ package deribit_broker import ( - . "github.com/coinrust/gotrader" + . "github.com/coinrust/crex" "github.com/frankrap/deribit-api/models" "sort" "strconv" diff --git a/brokers/deribit-broker/orderbook_manager.go b/brokers/deribit-broker/orderbook_manager.go index d8c76b1..0cfa597 100644 --- a/brokers/deribit-broker/orderbook_manager.go +++ b/brokers/deribit-broker/orderbook_manager.go @@ -1,7 +1,7 @@ package deribit_broker import ( - . "github.com/coinrust/gotrader" + . "github.com/coinrust/crex" "github.com/frankrap/deribit-api/models" "sync" ) diff --git a/brokers/deribit-sim-broker/helper.go b/brokers/deribit-sim-broker/helper.go index 9ee25b6..98a0160 100644 --- a/brokers/deribit-sim-broker/helper.go +++ b/brokers/deribit-sim-broker/helper.go @@ -1,7 +1,7 @@ package deribit_sim_broker import ( - . "github.com/coinrust/gotrader" + . "github.com/coinrust/crex" ) //im := (0.01 + sizeCurrency*0.00005) * sizeCurrency diff --git a/brokers/deribit-sim-broker/helper_test.go b/brokers/deribit-sim-broker/helper_test.go index 33d91a3..36b4b9b 100644 --- a/brokers/deribit-sim-broker/helper_test.go +++ b/brokers/deribit-sim-broker/helper_test.go @@ -1,7 +1,7 @@ package deribit_sim_broker import ( - . "github.com/coinrust/gotrader" + . "github.com/coinrust/crex" "testing" ) diff --git a/brokers/deribit-sim-broker/simbroker.go b/brokers/deribit-sim-broker/simbroker.go index 0af3be0..f8cd5fc 100644 --- a/brokers/deribit-sim-broker/simbroker.go +++ b/brokers/deribit-sim-broker/simbroker.go @@ -3,9 +3,9 @@ package deribit_sim_broker import ( "errors" "fmt" - . "github.com/coinrust/gotrader" - "github.com/coinrust/gotrader/data" - "github.com/coinrust/gotrader/util2" + . "github.com/coinrust/crex" + "github.com/coinrust/crex/data" + "github.com/coinrust/crex/util2" "log" "math" "time" diff --git a/brokers/deribit-sim-broker/simbroker_test.go b/brokers/deribit-sim-broker/simbroker_test.go index 73bd624..c719da8 100644 --- a/brokers/deribit-sim-broker/simbroker_test.go +++ b/brokers/deribit-sim-broker/simbroker_test.go @@ -1,7 +1,7 @@ package deribit_sim_broker import ( - "github.com/coinrust/gotrader/math2" + "github.com/coinrust/crex/math2" "testing" ) diff --git a/brokers/hbdm-broker/broker.go b/brokers/hbdm-broker/broker.go index 34506ea..3afb79e 100644 --- a/brokers/hbdm-broker/broker.go +++ b/brokers/hbdm-broker/broker.go @@ -2,7 +2,7 @@ package hbdm_broker import ( "fmt" - . "github.com/coinrust/gotrader" + . "github.com/coinrust/crex" "github.com/frankrap/huobi-api/hbdm" "strconv" "strings" diff --git a/brokers/hbdm-broker/broker_test.go b/brokers/hbdm-broker/broker_test.go index 7064d78..2f9d1d8 100644 --- a/brokers/hbdm-broker/broker_test.go +++ b/brokers/hbdm-broker/broker_test.go @@ -1,7 +1,7 @@ package hbdm_broker import ( - . "github.com/coinrust/gotrader" + . "github.com/coinrust/crex" "github.com/spf13/viper" "log" "testing" diff --git a/brokers/okex-broker/broker.go b/brokers/okex-broker/broker.go index bdff815..c749aab 100644 --- a/brokers/okex-broker/broker.go +++ b/brokers/okex-broker/broker.go @@ -5,7 +5,7 @@ import ( "strconv" "time" - . "github.com/coinrust/gotrader" + . "github.com/coinrust/crex" "github.com/frankrap/okex-api" ) diff --git a/brokers/okex-broker/broker_test.go b/brokers/okex-broker/broker_test.go index 74b0c6f..42682a2 100644 --- a/brokers/okex-broker/broker_test.go +++ b/brokers/okex-broker/broker_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - . "github.com/coinrust/gotrader" + . "github.com/coinrust/crex" "github.com/spf13/viper" ) diff --git a/consts.go b/consts.go index 2e0cbb4..57ddab8 100644 --- a/consts.go +++ b/consts.go @@ -1,4 +1,4 @@ -package gotrader +package crex // TradeMode 策略模式 type TradeMode int diff --git a/data/csv_dataloader.go b/data/csv_dataloader.go index 708a2f9..12dfed7 100644 --- a/data/csv_dataloader.go +++ b/data/csv_dataloader.go @@ -2,7 +2,7 @@ package data import ( "bufio" - . "github.com/coinrust/gotrader" + . "github.com/coinrust/crex" "io" "log" "os" diff --git a/data/data.go b/data/data.go index 9750ed9..ac0fc5b 100644 --- a/data/data.go +++ b/data/data.go @@ -1,7 +1,7 @@ package data import ( - . "github.com/coinrust/gotrader" + . "github.com/coinrust/crex" ) type Data struct { diff --git a/data/dataloader.go b/data/dataloader.go index 8bc7bef..1fea633 100644 --- a/data/dataloader.go +++ b/data/dataloader.go @@ -1,7 +1,7 @@ package data import ( - . "github.com/coinrust/gotrader" + . "github.com/coinrust/crex" ) type DataLoader interface { diff --git a/event.go b/event.go index 6d8598b..09a7997 100644 --- a/event.go +++ b/event.go @@ -1,4 +1,4 @@ -package gotrader +package crex import "time" diff --git a/examples/backtest/main.go b/examples/backtest/main.go index 47bfaaa..17bbbec 100644 --- a/examples/backtest/main.go +++ b/examples/backtest/main.go @@ -2,10 +2,10 @@ package main import ( "fmt" - . "github.com/coinrust/gotrader" - "github.com/coinrust/gotrader/backtest" - "github.com/coinrust/gotrader/brokers/deribit-sim-broker" - "github.com/coinrust/gotrader/data" + . "github.com/coinrust/crex" + "github.com/coinrust/crex/backtest" + "github.com/coinrust/crex/brokers/deribit-sim-broker" + "github.com/coinrust/crex/data" ) type BasicStrategy struct { diff --git a/examples/live/main.go b/examples/live/main.go index ee36c2b..c9c585f 100644 --- a/examples/live/main.go +++ b/examples/live/main.go @@ -1,8 +1,8 @@ package main import ( - . "github.com/coinrust/gotrader" - "github.com/coinrust/gotrader/brokers" + . "github.com/coinrust/crex" + "github.com/coinrust/crex/brokers" "log" "time" ) diff --git a/go.mod b/go.mod index edc9a49..511ff89 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/coinrust/gotrader +module github.com/coinrust/crex go 1.13 diff --git a/logitem.go b/logitem.go index 405fac8..abb1431 100644 --- a/logitem.go +++ b/logitem.go @@ -1,4 +1,4 @@ -package gotrader +package crex import ( "time" diff --git a/order.go b/order.go index 09cb46c..a216c19 100644 --- a/order.go +++ b/order.go @@ -1,4 +1,4 @@ -package gotrader +package crex // Order 委托 type Order struct { diff --git a/orderbook.go b/orderbook.go index e37083b..5a9c1ed 100644 --- a/orderbook.go +++ b/orderbook.go @@ -1,4 +1,4 @@ -package gotrader +package crex import ( "time" diff --git a/position.go b/position.go index 987bf34..c23b800 100644 --- a/position.go +++ b/position.go @@ -1,4 +1,4 @@ -package gotrader +package crex import "time" diff --git a/stats.go b/stats.go index 3ef8e30..a4a9ca0 100644 --- a/stats.go +++ b/stats.go @@ -1,4 +1,4 @@ -package gotrader +package crex import ( "fmt" diff --git a/strategy.go b/strategy.go index d848de7..f5958c0 100644 --- a/strategy.go +++ b/strategy.go @@ -1,4 +1,4 @@ -package gotrader +package crex import "log"