Skip to content

Support backteating with two different timeframes #248

Answered by rodrigo-brito
ramilexe asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @ramilexe, I never tested with 1s timeframe. But it works fine with 1m and above. I believe that Binance do not provide the 1s timeframe data feed to download. Because the real time feed is updated each 2s.

To use this feature, you have to load a small time frame in the backtest, example:

	csvFeed, err := exchange.NewCSVFeed(
		strategy.Timeframe(),
		exchange.PairFeed{
			Pair:      "BTCUSDT",
			File:      "testdata/btc-1m.csv",
			Timeframe: "1m",
		},
		exchange.PairFeed{
			Pair:      "ETHUSDT",
			File:      "testdata/eth-1m.csv",
			Timeframe: "1h",
		},
	)

And in your strategy you have to specify a timeframe bigger than the dataset, e.g.: 1h

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by rodrigo-brito
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #247 on April 01, 2023 13:39.