For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

Broker: Stop Getting Cash and Value During Backfill



  • Hello All

    Is there way to prevent the broker from attempting to call getcash() and getvalue() during a backfill? I.e when self._state = self._ST_HISTORBACK ?

    I guess this might be an illogical thing to ask since we can have multiple feeds and some might be delayed, reconnecting backfilling etc whilst others are live....

    The reason I am asking is because I have been playing around with the CCXT implementation from Mr Bartosh and noticed that Backfilling takes a long time as a rest API call is made to access cash and value before the bar comes in and after.

    So I am trying to think of a way to speed things up a little.

    Cheers!


  • administrators

    The thing is that the internals don't know if you are backfilling or not and go through the entire cycle. The key to support different modes transparently is to not make distinctions as to what the actual nature of the data is.



  • @backtrader

    Sure, I appreciate that thanks.

    So in the end I decided to do something a bit hacky and add a attribute to the CCXT broker that can be overwritten from inside the strategy. I.e When I set it to false, the broker will just return the last cash and value figures that were downloaded. If it is true the broker will make the proper store method call.

    Probably not the best idea but needs must :) I can now warm up the indicators without waiting a lifetime.


  • administrators

    This was discussed in another thread: the broker should not make synchronous calls ...