Username: Password:

Author Topic: Initialize last prices with chart data on restart, BB directly after bot start?  (Read 17404 times)

Offline OutOfSync

  • Rookie
  • *
  • Posts: 11
    • View Profile
Hey Gunthar,

every time we start the bot again the array of MAX_LATEST_PRICES size is empty and the bot needs a time of "MAX_LATEST_PRICES x BOT_SLEEP_DELAY" (i.e. 300 min @ 60 s delay or 600 min @ 120 s delay) before BB trading is enabled. If the 422 error occurs it gets even longer as no valid LP can be added to the array. I think it would be great to initialize the array when the bot is started with data that can be requested from the exchange (the one used to plot charts, its only public API without access penalty). As far as I know even 5 min candles can be requested on Poloniex - I have not looked at Bittrex and Kraken API but guess its similar. This data could be written to the LP price array and BB can be enabled immediately. Over time the initial chart data gets replaced by the actual data that gunbot acquired.

The chart data would need to be resampled to match the BOT_SLEEP_DELAY, if we for example set this delay to 120 s but only 300 s candles can be downloaded (Poloniex example), every value needs to be repeated on average 2.5x (pattern could be "-AA-BB-AAA-BBB-" or something less regular with some kind of "dithering"). The same for Bittrex where we can run at much higher frequency (e.g. 20 s), in this case the LP array is much larger and the values have to be repeated more often (in the example of 20s delay and 300s candles every value needs to be repeated 15 times).

I think this would be a really great addition and makes frequent restarts or larger reconfigurations possible. Stepgain would probably not benefit so much due to the repeating of the values, the LP array would be very blocky. The effects of this would need to be tested. But for BB (and especially for less crazy delay times in the min-range) it might actually work well...

Keep up the good work, looking forwad to the next ON-IN-ALL update of g-bot!