Module boosted.api.api_type

Classes

class BoostedDataSetSchemaException (value, data=None)

Common base class for all non-exit exceptions.

Ancestors

  • builtins.Exception
  • builtins.BaseException
class ChunkStatus (value, names=None, *, module=None, qualname=None, type=None, start=1)

An enumeration.

Ancestors

  • enum.Enum

Class variables

var ABORTED
var ERROR
var PROCESSING
var SUCCESS
var WARNING
class ColumnConfig (name=None, role=None, sub_role=None, value_type=NUMBER, description='', investment_horizon=None)
class ColumnRole (value, names=None, *, module=None, qualname=None, type=None, start=1)

An enumeration.

Ancestors

  • enum.Enum

Class variables

var GOAL
var IDENTIFIER
var METRIC
var UNKNOWN
var VARIABLE
class ColumnSubRole (value, names=None, *, module=None, qualname=None, type=None, start=1)

An enumeration.

Ancestors

  • enum.Enum

Class variables

var COMPANY_NAME
var COUNTRY
var CURRENCY
var DATE
var GBI_ID
var GVKEY
var IID
var ISIN
var REPORT_DATE
var REPORT_PERIOD
var SYMBOL
var UNKNOWN

Methods

def get_match(column_name)
class ColumnValueType (value, names=None, *, module=None, qualname=None, type=None, start=1)

An enumeration.

Ancestors

  • enum.Enum

Class variables

var NUMBER
var STRING
var UNKNOWN
class DataAddType (value, names=None, *, module=None, qualname=None, type=None, start=1)

An enumeration.

Ancestors

  • enum.Enum

Class variables

var CREATION
var HISTORICAL
var LIVE
class DataSetConfig (name, datasetType=STOCK, datasetSubType=DENSE, datasetFrequency=DAILY)

Methods

def addColumn(self, columnConfig)
def addStrategy(self, strategyConfig)
def fromDict(schema)
def toDict(self)
def updateColumnToGoal(self, col_name, investment_horizon)
def updateColumnToMetric(self, col_name)
def updateColumnToVariable(self, col_name)
class DataSetFrequency (value, names=None, *, module=None, qualname=None, type=None, start=1)

An enumeration.

Ancestors

  • enum.Enum

Class variables

var ANNUAL
var DAILY
var MONTHLY
var QUARTERLY
var SEMIANNUAL
var UNKNOWN
var WEEKLY
class DataSetSubType (value, names=None, *, module=None, qualname=None, type=None, start=1)

An enumeration.

Ancestors

  • enum.Enum

Class variables

var DENSE
var SPARSE_FWD
var SPARSE_HIST
var UNKNOWN
class DataSetType (value, names=None, *, module=None, qualname=None, type=None, start=1)

An enumeration.

Ancestors

  • enum.Enum

Class variables

var GLOBAL
var STOCK
var STRATEGY
var UNKNOWN
class DateIsinCountryCurrency (date, isin, country, currency)
class DateIsinCountryCurrencyException (value, data=None)

Common base class for all non-exit exceptions.

Ancestors

  • builtins.Exception
  • builtins.BaseException
class GbiIdSecurity (gbi_id, isin_country_currency_date, ticker, company_name)
class GbiIdSecurityException (value, data=None)

Common base class for all non-exit exceptions.

Ancestors

  • builtins.Exception
  • builtins.BaseException
class IdentifierToColumnMapping (mapping)

IdentifierToColumnMapping is a mapping from string to boosted.api.api_type.ColumnSubRole. The key of the mapping corresponds to a CSV column name, and the value corresponds to the type of identifier that it maps to. Only columns specifying an identifying factor for the stock needs to be specified (e.g. ISIN, Date, Symbol, Currency)

class PortfolioSettings (settings)

This config is a documentation wrapper around a dict representing the portfolio settings json. Keys missing in the dict provided will fallback to the listed default when updating the the portfolio settings on the server.

Parameters

activeRisk : bool
  • Active Risk: Set the portfolio optimization parameters to be relative to the score from the stock universe. i.e. if you set Momentum to 0.5 to 1.0 and the stock universe has a market cap weighed score of 0.2 then the optimizer will solve for 0.7 to 1.2.
  • Constraints: Boolean value
  • Default Value: false
allowCompanyCollisions : bool
  • Allow Multiple Securities Per Company: Allows the machine to trade multiple securities (at the same time) for the same company. If it is ON and a company has listed PREF shares and COMMON shares, both will show up as tradeable options for that company. If it is OFF then system will try to determine the "correct" security to trade based on volume, liquidity, and share type.
  • Constraints: Boolean value
  • Default Value: true
