class_docstr: Constructs continuous forwards time series total return indices from underlying forwards contracts.
  
      
class_docstr_tok: ["Constructs","continuous","forwards","time","series","total","return","indices","from","underlying","forwards","contracts","."]
code: def apply_tc_signals_to_total_return_index(
      self,
      cross_fx,
      total_return_index_orig_df,
      option_tc_bp,
      spot_tc_bp,
      signal_df=None,
      cum_index=None,
  ):
      # TODO signal not implemented yet
      if cum_index is None:
          cum_index = self._cum_index
  
      total_return_index_df_agg = []
  
      if not (isinstance(cross_fx, list)):
          cross_fx = [cross_fx]
  
      option_tc = option_tc_bp / (2 * 100 * 100)
      spot_tc = spot_tc_bp / (2 * 100 * 100)
  
      total_return_index_df = total_return_index_orig_df.copy()
  
      for cross in cross_fx:
          # p = abs(total_return_index_df[cross + '-roll.close'].shift(1)) * option_tc
          # q = abs(total_return_index_df[cross + '-delta.close'] - total_return_index_df[cross + '-delta.close'].shift(1)) * spot_tc
  
          # Additional columns to include P&L with transaction costs
          total_return_index_df[
              cross + "-option-return-with-tc.close"
          ] = (
              total_return_index_df[cross + "-option-return.close"]
              - abs(
                  total_return_index_df[
                      cross + "-new-trade.close"
                  ].shift(1)
              )
              * option_tc
          )
          total_return_index_df[
              cross + "-delta-pnl-return-with-tc.close"
          ] = (
              total_return_index_df[cross + "-delta-pnl-return.close"]
              - abs(
                  total_return_index_df[cross + "-delta.close"]
                  - total_return_index_df[cross + "-delta.close"].shift(
                      1
                  )
              )
              * spot_tc
          )
  
          total_return_index_df[cross + "-option-return-with-tc.close"][
              0
          ] = 0
          total_return_index_df[
              cross + "-delta-pnl-return-with-tc.close"
          ][0] = 0
          total_return_index_df[
              cross + "-option-delta-return-with-tc.close"
          ] = (
              total_return_index_df[
                  cross + "-option-return-with-tc.close"
              ]
              + total_return_index_df[
                  cross + "-delta-pnl-return-with-tc.close"
              ]
          )
  
          if cum_index == "mult":
              cum_rets = 100 * np.cumprod(
                  1.0
                  + total_return_index_df[
                      cross + "-option-return-with-tc.close"
                  ].values
              )
              cum_delta_rets = 100 * np.cumprod(
                  1.0
                  + total_return_index_df[
                      cross + "-delta-pnl-return-with-tc.close"
                  ].values
              )
              cum_option_delta_rets = 100 * np.cumprod(
                  1.0
                  + total_return_index_df[
                      cross + "-option-delta-return-with-tc.close"
                  ].values
              )
  
          elif cum_index == "add":
              cum_rets = 100 + 100 * np.cumsum(
                  total_return_index_df[
                      cross + "-option-return-with-tc.close"
                  ].values
              )
              cum_delta_rets = 100 + 100 * np.cumsum(
                  total_return_index_df[
                      cross + "-delta-pnl-return-with-tc.close"
                  ].values
              )
              cum_option_delta_rets = 100 + 100 * np.cumsum(
                  total_return_index_df[
                      cross + "-option-delta-return-with-tc.close"
                  ].values
              )
  
          total_return_index_df[
              cross + "-option-tot-with-tc.close"
          ] = cum_rets
          total_return_index_df[
              cross + "-delta-pnl-index-with-tc.close"
          ] = cum_delta_rets
          total_return_index_df[
              cross + "-option-delta-tot-with-tc.close"
          ] = cum_option_delta_rets
  
          total_return_index_df_agg.append(total_return_index_df)
  
      return self._calculations.join(
          total_return_index_df_agg, how="outer"
      )
  
file_path: finmarketpy/finmarketpy/curve/fxoptionscurve.py
imports: import numpy
  import pandas
  from pandas.tseries.offsets import CustomBusinessDay, CustomBusinessMonthEnd
  from findatapy.market import Market, MarketDataRequest
  from findatapy.timeseries import Calculations, Calendar, Filter
  from findatapy.util.dataconstants import DataConstants
  from findatapy.util.fxconv import FXConv
  from finmarketpy.curve.volatility.fxoptionspricer import FXOptionsPricer
  from finmarketpy.curve.volatility.fxvolsurface import FXVolSurface
  from finmarketpy.util.marketconstants import MarketConstants
label_desc: Use image node_id 8 for calling the FXOptionsCurve obj's underlying member method code with example usage: obj.apply_tc_signals_to_total_return_index(cross_fx, total_return_index_orig_df, option_tc_bp, spot_tc_bp, signal_df, cum_index) and returns: self