-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Fix candle history warmup to work when no data has been imported #2112
Conversation
Hmm can you point on what did you change in the file besides comments ? cannot find anything different |
Is outside {} so outside else statement |
The code is moved outside of the else block. This way, it always gets executed, not just in the else case. Without this change, |
Dear, |
@xaviermiss, cherry-pick it on your clone of the repo. If it solves your problem, please report back. Keep commenting or posting about it, here, on related GitHub issues (or even a new one), in the forum, or in discord, in the hopes that someone merges it. |
Hi @jtran , I took the new datasticher.js file. |
@xaviermiss, this fix is for when you don't have local history. Please read the description and steps to reproduce. |
@jtran, the subject of this issue is: The given example is when no data is imported but it never explicitely narrows it to "non imported data". Sorry but it is not clear. I will test on my side with no import. |
I updated the title to be clearer. |
I just tested with no history.
Gekko:
|
point of this patch is to do not import any data and start trading right away. |
I tried to reproduce your error, but it works for me without your commit.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the late reply. The psuedo code for the code you intend to change is:
- pull latest window from DB
- if(!window) { // there is no data }
- else if(window is too old) { // no usable data we can stitch }
- else { // we can use data! Note this fact by registering it in the config }
Only in the last situation do we actually want to work with local data. Which is why the statement right now only resides in the latest "else".
@askmike, the point is not to work with local data. The point is to fetch farther back in time from the exchange. As the long description already explains, this change is specifically for when you have not imported any local data. To see where |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you feel this is very a important issue please reach out the maintainer of this project directly via e-mail: gekko at mvr dot me. |
Bug fix.
Steps to reproduce:
update()
. (No talib or tulip indicators. This has nothing to do with async.)I expect the strategy to log 10 times immediately using recent historical candle data fetched from the exchange. But what actually happens is that it doesn't log immediately. I assume that it takes 10 minutes to log 10 times.
Note: if you've imported data for this exchange/currency/asset, the behavior is different and works in certain cases.
This branch makes it so that you do not need to import data in order to run a strategy live and have it start giving advice immediately. The recent trade/candle history is fetched from the exchange to warm up the strategy.
I tested on GDAX. Not sure if that's relevant.