allowDR : bool
  • Allow Depositary Receipts: Companies with tickers ending in .Y and .F will be disallowed from trading within the model with this setting off. Turn it on to allow trading in these securities.
  • Constraints: Boolean value
  • Default Value: true
benchmark : array
  • Benchmark: Set one or more benchmarks and the weighting for each.
  • Constraints: Required. List of dicts with keys: gbi_id: integer representing the GBI ID of the benchmark index. weight: floating point value between 0 and 1. All gbi_id's in the dictionary must be unique, and the benchmark weights must sum to a number between 0 and 1.
  • Default Value: []
benchmarkAllocation : float
  • Benchmark Allocation: None
  • Constraints: Floating point value representing a percentage between -100 and 100
  • Default Value: 0
beta_neutral : bool
  • Beta Neutral: If toggled on the optimizer will add or subtract units of the benchmark to get ex-ante beta to be equal to the net exposure of the portfolio.
  • Constraints: Boolean value
  • Default Value: false
bounds_method : null | str
  • Optimizer Bounds: Tight: The optimizer will only allow the weightings of securities in your portfolio to stay tight (close) to their initial weighting. Loose: The optimizer will allow the weightings of securities in your portfolio to move a medium amount more from their initial weighting. Wide: The optimizer will allow almost any weight between the minimum and maximum weight per long or short position.
  • Constraints: String enum of {loose, tight, wide}, or null
  • Default Value: null
compounding : bool
  • Compound Returns: When toggled on, this will allow the portfolio to compound returns.
  • Constraints: Boolean value
  • Default Value: true
currency : str
  • Currency: The currency you would like your portfolio to be calculated in. Note that if the currency differs from its exchange (i.e. GBP on the S&P), the prior close foreign exchange rate will be used for calculations.
  • Constraints: Required. String representing a 3 digit ISO currency code.
  • Default Value: "USD"
dividendYieldOptimizer : bool
  • Dividend Yield: If toggled on the optimizer will try to solve for a historical dividend yield that is: stock universe + LB < portfolio dividend yield < stock universe + UB.
  • Constraints: Boolean value
  • Default Value: false
equalWeightBenchmark : bool
  • Equal Weight Benchmark: Instead of using the defined benchmarks, set the benchmark to be an equal weighted (per rebalance period) version of the stock universe.
  • Constraints: Boolean value
  • Default Value: false
executionDelay : int
  • Execution Delay: This option adds the number of days selected to the trade execution. If you select T+1 and your rebalance period is set to Weekly (Monday), it will trade on Tuesday, and so on.
  • Constraints: Integer value between 0 and 100, inclusive.
  • Default Value: 0
factorNeutralizeSignal : bool
  • Factor Neutralize Signal: Turn on an optimization process that will factor neutralize the signal according to the specifications you set. This is done prior to portfolio construction and helps reduce bias in the model. A 0 score would be neutral, so default settings are LB = -0.25 and UB = +0.25.
  • Constraints: Boolean value
  • Default Value: false
investmentHorizon : bool
  • Investment Horizon: The investment horizon in days
  • Constraints: Positive Integer
  • Default Value: 21
trainingFrequency : str
  • Training Frequency: How frequently the model for this portfolio is retrained
  • Constraints: One of "annual", "semiAnnual", "quarterly", or "monthly"
lower_turnover : bool
  • Lower Turnover: If toggled on the optimizer will try to solve the secondary goal of optimizing the primary goals while limiting turnover.
  • Constraints: Boolean value
  • Default Value: false
marketCapBounds : float
  • Maximum Market Cap Variation: How far from the target market cap weighted index each stock can deviate (positive or negative).
  • Constraints: Floating point value representing a percentage between 0 and 10
  • Default Value: 1
marketCapConstraint : bool
  • Constrain Market Cap: Force weighting to be near the target weights for a market cap weighted index of your entire stock universe.
  • Constraints: Boolean value
  • Default Value: false
marketCapFlex : float
  • Market Cap Flex: How far from the target market cap weighted the stock can deviate relative to the existing weight (i.e. at 75% a 1% position cannot exceed 1.75%).
  • Constraints: Floating point value representing a percentage between 10 and 200
  • Default Value: 100
maxLongPosition : float
  • Max Long Position per Stock: The maximum weighting of a long position within the portfolio.
  • Constraints: Required. Floating point value representing a percentage between 0.0 and 300.0
  • Default Value: 10.0
