You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now we have only cache 1m bar in redis, and to get unclosed bars of 1w, we have to:
fetch week bars from persistent db
fetch day bars from persistent db for unclosed week
fetch 1m bars for today, and resample it into day bars
resample all these day bars into unclosed week bar
concatenate closed week bars with unclosed week bar
The whole process is tedious and not performant. If we have cached all 5m, 15m, 30m, 60m, 1d, 1w, 1M bars in redis, the performance will be much better.
To do this, we need to develop a lua script:
called every time upon arrival of 1m bars
update latest 5m (and others) bars by merging existed bar and latest 1m bar
start new entry for frames in (5m, 15m, 30m, 60m) at the begin of each frame type (could be parameter passed through by python)
clear cache after calibration, re-calc unclosed bar of week/month frame using latest closed day bars (python)
clear cached bars for week/month after this frame is closed, after calibration time.
The text was updated successfully, but these errors were encountered:
1. add lua script and wrappers under scripts
2. load_lua_script during app.init
3. rebuild unclosed bars during app.init
4. realtime calc unclosed bars after 1m bars is fetched and cached
Now we have only cache 1m bar in redis, and to get unclosed bars of 1w, we have to:
The whole process is tedious and not performant. If we have cached all 5m, 15m, 30m, 60m, 1d, 1w, 1M bars in redis, the performance will be much better.
To do this, we need to develop a lua script:
The text was updated successfully, but these errors were encountered: