Exemplo n.º 1
0
	def quote_for_days_before(self, days_before):
		""" Finds the nearest quote to the days out delta provided for this maturity. """

		date_looking_for = self._expiration_date - datetime.timedelta(days_before, 0, 0)
		target_quote = utility.find_nearest_of(date_looking_for, self._quotes, lambda x: x.quote_date())
		return target_quote
Exemplo n.º 2
0
	def put_near(self, strike):
		""" Returns the put closest to the passed in strike price """
		return utility.find_nearest_of(strike, self.puts, OptionsDay.strike, take_average_quote) 
Exemplo n.º 3
0
	def nearest(self, date):
		return utility.find_nearest_of(date, self.vixdays, lambda x: x.date)
	def nearest(self, date):
		if date not in self._cache:
			self._cache[date] = utility.find_nearest_of(date, self.vixdays, lambda x: x.date)
		return self._cache[date]
Exemplo n.º 5
0
 def nearest(self, date):
     if date not in self._cache:
         self._cache[date] = utility.find_nearest_of(
             date, self.vixdays, lambda x: x.date)
     return self._cache[date]