maxNumStockLong : int
  • Maximum Number of Longs: The maximum number of stocks to buy. This is on a per “portfolio” basis, so if you have sector neutral turned on it will be maximum per sector.
  • Constraints: Integer value between 0 and 1000, inclusive. Must be >= minNumStockLong
  • Default Value: 50
maxNumStockShort : int
  • Maximum Number of Shorts: The maximum number of stocks to short. This is on a per “portfolio” basis, so if you have sector neutral turned on it will be maximum per sector.
  • Constraints: Integer value between 0 and 1000, inclusive. Must be >= minNumStockShort
  • Default Value: 50
maxOwnership : float
  • Maximum Ownership: The maximum percentage of a company the portfolio is allowed to own. For example, if a company had a market cap of $100MM and this was 5% the portfolio could not own more than $5MM of that company.
  • Constraints: Floating point value representing a percentage between 0 and 100
  • Default Value: 5
maxShortPosition : float
  • Max Short Position per Stock: The maximum weighting of a short position within the portfolio.
  • Constraints: Required. Floating point value representing a percentage between 0.0 and 300.0
  • Default Value: 5.0
minimumSharePrice : float
  • Minimum Share Price: The minimum share price you want the portfolio to allow.
  • Constraints: Floating point value between 0 and 100000
  • Default Value: 2
minLongPosition : float
  • Min Long Position per Stock: The minimum weighting of a long position within the portfolio.
  • Constraints: Floating point value representing a percentage between 0.0 and 300.0
  • Default Value: 0
minNumStockLong : int
  • Minimum Number of Longs: The minimum number of stocks to buy. This is on a per “portfolio” basis, so if you have sector neutral turned on it will be minimum per sector.
  • Constraints: Integer value between 0 and 1000, inclusive. Must be <= maxNumStockLong
  • Default Value: 5
minNumStockShort : int
  • Minimum Number of Shorts: The minimum number of stocks to short. This is on a per “portfolio” basis, so if you have sector neutral turned on it will be minimum per sector.
  • Constraints: Integer value between 0 and 1000, inclusive. Must be <= maxNumStockShort
  • Default Value: 5
minShortPosition : float
  • Min Short Position per Stock: The minimum weighting of a short position within the portfolio.
  • Constraints: Floating point value representing a percentage between 0.0 and 100.0
  • Default Value: 0
missingMarketCap : float
  • Missing Market Cap: The amount in millions (MM) to replace any missing market capitalization information with. This will impact the maximum ownership setting.
  • Constraints: Floating point value between 0 and 100
  • Default Value: 10
nameBasedSectorWeighting : bool
  • Name Based Sector Weighting: Base sector weightings on number of names. For example, if there are 200 names in the index and financials has 20 companies, the weight of financials should be 10% (20/200).
  • Constraints: Boolean value
  • Default Value: false
netBenchmark : bool
  • Adjust Benchmark for Net Exposure: If your portfolio has a net exposure greater or less than 100%, this will adjust the benchmark returns to match that net exposure.
  • Constraints: Boolean value
  • Default Value: false
optimizer : str
  • Optimizer Type: No Optimization: None Reduce Risk: Optimizer designed to reduce portfolio volatility. This tends to result in the best overall performance. Maximize Sharpe: Optimizer designed to maximize Sharpe using out of sample estimates for expected return. Estimates for expected return have an outsized impact on the performance of this optimizer. Maximize Alpha: Optimizer designed to maximize expected return based on out-of-sample estimates for expected return. Estimates for expected return have an outsized impact on the performance of this optimizer. Min VaR: Minimize Value at Risk by looking back at the proposed portfolio over the last year and trying to minimize drawdowns. Max VaR Sharpe: Maximize Value at Risk Sharpe by looking back at the proposed portfolio over the last year and trying to maximize Sharpe by observed return for the portfolio vs observed volatility. Minimize Skew: Minimize the skew of the portfolio by trying to find a set of portfolio weightings that results in returns that are closer to the mean.
  • Constraints: Required. String enum: one of default: No Optimization min_vol: Reduce Risk max_sharpe: Maximize Sharpe max_alpha: Maximize Alpha min_var: Min VaR max_var_sharpe: Max VaR Sharpe min_skew: Minimize Skew
  • Default Value: "default"
optimizeTurnover : bool
  • Turnover Optimization: None
  • Constraints: Boolean value
  • Default Value: false
pairsTrading : bool
  • Pairs Trading: Pairs Trading forces the portfolio to be created by going long / short an equal number of stocks. The portfolio will try to find an offseting position for every long by finding securities that are both highly correlated and have a significant difference in star rating.
  • Constraints: Boolean value
  • Default Value: false
percentPortfolioLong : float
  • Percent of Portfolio Long: The exact sum of all long position weightings in the portfolio.
  • Constraints: Required. Floating point value representing a percentage between 0.0 and 300.0
  • Default Value: 100.0
percentPortfolioShort : float
  • Percent of Portfolio Short: The exact sum of all short position weightings in the portfolio.
  • Constraints: Required. Floating point value representing a percentage between 0.0 and 300.0
  • Default Value: 0.0
percentToLong : float
  • Percent to Long: The machine will attempt to buy the top X% of stocks, subject to the minimum and maximum specified. This is on a per “portfolio” basis, so if you have sector neutral turned on it will be top X% per sector. This will be subject to the maximum and minimum number of securities you specify below.
  • Constraints: Floating point value representing a percentage between 0 and 100
  • Default Value: 20.0
percentToShort : float
  • Percent to Short: The machine will attempt to short the bottom X% of stocks, subject to the minimum and maximum specified. This is on a per “portfolio” basis, so if you have sector neutral turned on it will be bottom X% per sector. This will be subject to the maximum and minimum number of securities you specify below.
  • Constraints: Floating point value representing a percentage between 0 and 100
  • Default Value: 20.0
portfolioStartingValue : float
  • Portfolio Starting Value: The value of the portfolio in MM when it begins trading. If its backtest spans from 2005
    • 2020, the starting value in 2005 will be whatever you set here.
  • Constraints: Floating point value between 0 and 100000.
  • Default Value: 100.0
priceCleaning : bool
  • Price Cleaning: Price Cleaning removes any very large price movements from the securities, specifically with a daily change greater than +500% or -83.33%. There are some legitimate securities with moves this large that will be impacted by turning this on, but the advantage is it prevents these securities from overwhelming the backtest.
  • Constraints: Boolean value
  • Default Value: true
priceType : str
  • Price Type: None
  • Constraints: Required. String enum of {CLOSE, OPEN, VWAP}
  • Default Value: "OPEN"
rebalancePeriod : str
  • Rebalance Period: When the machine rebalances the portfolio. You can choose a specific day if you prefer to execute trades on a specific day.
  • Constraints: Required. An enum value in the following list: "daily" "weekly": Rebalances on every Monday. Chooses the next available trade date to rebalance when Monday is a holiday "weekly_wednesday": Rebalances on every Wednesday. Chooses the next available trade date to rebalance when Wednesday is a holiday "weekly_friday": Rebalances on every Friday. Chooses the previous available trade date to rebalance when Friday is a holiday "monthly" "quarterly" OR a string in the following format: "custom_x" where x is an integer between 1 and 252 (days).
  • Default Value: "weekly"
sectorNeutral : bool
  • Sector Neutral: Will be constructed as a series of portfolios - each matching the market cap weighting of each of the stock universe sectors. This means that min. and max. number of stocks "per portfolio" becomes "per sector".
  • Constraints: Boolean value
  • Default Value: false
sectorNeutralEqualWeightBenchmark : bool
  • Sector Neutral Equal Weight Benchmark: Instead of using the defined benchmarks, set the benchmark to be a "sector neutral" equal weighed (per rebalance period) version of the stock universe. This takes the sector weighting and divides by the number of stocks in that sector, so each sector will have a different individual security weighting.
  • Constraints: Boolean value
  • Default Value: false
sectorNeutralSpread : float
  • Sector Neutral Spread: The sector neutral spread is how far away from the benchmark sector allocation the machine can deviate. This is adjusted for net exposure, i.e. if your net exposure is 0% the target sector allocations will be 0%.
  • Constraints: Floating point value representing a percentage between 0 and 100
  • Default Value: 0
signalIndustryNeutral : bool
  • Industry Neutral: Make the signal industry neutral, plus or minus the signal sector neutral spread.
  • Constraints: Boolean value
  • Default Value: false
signalSectorNeutral : bool
  • Sector Neutral: Make the signal sector neutral, plus or minus the signal sector neutral spread.
  • Constraints: Boolean value
  • Default Value: false
signalSectorNeutralSpread : float
  • Sector Neutral Spread: Make the signal sector neutral, plus or minus the signal sector neutral spread.
  • Constraints: Floating point value representing a percentage between 0 and 100
  • Default Value: 1.0
smoothPeriods : int
  • Smooth Periods: The number of periods over which to smooth the signals
  • Constraints: Integer value between 1 and 100.
  • Default Value: 1
