Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Preroll does not precompute indicators that reference own past values #2340

Closed
jorisw opened this issue Aug 16, 2020 · 1 comment
Closed

Comments

@jorisw
Copy link
Contributor

jorisw commented Aug 16, 2020

System information

  • Have I written custom code (as opposed to using zenbot vanilla):
    Yes, lots of it
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
    macOS 10.15.6 and Ubuntu 18.04
  • Zenbot version (commit ref, or version):
    7fb7113
  • Zenbot branch:
    unstable
  • NodeJS version:
    v14.1.0
  • Exact command to reproduce (include everything):
zenbot trade \
            --paper \
            --silent \
            --disable_stats \
            --filename none \
            --period 1s \
            --keep_lookback_periods 100 \
            --poll_trades 1000 \
            --order_poll_time 5000 \
            --manual \
            --non_interactive \
            --order_type taker \
            --min_periods 86400 \
            --currency_capital 1000 \
            --asset_capital 10 \
            --reset_profit \
            --selector binance.BTC-USDT \
            --quarentine_time 0  
  • Did I make any changes to conf-sample.js?:
    No.

Describe the problem

Certain types of indicators require their own historical values from lookback in order to work. One such indicator is Stochastic RSI. This indicator requires its own values from the past in order to calculate new values. Specifically, while %K can be calculated immediately based on lookback price development, %D and %SlowD need past %K values in order to be calculated.

In practice, this means that indicators like these, do not benefit from the preroll that zenbot trade performs. What needs to be added, is that the indicators used by the strategy, are calculated during preroll. I don't quite know how to add this, but I think what needs to happen is that onPeriod() is called during preroll.

Welcome any thoughts on fixing this, so I can fix it.

@jorisw jorisw closed this as completed Aug 16, 2020
@jorisw
Copy link
Contributor Author

jorisw commented Aug 16, 2020

Nevermind this. I realize now that I'm meant to use strategy.calculate() to update the indicators. We're doing this in onPeriod because of the large amount of indicators we're using.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant