Back to Community
Bad volatility ETP Data?

I'm concerned the data for XIV, UVXY and TVIX is not correct. From what I see in the attached backtest, the values are frequently at levels never actually seen. Am I missing something or is the data adjusted and compensated for large values (in the case of UVXY and TVIX) in the past?

Since vol strategies seem popular around here, I can't imagine this hasn't been noticed before, so what I am not considering? The price seems to not correlate with the values I find elsewhere.

In the backtest, I've plotted the values for XIV, UVXY and TVIX and just moving the mouse over the history you can see the values don't make sense; assuming you are familiar with the products.

Clone Algorithm
4
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
def initialize(context):
    """
    Called once at the start of the algorithm.
       
    """   
    
    context.stocks = symbols('TVIX', 'UVXY', 'XIV')
    context.allocation = [0, 0, 0, 0, 0.0] 
       

    schedule_function(rebalance,date_rules.every_day(),time_rules.market_open(minutes=30))
   
    
def rebalance(context,data):
    
#        order_target_percent(context.stocks[idx], context.allocation[idx]) 
        record(price1 = data.current(context.stocks[0], 'price'),
            price2 = data.current(context.stocks[1], 'price'),
            price3 = data.current(context.stocks[2], 'price'))  
        
def my_record_vars(context, data):
    """
    Plot variables at the end of each day.
    """
    pass
 
def handle_data(context,data):
    """
    Called every minute.
    """
    pass
There was a runtime error.
3 responses

Data is only back-adjusted up to that point in time in the simulation. It is not back-adjusted considering splits in the "future" of that time point. This means that from one day to the next, the results of data.history may change, but will always be identical to what you would have gotten had you been live-trading through that entire period.

I compared the UVXY series (price2) to a series of "as-traded" prices that I have from Norgate. The overall shape is correct (big jumps are the reverse splits), but the older prices are a bit off. The highst point, 2/5/14, shows as 102.61 above, whereas Norgate shows 102.83. I happen to also have a NxCore tape from that date, and it confirms that 102.83 was the official close. The last trade prior to 16:00:00 was at 103.20. If Quantopian's supplier for 1-min historical bars is giving them adjusted price data and the "as-traded" prices come from repeatedly dividing for each reverse split, it's possible that these discrepancies could be caused by rounding error.

After going back through the data more carefully, I can see the issue was with my understanding of how splits are handled.

I understand now and the data is OK.