Data Browser and Security Prices

While inspecting a strategy in the Data Browser I've discovered a number of instances where the purchase or sale price of a security is much different than the price range during that day. The price is also considerably different than my "slippage" or "commissions" logic would indicate.

For example, the strategy purchased symbol "BRS" on Jan. 3rd, 2014 at a price of $74.63/share. On 1/3/14 the Open = $68.30, High = $69.43, Low = $68.12, Close = $68.68. The next trading day was Jan. 6th and the Open = $68.80, High = $69.62, Low = $68/25, Close = $69.35.

There are a number of tickers where the Purchase or Sale price is significantly different than the price range of the day of the purchase.

My Commissions and Slippage code is as follows:

     algo.set_commission(
        us_equities=commission.PerShare(
            cost=0.005,
            min_trade_cost=2.0,
        )
    )
    
    algo.set_slippage(
        us_equities=slippage.VolumeShareSlippage(
            volume_limit=0.0025, 
            price_impact=0.1, 

Is there a bug in Zipline or is my code incorrect?

Thanks.

The transaction price you see is the as-traded price on that day (minus the slippage and commissions you specify). The price you see in the Data Browser is the fully split- and dividend-adjusted price as of today. So they are not expected to match if the stock subsequently had splits or dividends.

For more on how Zipline handles adjustments, see the Adjustments section in this part of the usage guide.

1 Like

Brian, I appreciate the explanation but another question so I'm crystal clear. In the Data Browser it shows the Price Chart and then the table below shows the Transaction prices. The Transaction price is the as-traded price on that day (minus slippage and commissions specified) but the price in the chart above where holding periods are highlighted is fully split and dividend adjusted? Please confirm. Thanks again.

Correct.

1 Like