# -*- coding: utf-8 -*-
"""
Created on Wed Sep 16 21:17:34 2015

@author: ka
"""

class Options:
    
    def __init__(self, code='Options', entityType='Options',
                 optionType='European', callOrPut='call', 
                 buyOrSell = '', quantity = 0,
                 premium=12.8216, strike=100., volatility=0.3, expiryDays=365,  
                 value = 0., delta = 0., gamma = 0., vega = 0., theta = 0., rho = 0.,
                 impliedVolatility=0.):
        self.code = code
        self.entityType = 'Options'
        
        self.buyOrSell = buyOrSell
        self.quantity = int(quantity)
        
        self.premium = float(premium)
        self.impliedVolatility = float(impliedVolatility)

        self.optionType = optionType
        self.callOrPut = callOrPut
        self.strike = float(strike)
        self.volatility = float(volatility)
        self.expiryDays = int(expiryDays)

        self.value = float(value)
        self.delta = float(delta)
        self.gamma = float(gamma)
        self.vega = float(vega)
        self.theta = float(theta)
        self.rho = float(rho)
        
    def serialize(self):
        return {
                "code": self.code,
                "entityType": self.entityType,
                "buyOrSell": self.buyOrSell,
                "quantity": self.quantity,
                "premium": self.premium,
                "impliedVolatility": self.impliedVolatility,
                "optionType": self.optionType,
                "callOrPut": self.callOrPut,
                "strike": self.strike,
                "volatility": self.volatility,
                "expiryDays": self.expiryDays,
                "value": self.value,
                "delta": self.delta,
                "gamma": self.gamma,
                "vega": self.vega,
                "theta": self.theta,
                "rho": self.rho,
                }