I plan to do local backtest with LEAN on Taiwan stocks. Taiwan Stock Exchange has a price limit of 10%. That is, if a stock closed at 100 dollars Monday, the highest and lowest prices it can be traded at on Tuesday are 110 and 90 dollars, respectively.

When doing backtests, the price limit raises a problem about stocks' liquidities. In many real cases, stocks were traded at the down limit price all day long. Many selling orders queued up to sell, while almost nobody wanted to buy. In reality almost none of the selling orders would be filled. But LEAN's fill model would still fill selling orders when backtesting these situations.

I came up with two ideas to solve this problem:

1. To implement a new class EquityWithPriceLimitFillModel, which inherits the EquityFillModel, and with all the XxxxFill() methods taking the price limit into consideration.

2. To generate QuoteBars for the historical prices instead of TradeBars. For example, during the "down limit days", The open/high/low/close price of the Ask bar were all set at the down limit price, while those of the Bid bar were all set at 0 (or any other price lower than the down limit price), meaning there's nobody wanted to buy, so the selling order would not be filled. In this way I don't have to implement a fill model, so this looked easier than Idea 1.

Anybody experienced in this problem? Any opinion is welcomed!