Skip to content

Commit

Permalink
Features:
Browse files Browse the repository at this point in the history
	- Value Factor Metric - P/E Ratio (1)
	- Value Factor Metric - P/B Ratio (2)
	- Value Factor Metric - P/S Ratio (3)
	- Investing Risk Index Value Factor (4, 5)
	- Investing Risk Index Value Factor - Constructor (6, 7)
	- Price Earnings Ratio Value Factor (8, 9, 10)
	- Price Book Ratio Value Factor (11, 12)
	- Price Sales Ratio Value Factor (13, 14)
	- Dividend Yield Metric Value Factor (15, 16)
	- Investing Factors Factor Spec Category (17, 18, 19)
	- Risk Index Value Factor Category (20, 21)
	- Investing Risk Index Value Factor (22, 23)
	- Investing Risk Index Value Factor - Constructor (24, 25)
	- Investing Factors Factor Portfolio Ranker (26, 27, 28)
	- Ranked Factor Component Loading Map (33, 34, 35)
	- Value Factor Portfolio Ranker Customizer (36, 37)
	- Volatility Factor Portfolio Ranker Customizer (38)


Bug Fixes/Re-organization:

	- Investing Portfolio Factor Ranker Eliminate (29, 30)
	- Factor Component Loading Master Universe Map (31, 32)
	- Special Function Incomplete Gamma Upper Regularized #1 (39, 40, 41)
	- Special Function Incomplete Gamma Upper Regularized - Gauss Continued Fraction (42, 43)
	- Special Function Incomplete Gamma Upper Regularized - Abramowitz Stegun 2007 (44, 45)
	- Special Function Incomplete Gamma Upper Regularized - Euler Integral (46, 47)
	- Special Function Incomplete Gamma Upper Regularized - Weisstein (48, 49)
	- Special Function Incomplete Gamma Upper Regularized #2 (50)
	- Special Function Incomplete Gamma Upper Regularized - p (51)
	- Special Function Lanczos P Series Term (52, 53, 54)
	- Special Function Lanczos P Series Term - g (55, 56)
	- Special Function Lanczos P Series Term - Constructor (57, 58)
	- Special Function Lanczos P Series Term - Value (59, 60)


Samples:

IdeaDRIP:
  • Loading branch information
Lakshmik committed Feb 28, 2024
1 parent 2abf442 commit 91e76ba
Show file tree
Hide file tree
Showing 10 changed files with 622 additions and 94 deletions.
6 changes: 3 additions & 3 deletions IdeaDRIP/FactorInvesting/FI_v0.01
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
1) Security Characteristics - aka Factors: Size, Low-volatility, Value, Momentum, Asset growth, Profitability, Leverage, Liquidity, Term, Carry - DONE
2) Beta Tilt Direction - Towards (+ve), Away (-ve)
3) Risk Premia Category - Corporates, Govvies, Equity, Commodities - DONE
4) Value Factor - Difference between Intrinsic/Fundamental Value and Market Value
5) Value Factor Metrics - P/E Ratio, P/B Ratio, P/S Ratio, Dividend Yield
6) Low-volatility Factor - Portfolio acquires only low-volatility assets
4) Value Factor - Difference between Intrinsic/Fundamental Value and Market Value - DONE
5) Value Factor Metrics - P/E Ratio, P/B Ratio, P/S Ratio, Dividend Yield - DONE
6) Low-volatility Factor - Portfolio acquires only low-volatility assets - DONE
7) Momentum Factor - High returns over past 3-12 months minus Low returns over past 3-12 months, Returns Horizon, Momentum Lag
8) Momentum Factor caused by seasonality (e.g., January effect)

Expand Down
42 changes: 42 additions & 0 deletions ReleaseNotes/08_08_2023.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

Features:

- Value Factor Metric - P/E Ratio (1)
- Value Factor Metric - P/B Ratio (2)
- Value Factor Metric - P/S Ratio (3)
- Investing Risk Index Value Factor (4, 5)
- Investing Risk Index Value Factor - Constructor (6, 7)
- Price Earnings Ratio Value Factor (8, 9, 10)
- Price Book Ratio Value Factor (11, 12)
- Price Sales Ratio Value Factor (13, 14)
- Dividend Yield Metric Value Factor (15, 16)
- Investing Factors Factor Spec Category (17, 18, 19)
- Risk Index Value Factor Category (20, 21)
- Investing Risk Index Value Factor (22, 23)
- Investing Risk Index Value Factor - Constructor (24, 25)
- Investing Factors Factor Portfolio Ranker (26, 27, 28)
- Ranked Factor Component Loading Map (33, 34, 35)
- Value Factor Portfolio Ranker Customizer (36, 37)
- Volatility Factor Portfolio Ranker Customizer (38)


Bug Fixes/Re-organization:

- Investing Portfolio Factor Ranker Eliminate (29, 30)
- Factor Component Loading Master Universe Map (31, 32)
- Special Function Incomplete Gamma Upper Regularized #1 (39, 40, 41)
- Special Function Incomplete Gamma Upper Regularized - Gauss Continued Fraction (42, 43)
- Special Function Incomplete Gamma Upper Regularized - Abramowitz Stegun 2007 (44, 45)
- Special Function Incomplete Gamma Upper Regularized - Euler Integral (46, 47)
- Special Function Incomplete Gamma Upper Regularized - Weisstein (48, 49)
- Special Function Incomplete Gamma Upper Regularized #2 (50)
- Special Function Incomplete Gamma Upper Regularized - p (51)
- Special Function Lanczos P Series Term (52, 53, 54)
- Special Function Lanczos P Series Term - g (55, 56)
- Special Function Lanczos P Series Term - Constructor (57, 58)
- Special Function Lanczos P Series Term - Value (59, 60)


