Support backteating with two different timeframes #248
-
I would like to run backteating for BTCUSDT pair 1h timeframe but then simulate exchange behavior using 1s timeframe to have more realistic analys. Is it possible to do using existing code or it is a new feature? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @ramilexe, I never tested with 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 |
Beta Was this translation helpful? Give feedback.
-
Thank you, does the order of |
Beta Was this translation helpful? Give feedback.
-
I think it will not affect the trading results. |
Beta Was this translation helpful? Give feedback.
Hi @ramilexe, I never tested with
1s
timeframe. But it works fine with1m
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:
And in your strategy you have to specify a timeframe bigger than the dataset, e.g.: 1h