class_docstr: Applies some basic trade analysis for a trading strategy (as defined by TradingModel). Use PyFolio to create some
  basic trading statistics. Also allows you test multiple parameters for a specific strategy (like TC).
class_docstr_tok: ["Applies","some","basic","trade","analysis","for","a","trading","strategy","(","as","defined","by","TradingModel",")",".","Use","PyFolio","to","create","some","basic","trading","statistics",".","Also","allows","you","test","multiple","parameters","for","a","specific","strategy","(","like","TC",")","."]
code: def run_day_of_month_analysis(self, trading_model, resample_freq="B"):
      from finmarketpy.economics.seasonality import Seasonality
  
      logger = LoggerManager().getLogger(__name__)
  
      calculations = Calculations()
      seas = Seasonality()
      trading_model.construct_strategy()
      pnl = trading_model.strategy_pnl()
  
      # Get seasonality by day of the month
      pnl = pnl.resample("B").mean()
      rets = calculations.calculate_returns(pnl).tz_localize(None)
  
      bus_day = seas.bus_day_of_month_seasonality(
          rets, add_average=True, resample_freq=resample_freq
      )
  
      # Get seasonality by month
      pnl = pnl.resample("BM").mean()
      rets = calculations.calculate_returns(pnl).tz_localize(None)
      month = seas.monthly_seasonality(rets)
  
      logger.info("About to plot seasonality...")
      style = Style()
  
      # Plotting spot over day of month/month of year
      style.color = "Blues"
      style.scale_factor = trading_model.SCALE_FACTOR
      style.file_output = (
          self.DUMP_PATH
          + trading_model.FINAL_STRATEGY
          + " seasonality day of month.png"
      )
      style.html_file_output = (
          self.DUMP_PATH
          + trading_model.FINAL_STRATEGY
          + " seasonality day of month.html"
      )
      style.title = (
          trading_model.FINAL_STRATEGY + " day of month seasonality"
      )
      style.display_legend = False
      style.color_2_series = [bus_day.columns[-1]]
      style.color_2 = ["red"]  # red, pink
      style.linewidth_2 = 4
      style.linewidth_2_series = [bus_day.columns[-1]]
      style.y_axis_2_series = [bus_day.columns[-1]]
  
      self.chart.plot(bus_day, chart_type="line", style=style)
  
      style = Style()
  
      style.scale_factor = trading_model.SCALE_FACTOR
      style.file_output = (
          self.DUMP_PATH
          + trading_model.FINAL_STRATEGY
          + " seasonality month of year.png"
      )
      style.html_file_output = (
          self.DUMP_PATH
          + trading_model.FINAL_STRATEGY
          + " seasonality month of year.html"
      )
      style.title = (
          trading_model.FINAL_STRATEGY + " month of year seasonality"
      )
  
      self.chart.plot(month, chart_type="line", style=style)
  
      return month
  
imports: import datetime
  import pandas
  import copy
  from chartpy import Chart, Style, ChartConstants
  from findatapy.timeseries import Calculations, Timezone
  from findatapy.util.loggermanager import LoggerManager
  from finmarketpy.backtest import Backtest
  from finmarketpy.util.marketconstants import MarketConstants
  from findatapy.util.swimpool import SwimPool
label_desc: Use image node_id 10 for calling the TradeAnalysis obj's underlying member method code with example usage: obj.run_day_of_month_analysis(trading_model, resample_freq) and returns: month