MCPcopy
hub / github.com/thrasher-corp/gocryptotrader / dataHistoryTraderLoader

Function dataHistoryTraderLoader

engine/datahistory_manager_test.go:1469–1489  ·  view source on GitHub ↗
(exch, a, base, quote string, start, _ time.Time)

Source from the content-addressed store, hash-verified

1467}
1468
1469func dataHistoryTraderLoader(exch, a, base, quote string, start, _ time.Time) ([]trade.Data, error) {
1470 cp, err := currency.NewPairFromStrings(base, quote)
1471 if err != nil {
1472 return nil, err
1473 }
1474 ai, err := asset.New(a)
1475 if err != nil {
1476 return nil, err
1477 }
1478 return []trade.Data{
1479 {
1480 Exchange: exch,
1481 CurrencyPair: cp,
1482 AssetType: ai,
1483 Side: order.Buy,
1484 Price: 1337,
1485 Amount: 1337,
1486 Timestamp: start,
1487 },
1488 }, nil
1489}
1490
1491func dataHistoryCandleLoader(exch string, cp currency.Pair, a asset.Item, interval kline.Interval, start, end time.Time) (*kline.Item, error) {
1492 start = start.Truncate(interval.Duration())

Callers

nothing calls this directly

Calls 2

NewPairFromStringsFunction · 0.92
NewFunction · 0.92

Tested by

no test coverage detected