-
Notifications
You must be signed in to change notification settings - Fork 2k
backtest simulation behaviour #43
Comments
interesting, I'll investigate. but worth noting I changed check_period to 5m and the ROI jumped up. experimented with other check_periods but that was the best one by far. Also changed the reporting period in the sim to 1h, to speed up the sim. |
just a matter of luck because on that particular data the trades at hh:05:00 are more favorable than those at hh:01:00... |
@skunk73 I probably won't be able to fix this until tomorrow. If you have any leads on what's wrong in the code, or how to fix it, that would help! |
it seems you're using hourly ticks to run the simulation instead of 1m, 5m or whatever the value of check_periods is... |
It only appears that way because the reporter (in verbose sim mode) only reports on 1h ticks (to throttle output), but the trade logic functions are fed all reducer tick sizes (1m, 5m, 15m, 1h, 6h, 1d). you can verify this with the patch diff --git a/default_logic.js b/default_logic.js
index 121b9b7..1b27b75 100644
--- a/default_logic.js
+++ b/default_logic.js
@@ -52,8 +52,8 @@ module.exports = function container (get, set, clear) {
rs.exchange = sMatch[1]
rs.asset = sMatch[2]
rs.currency = sMatch[3]
- if (options.verbose && get('command') === 'run') {
- get('logger').info('trader', c.default_selector.grey, get_tick_str(tick.id), 'running logic'.grey, rs.asset.grey, rs.currency.grey, {feed: 'trader'})
+ if (options.verbose && get('command') === 'sim') {
+ get('logger').info('trader', c.default_selector.grey, get_tick_str(tick.id), 'running logic'.grey, get_timestamp(tick.time), rs.asset.grey, rs.currency.grey, {feed: 'trader'})
}
rs.rsi_period = '1h'
rs.rsi_up = 70
|
Hmm, so I think the simulator is running correctly, but the RSI calculation isn't using proper smoothing and that's what's causing the RSI to spike on the hour. Fixing this might take refactoring the RSI to be a chain-like computation on ticks rather than a single tick reducer function. |
fixed in 3.5.15 |
zenbot trade frequency on simulations is always one every hour at most even with rs.check_period set to 1m (and rs.min_*_wait set to 0), eg:
as you can see trades happens always every hour start + (1m x 1 or 2)...
moreover, if setting rs.check_period to 5m trades still happens every hour start + (5m x 1 or 2):
so the trades are almost identical but shifted to the 5th or the 10th minute...
on the other hand online trades happens (correctly) at any time whenever the conditions are met, eg:
thus backtest simulation results won't reflect the results of the online trader because they'll trade at different timestamps and frequencies...
The text was updated successfully, but these errors were encountered: