Hiring someone to replicate an academic article

Discussion in 'App Development' started by systematicinvesting, Dec 4, 2023.

  1. I just read this paper: https://www.aqr.com/-/media/AQR/Documents/Insights/Journal-Article/JOIM-Investing-With-Style.pdf from AQR.

    The article claims a 17.4% annual excess return with a Sharpe ratio of 1.69 and volatility of around 10%.

    I would like to hire someone to do the following:

    1. Read the paper thoroughly, get access to all the historical data sources (I am happy to pay the data acquisition costs) and then back-test a portfolio containing the 4 styles that the article talks about and attempt to replicate the performance metrics (CAGR, Sharpe, Drawdowns, etc.) that the article claims this strategy has.

    2. If the metrics can be replicated, perform an out of sample (OOS) test of the same trading strategy for the period 2014 - 2023 and compute the same performance metrics for the OOS period.

    3. Depending on how you've done the back-tests and OOS tests (i.e. Excel, coding in Python, etc.) hand the Excel sheets / Python code to me in a form that I can run the tests on my own. Whatever you hand over needs to be extremely well-documented to help me understand all the formulas/code that has been used at every step of the back-testing process (so that I can verify and make sure that the strategy described in the article has been faithfully reproduced in the back-tests and OOS tests).

    If you are interested, can you please PM me and provide a quotation of how much you would charge for this?

    Thank you.

    PS: I am quite OK if you decide to use the strategy and data sources in your own trading after this project is over, as long as the code/data etc. isn't disclosed publicly.
     
    blueraincap and murray t turtle like this.
  2. Free advice: Look at every single AQR fund's excess return if you want to know how this works in the real world.
     
  3. TrAndy2022

    TrAndy2022

    You can ask Quantpedia(.com) researchers, as they doing a lot of this stuff and replicating academic strategies.
     
    murray t turtle likes this.
  4. 2rosy

    2rosy

    30k upfront
     
  5. I did, but couldn't find any fund that replicates the strategy mentioned in the article. Do you know of one?
     
  6. MarkBrown

    MarkBrown

    I just got thru turning an academic paper into a trading system. I used GPT professional and it took me about 3 days to get it like I wanted it. However it did come up with usable code within a few minutes, I just spent a lot of time messing with it.


    Bounded Acceleration Shortest Path

    [​IMG]
     
    Axon, zdreg and metalztrader like this.
  7. traider

    traider

    $10k
     
    MarkBrown likes this.
  8. ajacobson

    ajacobson

    AQR does separate accounts - scale will be an issue. Try them.
     
  9. MarkBrown

    MarkBrown

    So here is the F-Test for ya that's mentioned in the paper. Took AI less than one minute to code.

    Creating an F-test indicator in a trading platform like MultiCharts requires a few considerations. In statistics, the F-test is often used to compare statistical models and is based on the ratio of variances. However, translating this directly into a trading indicator can be challenging due to the nature of financial data and the purpose of the F-test.

    In the context of trading, we might loosely interpret an "F-test" indicator as a tool for comparing the variance (or volatility) of two different time periods. For example, you might want to compare the volatility of the last 10 bars with the volatility of the preceding 10 bars.

    Here is a basic example of how you might set up such an indicator:

    F-Test-Like Volatility Comparison Indicator:
    pascal
    [LegacyColorValue = true];

    Inputs:
    fastLength(10), // Length of the fast (more recent) period
    slowLength(10); // Length of the slow (earlier) period

    Vars:
    fastVariance(0),
    slowVariance(0),
    fTestValue(0);

    // Function to calculate variance
    Function CalcVariance(dataSeries: NumericSeries, length: NumericSimple) : Double;
    Var:
    meanValue(0),
    total(0),
    i(0);
    Begin
    meanValue = Average(dataSeries, length);
    For i = 1 to length Begin
    total = total + Square(dataSeries - meanValue);
    End;
    CalcVariance = total / (length - 1);
    End;

    // Calculating the variance for fast and slow periods
    fastVariance = CalcVariance(Close, fastLength);
    slowVariance = CalcVariance(Close[fastLength], slowLength);

    // Handling division by zero
    If slowVariance <> 0 Then
    fTestValue = fastVariance / slowVariance
    Else
    fTestValue = 0;

    // Plotting the F-test-like value
    Plot1(fTestValue, "F-Test-Like Value");

    Explanation:
    1. Input Parameters: The script takes two inputs, fastLength and slowLength, representing the lengths of the two periods you want to compare.

    2. Variance Calculation: The CalcVariance function calculates the variance for a given data series over a specified length.

    3. F-Test-Like Calculation: The script calculates the variance for the recent period (fastVariance) and the preceding period (slowVariance), then divides the former by the latter to get an F-test-like value.

    4. Plotting: The script plots this F-test-like value, which can provide a sense of how volatility is changing over time.
    Considerations:
    • Statistical Rigor: This indicator does not perform a true F-test in the statistical sense. It is a simplification meant for comparative volatility analysis.

    • Interpretation: High values might indicate increasing volatility, while low values suggest decreasing volatility. However, this interpretation can depend significantly on market context.

    • Testing: As with any custom indicator, test it thoroughly to understand its behavior and relevance to your trading strategy.
     
  10. MarkBrown

    MarkBrown

    Here is a start on the system in the paper.

    To create a shell system based on the concept of asset allocation as described in the linked AQR article, "Investing With Style," we'll focus on simulating the impact of allocating a portion of a traditional 60/40 stock/bond portfolio into a style premia composite portfolio. This system will calculate the Sharpe ratios for different levels of allocation to the style premia composite, as described in the article.

    Since the specific calculations for Sharpe ratios and the details of the style premia composite are not provided in your request, the implementation will be a simplified conceptual framework.

    Conceptual Shell System for Asset Allocation:
    pascal
    [LegacyColorValue = true];

    Inputs:
    baseSharpeRatio(0.31), // Base Sharpe ratio of the 60/40 stock/bond portfolio
    stockBondAllocation(0.6), // Initial allocation to stock (60%)
    styleAllocations(array[3](0.1, 0.2, 0.3)); // Style allocation levels: 10%, 20%, 30%

    Vars:
    adjustedStockBondAllocation(0),
    totalPortfolioSharpeRatio(0),
    i(0);

    // Function to calculate adjusted Sharpe ratio based on style allocation
    Function CalcAdjustedSharpeRatio(baseRatio: Double, stockBondAlloc: Double, styleAlloc: Double): Double;
    Var:
    adjustedRatio(0);
    Begin
    // Adjust stock/bond allocation based on style allocation
    adjustedStockBondAllocation = stockBondAlloc * (1 - styleAlloc);

    // Simplified calculation to estimate the new Sharpe ratio
    // Note: This is a conceptual calculation and does not reflect actual financial modeling
    adjustedRatio = baseRatio + (baseRatio * styleAlloc * 2); // Assuming style allocation improves Sharpe ratio

    Return adjustedRatio;
    End;

    // Iterating through different levels of style allocation
    For i = 1 to 3 Begin
    totalPortfolioSharpeRatio = CalcAdjustedSharpeRatio(baseSharpeRatio, stockBondAllocation, styleAllocations);

    // Print or plot the adjusted Sharpe ratio for each allocation level
    Print("Style Allocation: ", styleAllocations:1:2,
    " Adjusted Sharpe Ratio: ", totalPortfolioSharpeRatio:1:2);
    // For plotting, use Plot statements or other means to display results
    End;

    Explanation:



      • Input Parameters:
        • baseSharpeRatio: The initial Sharpe ratio of the traditional 60/40 portfolio.
        • stockBondAllocation: The portion of the portfolio allocated to stocks.
        • styleAllocations: An array representing different levels of investment in the style premia composite (10%, 20%, 30%).
      • Sharpe Ratio Calculation:
        • The CalcAdjustedSharpeRatio function calculates the adjusted Sharpe ratio based on the style allocation.
      • Iterative Calculation:
        • The script iterates through different style allocation levels and calculates the corresponding Sharpe ratios.
    Considerations:



      • Simplification: The actual calculation of the Sharpe ratio would require details like the return and standard deviation of the portfolio, which are not provided. The script uses a simplified assumption for illustrative purposes.
      • Testing and Adaptation: You would need to adapt this script to your specific trading platform and data. Testing is crucial to ensure it works as intended.
      • Financial Modeling Accuracy: For accurate financial modeling, especially for something as sophisticated as style investing, more detailed data and complex calculations are required. This script is a basic starting point and should be developed further for practical application.

    Python Version of Asset Allocation Shell System:
    python
    def calc_adjusted_sharpe_ratio(base_ratio, stock_bond_alloc, style_alloc):
    """
    Calculate the adjusted Sharpe ratio based on style allocation.

    param base_ratio: Base Sharpe ratio of the stock/bond portfolio.
    param stock_bond_alloc: Allocation to stock/bond portfolio.
    param style_alloc: Allocation to the style premia composite.
    :return: Adjusted Sharpe ratio.
    """
    # Adjust stock/bond allocation based on style allocation
    adjusted_stock_bond_allocation = stock_bond_alloc * (1 - style_alloc)

    # Simplified calculation to estimate the new Sharpe ratio
    adjusted_ratio = base_ratio + (base_ratio * style_alloc * 2) # Assuming style allocation improves Sharpe ratio
    return adjusted_ratio

    # Input parameters
    base_sharpe_ratio = 0.31 # Base Sharpe ratio of the 60/40 stock/bond portfolio
    stock_bond_allocation = 0.6 # Initial allocation to stock (60%)
    style_allocations = [0.1, 0.2, 0.3] # Style allocation levels: 10%, 20%, 30%

    # Iterating through different levels of style allocation
    for style_alloc in style_allocations:
    total_portfolio_sharpe_ratio = calc_adjusted_sharpe_ratio(base_sharpe_ratio, stock_bond_allocation, style_alloc)

    # Print the adjusted Sharpe ratio for each allocation level
    print(f"Style Allocation: {style_alloc:.2f}, Adjusted Sharpe Ratio: {total_portfolio_sharpe_ratio:.2f}")

    Explanation:
    • The function calc_adjusted_sharpe_ratio calculates the adjusted Sharpe ratio based on the given base Sharpe ratio, the allocation to the stock/bond portfolio, and the allocation to the style premia composite.

    • The script iterates over the specified style allocation levels (style_allocations) and calculates the adjusted Sharpe ratio for each level.

    • The results are printed to the console.
    Python Script Execution:
    • To execute this script, you'll need a Python environment. You can run it in any Python interpreter or development environment like Jupyter Notebook, PyCharm, or directly from the command line if you have Python installed.

    • This script is a direct translation of the conceptual logic provided earlier and assumes a simplified model for illustration purposes. For real-world financial modeling, a more complex and accurate approach would be required.
     
    Last edited: Dec 4, 2023
    #10     Dec 4, 2023