pythonpyalgotrade

how to work around yahoo data issue? Not enough volume to fill


I am working on a MACD strategy backtest, and sometimes I came across this warning:

2015-02-19 00:00:00 broker.backtesting [DEBUG] Not enough volume to fill 1988.HK market order [1] for 55258 share/s

Then I checked the csv data source and found:
Date        Open    High    Low Close   Volume  Adj Close
19/02/2015  9.06    9.06    9.06    9.06    0   8.59591

as you can see, the volume on that particular day was 0, so the order cannot be filled.

I am not going to hack the pyalgotrade framework, so is there anyway to work around this? e.g. pre-process the data from yahoo feed and set the volume to what I want. Thanks.


Solution

  • Try this in the strategy constructor:

    self.getBroker().getFillStrategy().setVolumeLimit(None)