smoothWeighting : str
  • Smooth Weighting Type: Alpha Weight: The strength of the signal matters in the smoothing. For example, if a stock had a score of 5 stars in period A, 2 stars in period B, your 2 period smoothing would be 7 / 2 = 3.5. Equal Weight: Only the direction of the signal matters here. For example, if you were 5 stars in period A and 2 stars in period B, your 2 period smoothing would be 0 / 2 = 0 (+1 in period 1 and -1 in period 2)
  • Constraints: One of {alpha_weight, equal_weight}
  • Default Value: "alpha_weight"
stopGain : bool
  • Enable Stop Gain: Turn on stop gains for the portfolio. This forces sales of securities that have exceeded the stop gain level. All trades will occur at the next trading time (i.e. next day OPEN for OPEN price models).
  • Constraints: Boolean value
  • Default Value: false
stopGainAmount : float
  • Stop Gain Percentage to Sell: The percentage of the position the machine will sell if the stop gain is triggered.
  • Constraints: Floating point value representing a percentage between 1 and 100.
  • Default Value: 50.0
stopGainLevel : float
  • Stop Gain Threshold: Will sell positions after they hit a threshold. For example, 10% / stop gain, when a position gains 10% the machine will sell a portion of the position (defined by stop gain percentage).
  • Constraints: Floating point value representing a percentage between 1 and 100.
  • Default Value: 10.0
stopLoss : bool
  • Enable Stop Loss: Turn on stop losses for the portfolio. This forces sales of securities that have exceeded the stop loss level. All trades will occur at the next trading time (i.e. next day OPEN for OPEN price models).
  • Constraints: Boolean value
  • Default Value: false
stopLossAmount : float
  • Stop Loss Percentage to Sell: The percentage of the position the machine will sell if the stop loss is triggered.
  • Constraints: Floating point value representing a percentage between 1 and 100.
  • Default Value: 50.0
stopLossLevel : float
  • Stop Loss Threshold: Will sell positions after they hit a threshold. For example, 10% / stop loss, when a position loses 10% the machine will sell a portion of the position (defined by stop loss percentage).
  • Constraints: Floating point value representing a percentage between 1 and 100.
  • Default Value: 10.0
stopLossReset : bool
  • Allow multiple stop loss/gain between rebalance days: Allows the machine to repeatedly trigger stop losses within a rebalance period. For example, if you trade Mondays and the stock drops 15% per day during the week and the stop loss trigger is 10%, then every day will trigger the stop loss. If toggled off the stop loss can only be triggered once per stock per rebalance period.
  • Constraints: Boolean value
  • Default Value: false
trackingConstraint : float
  • Maximum Tracking Error (vs Benchmark): Amount of ex-ante tracking error to constrain the optimizer by.
  • Constraints: Floating point value representing a percentage between 0.5 and 25
  • Default Value: 10
trackingError : bool
  • Allocate Weight to Benchmark: None
  • Constraints: Boolean value
  • Default Value: false
trackingErrorOptimizer : bool
  • Tracking Error: If toggled on the optimizer will try to solve for an expected tracking error less than the amount specified. This is done out-of-sample and the ex post tracking error will likely be higher.
  • Constraints: Boolean value
  • Default Value: false
tradingCost : float
  • Trading Cost: A cost that will be applied to every trade.
  • Constraints: Required. Floating point value representing a percentage between 0.0 and 5.0
  • Default Value: 0.01
turnoverImportance : float
  • Turnover Importance: None
  • Constraints: Floating point value between 0.2 and 5 nonlinearly mapped onto the 1-9 interval.
  • Default Value: 1
useHoldingPeriod : bool
  • Use Holding Period: Set any covariance or other calculations within the optimizer to use a holding period return instead of daily return series
  • Constraints: Boolean value
  • Default Value: false
weightingType : str
  • Initial Weighting: Alpha Weight: The initial weighting will be done such that higher ranked stocks have a higher weight. Equal Weight: The initial weighting will be done such that all stocks selected to be in the portfolio will have an equal weight. Market Cap Weight: The initial weighting will be done such that all stocks are weighted according to their previous day’s market capitalization.
  • Constraints: One of {alpha_weight, equal_weight, market_cap_weight}
  • Default Value: "equal_weight"

Methods

def fromDict(settings)
def toDict(self)
class Status (value, names=None, *, module=None, qualname=None, type=None, start=1)

An enumeration.

Ancestors

  • enum.Enum

Class variables

var FAIL
var SUCCESS
var UNKNOWN
class StrategyConfig (name=None, source_name=None)