Skip to content

Commit

Permalink
Fixed ON FX expiry
Browse files Browse the repository at this point in the history
  • Loading branch information
saeedamen committed Jan 16, 2021
1 parent 12b2e7b commit a17606e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ individual data providers)

# Coding log

* 14 Jan 2021
* Fixed ON FX option date expiry
* 10 Jan 2021
* Added Dukascopy non-equities example
* 08 Jan 2021
Expand Down
3 changes: 2 additions & 1 deletion findatapy/market/market.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,9 +659,10 @@ def get_fx_implied_vol(self, start, end, cross, tenor, cut="BGN", data_source="b

# Create very naive average of LDN and TOK to estimate 10am NY value because we often don't have this data
# Note, this isn't perfect, particularly on days where you have payrolls data, and we're looking at ON data
# You might choose to create your own approximation for 10am NY
for col in old_cols:
data_frame[col] = (1 * data_frame[col + "LDN"] + 3 * data_frame[col + "TOK"]) / 4

# data_frame[col] = data_frame[col + "LDN"]
data_frame.pop(col + "LDN")
data_frame.pop(col + "TOK")

Expand Down
4 changes: 2 additions & 2 deletions findatapy/timeseries/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _get_full_cal(self, cal):
bday = CustomBusinessDay(weekmask='Sat Sun')

holidays_list.append([x for x in pd.date_range('01 Jan 1999', '31 Dec 2025', freq=bday)])
elif cal == 'NOH': #
elif cal == 'WKD': #
pass
# holidays_list.append()

Expand Down Expand Up @@ -279,7 +279,7 @@ def get_expiry_date_from_horizon_date(self, horizon_date, tenor, cal=None, asset
asset_holidays = self.get_holidays(cal=cal)

if tenor_unit == 'ON':
tenor_digit = 1
tenor_digit = 1; tenor_unit = 'D'
else:
tenor_digit = int(''.join(re.compile(r'\d+') .findall(tenor)))

Expand Down
2 changes: 1 addition & 1 deletion findatapy_examples/dukascopy_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# run_example = 1 - download EURUSD free tick data from DukasCopy example
# run_example = 2 - download S&P500 free tick data from DukasCopy example

run_example = 2
run_example = 0

if run_example == 1 or run_example == 0:

Expand Down

0 comments on commit a17606e

Please sign in to comment.