Samples:

IdeaDRIP:
Binary file modified ScheduleSheet.xlsx
Binary file not shown.
49 changes: 47 additions & 2 deletions src/main/java/org/drip/investing/factors/Factor.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

package org.drip.investing.factors;

import java.util.Map;

/*
* -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*/
Expand Down Expand Up @@ -116,14 +118,18 @@ public abstract class Factor
private String _description = "";
private FactorPortfolio _portfolio = null;
private int _metricType = Integer.MIN_VALUE;
private int _factorCategory = Integer.MIN_VALUE;
private FactorPortfolioRanker _portfolioRanker = null;

/**
* Factor Constructor
*
* @param code Factor Code
* @param description Factor Description
* @param metricType Factor Metric Type
* @param factorCategory Factor Category
* @param portfolio Factor Portfolio
* @param portfolioRanker Factor Portfolio Ranker
*
* @throws Exception Thrown if the Inputs are Invalid
*/
Expand All @@ -132,15 +138,21 @@ protected Factor (
final String code,
final String description,
final int metricType,
final FactorPortfolio portfolio)
final int factorCategory,
final FactorPortfolio portfolio,
final FactorPortfolioRanker portfolioRanker)
throws Exception
{
if (null == (_code = code) || _code.isEmpty() || null == (_portfolio = portfolio)) {
if (null == (_code = code) || _code.isEmpty() ||
null == (_portfolio = portfolio) ||
null == (_portfolioRanker = portfolioRanker))
{
throw new Exception ("Factor Constructor => Invalid Inputs");
}

_metricType = metricType;
_description = description;
_factorCategory = factorCategory;
}

/**
Expand Down Expand Up @@ -176,6 +188,17 @@ public int metricType()
return _metricType;
}

/**
* Retrieve the Factor Category
*
* @return The Factor Category
*/

public int factorCategory()
{
return _factorCategory;
}

/**
* Retrieve the Factor Portfolio
*
Expand All @@ -186,4 +209,26 @@ public FactorPortfolio portfolio()
{
return _portfolio;
}

/**
* Retrieve the Factor Portfolio Ranker
*
* @return The Factor Portfolio Ranker
*/

public FactorPortfolioRanker portfolioRanker()
{
return _portfolioRanker;
}

/**
* Generate the Ranked Map of Components in the Factor Portfolio
*
* @return The Ranked Map of Components
*/

public Map<String, FactorComponentLoading> rankedFactorComponentLoadingMap()
{
return _portfolioRanker.rank (_portfolio.factorComponentLoadingMasterUniverseMap());
}
}
34 changes: 9 additions & 25 deletions src/main/java/org/drip/investing/factors/FactorPortfolio.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,12 @@ public class FactorPortfolio
private String _country = "";
private boolean _isGlobal = false;
private int _financingScheme = Integer.MIN_VALUE;
private FactorPortfolioRanker _factorPortfolioRanker = null;
private Map<String, FactorComponentLoading> _factorComponentLoadingMap = null;
private Map<String, FactorComponentLoading> _factorComponentLoadingMasterUniverseMap = null;

/**
* FactorPortfolio Constructor
*
* @param factorComponentLoadingMap Factor Component Loading Map
* @param factorPortfolioRanker Factor Portfolio Ranker
* @param factorComponentLoadingMasterUniverseMap Factor Component Loading Master Universe Map
* @param country Country
* @param isGlobal TRUE - The Portfolio is Global
* @param financingScheme Financing Scheme
Expand All @@ -133,17 +131,14 @@ public class FactorPortfolio
*/

public FactorPortfolio (
final Map<String, FactorComponentLoading> factorComponentLoadingMap,
final FactorPortfolioRanker factorPortfolioRanker,
final Map<String, FactorComponentLoading> factorComponentLoadingMasterUniverseMap,
final String country,
final boolean isGlobal,
final int financingScheme)
throws Exception
{
if (null == (_factorPortfolioRanker = factorPortfolioRanker) ||
null == (_country = country) || _country.isEmpty() ||
null == (_factorComponentLoadingMap = _factorPortfolioRanker.rank (factorComponentLoadingMap))
)
if (null == (_country = country) || _country.isEmpty() ||
null == (_factorComponentLoadingMasterUniverseMap = factorComponentLoadingMasterUniverseMap))
{
throw new Exception ("FactorPortfolio Constructor => Invalid Inputs");
}
Expand All @@ -153,25 +148,14 @@ public FactorPortfolio (
}

/**
* Retrieve the Factor Component Loading Map
* Retrieve the Factor Component Loading Master Universe Map
*
* @return The Factor Component Loading Map
* @return The Factor Component Loading Master Universe Map
*/

public Map<String, FactorComponentLoading> factorComponentLoadingMap()
public Map<String, FactorComponentLoading> factorComponentLoadingMasterUniverseMap()
{
return _factorComponentLoadingMap;
}

/**
* Retrieve the Factor Portfolio Ranker
*
* @return The Factor Portfolio Ranker
*/

public FactorPortfolioRanker factorPortfolioRanker()
{
return _factorPortfolioRanker;
return _factorComponentLoadingMasterUniverseMap;
}

/**
Expand Down
Loading

0 comments on commit 91e76ba

Please sign in to comment.