class_docstr: Prices forwards for odd dates which are not quoted using linear interpolation,
  eg. if we have forward points for 1W and 1M, and spot date but we want to price a 3W forward, or any arbitrary horizon
  date that lies in that interval
  
  Also calculates the implied deposit rate from FX spot, FX forward points and deposit rate.
class_docstr_tok: ["Prices","forwards","for","odd","dates","which","are","not","quoted","using","linear","interpolation",",","eg",".","if","we","have","forward","points","for","1W","and","1M",",","and","spot","date","but","we","want","to","price","a","3W","forward",",","or","any","arbitrary","horizon","date","that","lies","in","that","interval","Also","calculates","the","implied","deposit","rate","from","FX","spot",",","FX","forward","points","and","deposit","rate","."]
docstr: Creates an interpolated outright FX forward (and the associated points), for horizon dates/delivery dates
  given by the user from FX spot rates and FX forward points. This can be useful when we have an odd/broken date
  which isn't quoted.
  
  Uses linear interpolation between quoted dates to calculate the appropriate interpolated forward. Eg. if we
  ask for a delivery date in between 1W and 1M, we will interpolate between those.
  
  Parameters
  ----------
  cross : str
      Currency pair
  
  horizon_date : DateTimeIndex
      Horizon dates for forward contracts
  
  delivery_date : DateTimeIndex
      Delivery dates for forward contracts
  
  market_df : DataFrame
      Contains FX spot and FX forward points data
  
  quoted_delivery_df : DataFrame (DateTimeIndex)
      Delivery dates for every quoted forward point
  
  fx_forwards_tenor_for_interpolation : str(list)
      Which forwards to use for interpolation
  
  Returns
  -------
  DataFrame
docstr_tok: ["Creates","an","interpolated","outright","FX","forward","(","and","the","associated","points",")",",","for","horizon","dates\/delivery","dates","given","by","the","user","from","FX","spot","rates","and","FX","forward","points",".","This","can","be","useful","when","we","have","an","odd\/broken","date","which","is","n't","quoted",".","Uses","linear","interpolation","between","quoted","dates","to","calculate","the","appropriate","interpolated","forward",".","Eg",".","if","we","ask","for","a","delivery","date","in","between","1W","and","1M",",","we","will","interpolate","between","those",".","Parameters","--","--","--","--","--","cross",":","str","Currency","pair","horizon_date",":","DateTimeIndex","Horizon","dates","for","forward","contracts","delivery_date",":","DateTimeIndex","Delivery","dates","for","forward","contracts","market_df",":","DataFrame","Contains","FX","spot","and","FX","forward","points","data","quoted_delivery_df",":","DataFrame","(","DateTimeIndex",")","Delivery","dates","for","every","quoted","forward","point","fx_forwards_tenor_for_interpolation",":","str","(","list",")","Which","forwards","to","use","for","interpolation","Returns","--","--","--","-","DataFrame"]
code: def price_instrument(
      self,
      cross,
      horizon_date,
      delivery_date,
      option_expiry_date=None,
      market_df=None,
      quoted_delivery_df=None,
      fx_forwards_tenor_for_interpolation=market_constants.fx_forwards_tenor_for_interpolation,
      return_as_df=True,
  ):
      """Creates an interpolated outright FX forward (and the associated points), for horizon dates/delivery dates
      given by the user from FX spot rates and FX forward points. This can be useful when we have an odd/broken date
      which isn't quoted.
  
      Uses linear interpolation between quoted dates to calculate the appropriate interpolated forward. Eg. if we
      ask for a delivery date in between 1W and 1M, we will interpolate between those.
  
      Parameters
      ----------
      cross : str
          Currency pair
  
      horizon_date : DateTimeIndex
          Horizon dates for forward contracts
  
      delivery_date : DateTimeIndex
          Delivery dates for forward contracts
  
      market_df : DataFrame
          Contains FX spot and FX forward points data
  
      quoted_delivery_df : DataFrame (DateTimeIndex)
          Delivery dates for every quoted forward point
  
      fx_forwards_tenor_for_interpolation : str(list)
          Which forwards to use for interpolation
  
      Returns
      -------
      DataFrame
      """
  
      if market_df is None:
          market_df = self._market_df
      if quoted_delivery_df is None:
          quoted_delivery_df = self._quoted_delivery_df
  
      if quoted_delivery_df is None:
          quoted_delivery_df = self.generate_quoted_delivery(
              cross,
              market_df,
              quoted_delivery_df,
              fx_forwards_tenor_for_interpolation,
              cross,
          )
  
      # Make horizon date and delivery date pandas DatetimeIndex
      if isinstance(horizon_date, pd.Timestamp):
          horizon_date = pd.DatetimeIndex([horizon_date])
          delivery_date = pd.DatetimeIndex([delivery_date])
      else:
          horizon_date = pd.DatetimeIndex(horizon_date)
          delivery_date = pd.DatetimeIndex(delivery_date)
  
      # Truncate the market data so covers only the dates where we want to price the forwards
      market_df = market_df[market_df.index.isin(horizon_date)]
      quoted_delivery_df = quoted_delivery_df[
          quoted_delivery_df.index.isin(horizon_date)
      ]
  
      cal = cross
  
      # Get the spot date (different currency pairs have different conventions for this!)
      spot_date = self._calendar.get_spot_date_from_horizon_date(
          horizon_date, cal
      )
  
      # How many days between spot date (typically T+1 or T+2) and delivery date
      spot_delivery_days_arr = (delivery_date - spot_date).days
  
      spot_arr = market_df[cross + ".close"].values
  
      (
          quoted_delivery_df,
          quoted_delivery_days_arr,
          forwards_points_arr,
          divisor,
      ) = self._setup_forwards_calculation(
          cross,
          spot_date,
          market_df,
          quoted_delivery_df,
          fx_forwards_tenor_for_interpolation,
      )
  
      interpolated_outright_forwards_arr = _forwards_interpolate_numba(
          spot_arr,
          spot_delivery_days_arr,
          quoted_delivery_days_arr,
          forwards_points_arr,
          len(fx_forwards_tenor_for_interpolation),
      )
  
      if return_as_df:
          interpolated_df = pd.DataFrame(
              index=market_df.index,
              columns=[
                  cross + "-interpolated-outright-forward.close",
                  cross + "-interpolated-forward-points.close",
              ],
          )
  
          interpolated_df[
              cross + "-interpolated-outright-forward.close"
          ] = interpolated_outright_forwards_arr
          interpolated_df[
              cross + "-interpolated-forward-points.close"
          ] = (interpolated_outright_forwards_arr - spot_arr) * divisor
  
          return interpolated_df
  
      return interpolated_outright_forwards_arr
  
file_path: finmarketpy/finmarketpy/curve/rates/fxforwardspricer.py
imports: import numpy
  import pandas
  from numba import guvectorize
  from findatapy.timeseries import Calendar
  from finmarketpy.util.marketconstants import MarketConstants
  from finmarketpy.curve.abstractpricer import AbstractPricer
label_desc: Use image node_id 2 for calling the FXForwardsPricer obj's underlying member method code with example usage: obj.price_instrument(cross, horizon_date, delivery_date, option_expiry_date, market_df, quoted_delivery_df, fx_forwards_tenor_for_interpolation, return_as_df) and returns: interpolated_outright_forwards_arr, interpolated_df