Hi all,
I believe there is something messed up with the TVIZ historical data. When running the below code, my algo sells 70% of my initial cash on day 1. Whereas if I change this to TVIX, it sells just 10%(as it should). Am I missing something here? Thanks for the help!
def initialize(context):
context.stock = sid(40514)
def handle_data(context, data):
stock = context.stock
current_price = data.current(context.stock, 'price')
equity = (context.portfolio.cash + context.portfolio.positions_value)
TVIX_Amount = context.portfolio.positions[symbol('TVIZ')].amount*current_price
if context.portfolio.positions[symbol('TVIZ')].amount == 0:
order_target_value(stock, -.1*equity)