Skip to content
Merged
Show file tree
Hide file tree
Changes from 163 commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
5412e91
Added TimeInForce type and updated related files
samuael Oct 29, 2023
0bbd6fb
Linter issue fix and minor coinbasepro type update
samuael Oct 29, 2023
b786e75
Bitrex consts update
samuael Oct 29, 2023
afa9695
added unit test and minor changes in bittrex
samuael Oct 30, 2023
cb2619b
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Nov 5, 2023
da4b3cb
Unit tests update
samuael Nov 15, 2023
e41ab86
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Nov 15, 2023
c9b88ab
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Nov 23, 2023
e11beef
Fix minor linter issues
samuael Nov 23, 2023
9add848
Update TestStringToTimeInForce unit test
samuael Nov 27, 2023
aecc942
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Nov 27, 2023
3a7ac71
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Nov 29, 2023
44f1cbb
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Dec 6, 2023
964ed95
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Dec 22, 2023
05b4921
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Dec 27, 2023
2179454
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Dec 31, 2023
3043702
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jan 2, 2024
45b3596
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jan 16, 2024
318152b
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jan 24, 2024
cede5cb
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jan 29, 2024
3aa605a
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Feb 28, 2024
6dd27b9
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Mar 6, 2024
c0ca501
Exchange test template change
cranktakular Mar 8, 2024
c09f439
A different approach
cranktakular Mar 11, 2024
6b3e010
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Mar 13, 2024
d82cc0c
fix conflict with gateio timeInForce
samuael Mar 18, 2024
b453062
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Mar 18, 2024
b115b2b
minor exchange template update
samuael Mar 26, 2024
e64ae62
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Mar 26, 2024
917dd6b
Minor fix to test_files template
samuael Mar 26, 2024
22d0f31
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Sep 25, 2024
35b90d1
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Sep 25, 2024
c651a21
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jan 15, 2025
f63547d
Update order tests
samuael Jan 15, 2025
28cb5f7
Complete updating the order unit tests
samuael Jan 16, 2025
a9e4022
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jan 16, 2025
f99e424
Updating exchange wrapper and test template files
samuael Jan 16, 2025
5975355
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jan 20, 2025
f708de2
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jan 20, 2025
2f09ca0
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jan 31, 2025
7e9bcc0
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Feb 6, 2025
630df5a
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Feb 10, 2025
9fe9504
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Feb 10, 2025
c2c59e4
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Feb 17, 2025
6828343
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Feb 17, 2025
fb1c4e0
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Feb 18, 2025
41de4e8
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Feb 18, 2025
addf572
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Feb 20, 2025
84445fc
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Feb 20, 2025
745977b
update kucoin and deribit wrapper to match the time in force change
samuael Feb 20, 2025
fcd0e4a
minor comment update
samuael Feb 20, 2025
b05fe7f
fix time-in-force related test errors
samuael Feb 20, 2025
2085156
linter issue fix
samuael Feb 20, 2025
971a3ac
ADD_NEW_EXCHANGE documentation update
samuael Feb 20, 2025
de494ac
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Feb 24, 2025
0efc8c8
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Feb 24, 2025
889c7cc
time in force constants, functions and unit tests update
samuael Feb 25, 2025
83b6521
shift tif policies to TimeInForce
samuael Feb 28, 2025
9bef751
Update time-in-force, related functions, and unit tests
samuael Mar 3, 2025
18ed556
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Mar 3, 2025
0fbaad8
fix linter issue and time-in-force processing
samuael Mar 4, 2025
892ff5e
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Mar 4, 2025
8921ebe
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Mar 4, 2025
88584b8
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Mar 7, 2025
0cf66a2
added a good till crossing tif value
samuael Mar 8, 2025
1679be7
order type fix and fix related tim-in-force entries
samuael Mar 9, 2025
3f752f2
update time-in-force unmarshaling and unit test
samuael Mar 10, 2025
8733ed4
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Mar 10, 2025
ddecf99
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Mar 11, 2025
9535fec
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Mar 11, 2025
9b73f05
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Mar 13, 2025
35f37d7
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Mar 13, 2025
736b6fa
consistency guideline added
samuael Mar 15, 2025
7bd0b68
fix time-in-force error in gateio
samuael Mar 17, 2025
26f6f8d
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Mar 17, 2025
0b2f5e2
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Mar 18, 2025
7fb6142
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Mar 20, 2025
451bcf8
linter issue fix
samuael Mar 20, 2025
fdcd5e6
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Mar 20, 2025
fc9c4a8
update based on review comments
samuael Mar 24, 2025
ed5e9c8
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Mar 25, 2025
d4e9fa4
add unit test and fix missing issues
samuael Mar 25, 2025
a128e9c
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Mar 25, 2025
deb4eff
minor fix and added benchmark unit test
samuael Mar 26, 2025
a645754
change GTT to GTC for limit
samuael Apr 2, 2025
8346856
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Apr 2, 2025
274db9a
fix linter issue
samuael Apr 2, 2025
e02e785
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Apr 2, 2025
e958584
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Apr 7, 2025
3f370b2
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Apr 7, 2025
14134b1
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Apr 10, 2025
5a54221
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Apr 10, 2025
744efad
added time-in-force value to place order param
samuael Apr 10, 2025
7a52b70
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Apr 11, 2025
ebff2ae
Merge branch 'update_tif' into template_update
samuael Apr 11, 2025
3d806e5
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Apr 15, 2025
5129139
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Apr 15, 2025
2b088d0
fix minor issues based on review comment and move tif code to separat…
samuael Apr 15, 2025
0d22549
update on exchanges linked to time-in-force
samuael Apr 15, 2025
dfdbdfc
resolve missing review comments
samuael Apr 15, 2025
84eb5b5
minor linter issues fix
samuael Apr 15, 2025
a9a4bb1
added time-in-force handler and update timeInForce parametered endpoint
samuael Apr 15, 2025
a2b5dde
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Apr 17, 2025
36b22b5
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Apr 17, 2025
286aefd
minor fixes based on review
samuael Apr 17, 2025
b25a7c7
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Apr 22, 2025
7fb97d5
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Apr 24, 2025
6a6e466
nits fix
samuael Apr 29, 2025
0b5bb56
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael May 1, 2025
f09c0b9
update based on review
samuael May 1, 2025
9659775
linter fix
samuael May 1, 2025
ad6f761
rm getTimeInForce func and minor change to time-in-force
samuael May 2, 2025
f9e756c
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael May 2, 2025
e6d375b
Merge branch 'update_tif' into template_update
samuael May 2, 2025
21cd947
minor change
samuael May 2, 2025
89ff36a
update based on review comments
samuael May 6, 2025
31668c0
wrappers and time-in-force calling approach
samuael May 7, 2025
764eb37
minor change
samuael May 8, 2025
3a21dc4
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael May 8, 2025
9c6f10d
update gateio string to timeInForce conversion and unit test
samuael May 10, 2025
84dc671
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael May 10, 2025
b343762
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael May 10, 2025
22dcdec
Merge branch 'update_tif' into template_update
samuael May 10, 2025
af9c178
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael May 20, 2025
ca5e796
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael May 25, 2025
1b5dd75
update exchange template
samuael May 27, 2025
d7b8a6f
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael May 27, 2025
729c1d9
update wrapper template file
samuael May 27, 2025
e59db3b
policy comments, and template files update
samuael May 27, 2025
94121e7
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jun 3, 2025
56c2644
rename all exchange types name to Exchange
samuael Jun 3, 2025
b332dea
update on template files and template generation
samuael Jun 3, 2025
06f323a
templates and generation code and other updates
samuael Jun 5, 2025
7ca9f64
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jun 11, 2025
c2aa9a7
linter issue fix
samuael Jun 11, 2025
99a6067
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jun 12, 2025
34b9577
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jun 13, 2025
f159410
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jun 16, 2025
682116b
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jun 17, 2025
31dc868
added subscriptions and websocket templates
samuael Jun 18, 2025
8a29dd2
update ADD_NEW_EXCHANGE.md with recent binance functions and implemen…
samuael Jun 18, 2025
852d44f
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jun 18, 2025
55b7539
rename template files and update unit tests
samuael Jun 19, 2025
31b0b4b
minor template and unit test fix
samuael Jun 20, 2025
1b65754
rename templates and fix on unit tests
samuael Jun 22, 2025
f2024f0
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jun 24, 2025
bbdbcb6
update on template files and documentation
samuael Jun 24, 2025
a3b7267
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jun 25, 2025
e3927ce
removed unnecessary tag fix and update templates
samuael Jun 25, 2025
c9a7abe
fix Add_NEW_EXCHANGE.md doc file
samuael Jun 26, 2025
206809a
formatting, comments, and error checks update on template files
samuael Jun 30, 2025
17fffe3
rename exchange receivers to e and ex for consistency
samuael Jun 30, 2025
494b978
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jul 1, 2025
06764e7
rename unit test exchange receiver and minor updates
samuael Jul 1, 2025
60a58aa
linter issues fix
samuael Jul 1, 2025
5c831b3
fix deribit issue and minor style update
samuael Jul 3, 2025
9dcba06
fix test issues caused by receiver change
samuael Jul 4, 2025
c8dacb9
raname local variables exchange declaration variables
samuael Jul 5, 2025
fd07039
update templates comments
samuael Jul 7, 2025
20d8897
update templates and related comments
samuael Jul 8, 2025
eccce94
renamed ex to e
samuael Jul 8, 2025
8f6bdb2
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jul 8, 2025
0f7df23
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jul 11, 2025
f0e0f07
Merge branch 'master' of http://github.com/thrasher-corp/gocryptotrad…
samuael Jul 14, 2025
837b782
update template comments
samuael Jul 14, 2025
ae2f8f6
toggle WS to false to improve coverage
samuael Jul 15, 2025
da4bc56
template comments update
samuael Jul 15, 2025
e67d9da
added test coverage to Ws enabled and minor changes
samuael Jul 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions backtester/engine/backtest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ func TestReset(t *testing.T) {

func TestFullCycle(t *testing.T) {
t.Parallel()
ex := testExchange
e := testExchange
cp := currency.NewBTCUSDT()
a := asset.Spot
tt := time.Now()
Expand All @@ -431,18 +431,18 @@ func TestFullCycle(t *testing.T) {
}, &risk.Risk{}, decimal.Zero)
assert.NoError(t, err)

fx := &binance.Binance{}
fx := &binance.Exchange{}
fx.Name = testExchange
err = port.SetCurrencySettingsMap(&exchange.Settings{Exchange: fx, Asset: a, Pair: cp})
assert.NoError(t, err)

f, err := funding.SetupFundingManager(&engine.ExchangeManager{}, false, true, false)
assert.NoError(t, err)

b, err := funding.CreateItem(ex, a, cp.Base, decimal.Zero, decimal.Zero)
b, err := funding.CreateItem(e, a, cp.Base, decimal.Zero, decimal.Zero)
assert.NoError(t, err)

quote, err := funding.CreateItem(ex, a, cp.Quote, decimal.NewFromInt(1337), decimal.Zero)
quote, err := funding.CreateItem(e, a, cp.Quote, decimal.NewFromInt(1337), decimal.Zero)
assert.NoError(t, err)

pair, err := funding.CreatePair(b, quote)
Expand All @@ -467,7 +467,7 @@ func TestFullCycle(t *testing.T) {
bt.DataHolder = data.NewHandlerHolder()
k := &kline.DataFromKline{
Item: &gctkline.Item{
Exchange: ex,
Exchange: e,
Pair: cp,
Asset: a,
Interval: gctkline.FifteenMin,
Expand Down Expand Up @@ -502,7 +502,7 @@ func TestFullCycle(t *testing.T) {
err = k.Load()
assert.NoError(t, err)

err = bt.DataHolder.SetDataForCurrency(ex, a, cp, k)
err = bt.DataHolder.SetDataForCurrency(e, a, cp, k)
assert.NoError(t, err)

bt.MetaData.DateLoaded = time.Now()
Expand Down Expand Up @@ -536,7 +536,7 @@ func TestStop(t *testing.T) {

func TestFullCycleMulti(t *testing.T) {
t.Parallel()
ex := testExchange
e := testExchange
cp := currency.NewBTCUSDT()
a := asset.Spot
tt := time.Now()
Expand All @@ -550,16 +550,16 @@ func TestFullCycleMulti(t *testing.T) {
}, &risk.Risk{}, decimal.Zero)
assert.NoError(t, err)

err = port.SetCurrencySettingsMap(&exchange.Settings{Exchange: &binance.Binance{}, Asset: a, Pair: cp})
err = port.SetCurrencySettingsMap(&exchange.Settings{Exchange: &binance.Exchange{}, Asset: a, Pair: cp})
assert.NoError(t, err)

f, err := funding.SetupFundingManager(&engine.ExchangeManager{}, false, true, false)
assert.NoError(t, err)

b, err := funding.CreateItem(ex, a, cp.Base, decimal.Zero, decimal.Zero)
b, err := funding.CreateItem(e, a, cp.Base, decimal.Zero, decimal.Zero)
assert.NoError(t, err)

quote, err := funding.CreateItem(ex, a, cp.Quote, decimal.NewFromInt(1337), decimal.Zero)
quote, err := funding.CreateItem(e, a, cp.Quote, decimal.NewFromInt(1337), decimal.Zero)
assert.NoError(t, err)

pair, err := funding.CreatePair(b, quote)
Expand All @@ -586,7 +586,7 @@ func TestFullCycleMulti(t *testing.T) {
bt.DataHolder = data.NewHandlerHolder()
k := &kline.DataFromKline{
Item: &gctkline.Item{
Exchange: ex,
Exchange: e,
Pair: cp,
Asset: a,
Interval: gctkline.FifteenMin,
Expand Down Expand Up @@ -621,7 +621,7 @@ func TestFullCycleMulti(t *testing.T) {
err = k.Load()
assert.NoError(t, err)

err = bt.DataHolder.SetDataForCurrency(ex, a, cp, k)
err = bt.DataHolder.SetDataForCurrency(e, a, cp, k)
assert.NoError(t, err)

err = bt.Run()
Expand Down Expand Up @@ -762,7 +762,7 @@ func TestUpdateStatsForDataEvent(t *testing.T) {
require.NoError(t, err, "CreateCollateral must not error")

bt.Funding = f
exch := &binance.Binance{}
exch := &binance.Exchange{}
exch.Name = testExchange
ev.Time = time.Now()
fl := &fill.Fill{
Expand Down Expand Up @@ -831,7 +831,7 @@ func TestProcessSignalEvent(t *testing.T) {
require.NoError(t, err, "CreateCollateral must not error")

bt.Funding = f
exch := &binance.Binance{}
exch := &binance.Exchange{}
exch.Name = testExchange
bt.Exchange.SetExchangeAssetCurrencySettings(a, cp, &exchange.Settings{
Exchange: exch,
Expand Down Expand Up @@ -889,7 +889,7 @@ func TestProcessOrderEvent(t *testing.T) {
require.NoError(t, err, "CreateCollateral must not error")

bt.Funding = f
exch := &binance.Binance{}
exch := &binance.Exchange{}
exch.Name = testExchange
err = pt.SetCurrencySettingsMap(&exchange.Settings{
Exchange: exch,
Expand Down Expand Up @@ -1204,7 +1204,7 @@ func TestCloseAllPositions(t *testing.T) {
dc.funding = bt.Funding
cp := currency.NewBTCUSD()
dc.sourcesToCheck = append(dc.sourcesToCheck, &liveDataSourceDataHandler{
exchange: &binance.Binance{},
exchange: &binance.Exchange{},
exchangeName: testExchange,
asset: asset.Spot,
pair: cp,
Expand Down Expand Up @@ -1285,7 +1285,7 @@ func TestRunLive(t *testing.T) {
}
// AppendDataSource(exchange gctexchange.IBotExchange, interval gctkline.Interval, asset asset.Asset, pair, underlyingPair currency.Pair, dataType int64) error
setup := &liveDataSourceSetup{
exchange: &binance.Binance{},
exchange: &binance.Exchange{},
interval: i.Interval,
asset: i.Asset,
pair: i.Pair,
Expand Down Expand Up @@ -1373,7 +1373,7 @@ func TestSetExchangeCredentials(t *testing.T) {
assert.ErrorIs(t, err, gctcommon.ErrNilPointer)

cfg := &config.Config{}
f := &binanceus.Binanceus{}
f := &binanceus.Exchange{}
f.SetDefaults()
b := f.GetBase()
err = setExchangeCredentials(cfg, b)
Expand Down Expand Up @@ -1416,7 +1416,7 @@ func TestGetFees(t *testing.T) {
_, _, err := getFees(t.Context(), nil, currency.EMPTYPAIR)
assert.ErrorIs(t, err, gctcommon.ErrNilPointer)

f := &binance.Binance{}
f := &binance.Exchange{}
f.SetDefaults()
_, _, err = getFees(t.Context(), f, currency.EMPTYPAIR)
assert.ErrorIs(t, err, currency.ErrCurrencyPairEmpty)
Expand Down
8 changes: 4 additions & 4 deletions backtester/engine/live_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func TestAppendDataSource(t *testing.T) {
err = dataHandler.AppendDataSource(setup)
assert.ErrorIs(t, err, gctcommon.ErrNilPointer)

setup.exchange = &binance.Binance{}
setup.exchange = &binance.Exchange{}
err = dataHandler.AppendDataSource(setup)
assert.ErrorIs(t, err, common.ErrInvalidDataType)

Expand Down Expand Up @@ -264,7 +264,7 @@ func TestFetchLatestData(t *testing.T) {
_, err = dataHandler.FetchLatestData()
require.NoError(t, err)
cp := currency.NewBTCUSDT()
f := &binanceus.Binanceus{}
f := &binanceus.Exchange{}
f.SetDefaults()
fb := f.GetBase()
require.NoError(t, fb.CurrencyPairs.SetAssetEnabled(asset.Spot, true), "SetAssetEnabled must not error")
Expand Down Expand Up @@ -322,7 +322,7 @@ func TestLoadCandleData(t *testing.T) {
_, err := l.loadCandleData(time.Now())
assert.ErrorIs(t, err, gctcommon.ErrNilPointer)

exch := &binanceus.Binanceus{}
exch := &binanceus.Exchange{}
exch.SetDefaults()
cp := currency.NewBTCUSDT().Format(
currency.PairFormat{
Expand Down Expand Up @@ -367,7 +367,7 @@ func TestSetDataForClosingAllPositions(t *testing.T) {

dataHandler.started = 1
cp := currency.NewBTCUSDT()
f := &binanceus.Binanceus{}
f := &binanceus.Exchange{}
f.SetDefaults()
fb := f.GetBase()
err := fb.CurrencyPairs.StorePairs(asset.Spot, currency.Pairs{cp}, true)
Expand Down
6 changes: 3 additions & 3 deletions backtester/eventhandlers/exchange/exchange_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func TestSetCurrency(t *testing.T) {
if len(e.CurrencySettings) != 0 {
t.Error("expected 0")
}
f := &binance.Binance{}
f := &binance.Exchange{}
f.Name = testExchange
cs := &Settings{
Exchange: f,
Expand Down Expand Up @@ -240,7 +240,7 @@ func TestExecuteOrder(t *testing.T) {
require.NoError(t, exchB.CurrencyPairs.SetAssetEnabled(a, true), "SetAssetEnabled must not error")
_, err = exch.UpdateOrderbook(t.Context(), p, a)
require.NoError(t, err, "UpdateOrderbook must not error")
f := &binanceus.Binanceus{}
f := &binanceus.Exchange{}
f.Name = testExchange
cs := Settings{
Exchange: f,
Expand Down Expand Up @@ -359,7 +359,7 @@ func TestExecuteOrderBuySellSizeLimit(t *testing.T) {
limits, err := exch.GetOrderExecutionLimits(a, p)
require.NoError(t, err, "GetOrderExecutionLimits must not error")

f := &btcmarkets.BTCMarkets{}
f := &btcmarkets.Exchange{}
f.Name = testExchange
cs := Settings{
Exchange: f,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestRandomSlippage(t *testing.T) {

func TestCalculateSlippageByOrderbook(t *testing.T) {
t.Parallel()
b := bitstamp.Bitstamp{}
b := bitstamp.Exchange{}
b.SetDefaults()

cp := currency.NewBTCUSD()
Expand Down
Loading
Loading