Backtester: custom interval support (#1115)

* add backtester support

* Prevent live data custom candles, prevent nanosecond candles

* test coverage

* a more interesting rsi strategy result

* actual custom candle and proper strat date

* add test to old funk

* typos 🌞 🌞

* this was definitely worth failing linting for

* Adds stricter processing and adapts to it

* now compat with partial and absent candles

* test fixes, zb fixes

* fix more introduced bugeroos

* fix more introduced bugeroosx2

* linting for one space is so annoying

* addresseroos niteroos

* Update backtester/engine/setup.go

Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>

Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
This commit is contained in:
Scott
2023-01-24 16:05:46 +11:00
committed by GitHub
parent a12262ba2c
commit 03a24b3ab1
45 changed files with 450 additions and 312 deletions

View File

@@ -1307,8 +1307,8 @@ func TestGetOrders(t *testing.T) {
StartDate: time.Now().UTC().Add(time.Second).Format(common.SimpleTimeFormatWithTimezone),
EndDate: time.Now().UTC().Add(-time.Hour).Format(common.SimpleTimeFormatWithTimezone),
})
if !errors.Is(err, common.ErrStartAfterTimeNow) {
t.Errorf("received %v, expected %v", err, common.ErrStartAfterTimeNow)
if !errors.Is(err, common.ErrStartAfterEnd) {
t.Errorf("received %v, expected %v", err, common.ErrStartAfterEnd)
}
_, err = s.GetOrders(context.Background(), &gctrpc.GetOrdersRequest{
@@ -1803,8 +1803,8 @@ func TestGetDataHistoryJobsBetween(t *testing.T) {
StartDate: time.Now().UTC().Add(time.Minute).Format(common.SimpleTimeFormatWithTimezone),
EndDate: time.Now().UTC().Format(common.SimpleTimeFormatWithTimezone),
})
if !errors.Is(err, common.ErrStartAfterTimeNow) {
t.Fatalf("received %v, expected %v", err, common.ErrStartAfterTimeNow)
if !errors.Is(err, common.ErrStartAfterEnd) {
t.Fatalf("received %v, expected %v", err, common.ErrStartAfterEnd)
}
err = m.UpsertJob(dhj, false)