Depreciation and Amortization

A reduction of book value in the degradation of assets.

An algorithm that trades stocks with the lowest depreciation and amortization values weekly.

Starting capital: $10,000
Max leverage: 1
Jan 2, 2006 - Sep 1, 2020

Returns: 224.14%
Drawdown: -51.22%
Benchmark (S&P 500): 276.95%
import quantopian.algorithm as algo
from quantopian.pipeline import Pipeline
from quantopian.pipeline.filters import Q3000US
from quantopian.pipeline.data.morningstar import Fundamentals as ms
import quantopian.optimize as opt

import numpy as np
import pandas as pd


def initialize(context):
    context.FINE_FILTER = 5
    context.stock_weights = pd.Series()
    algo.attach_pipeline(make_pipeline(context), 'pipeline')

    schedule_function(
        stocks_weights,
        date_rules.week_start(),
        time_rules.market_open()
    )

    schedule_function(
        trade,
        date_rules.week_start(),
        time_rules.market_open()
    )


def make_pipeline(context):
    univ = Q3000US()
    factor = ms.depreciation_and_amortization_income_statement.latest.rank(mask=univ, ascending=True)
    bottom = factor.bottom(context.FINE_FILTER)
    pipe = Pipeline(
        columns={'bottom': bottom}, screen=univ)
    return pipe


def stocks_weights(context, data):
    df = algo.pipeline_output('pipeline')
    rule = 'bottom'
    stocks_to_hold = df.query(rule).index
    stock_weight = 1.0 / context.FINE_FILTER
    context.stocks_weights = pd.Series(index=stocks_to_hold, data=stock_weight)


def trade(context, data):
    target_weights = opt.TargetWeights(context.stocks_weights)

    constraints = []
    constraints.append(opt.MaxGrossExposure(1.0))

    order_optimal_portfolio(
        objective=target_weights,
        constraints=constraints
    )

EBITDA

(Net income - (interest + tax + deprecation + amortization))

An algorithm that trades stocks with the highest earnings before interest, tax, depreciation and amortization (EBITDA) values weekly.

Starting capital: $10,000
Max leverage: 1
Jan 2, 2006 - Sep 1, 2020

Returns: -72.07%
Drawdown: -90.2%
Benchmark (S&P 500): 276.95%
import quantopian.algorithm as algo
from quantopian.pipeline import Pipeline
from quantopian.pipeline.filters import Q3000US
from quantopian.pipeline.data.morningstar import Fundamentals as ms
import quantopian.optimize as opt

import numpy as np
import pandas as pd


def initialize(context):
    context.FINE_FILTER = 5
    context.stock_weights = pd.Series()
    algo.attach_pipeline(make_pipeline(context), 'pipeline')

    schedule_function(
        stocks_weights,
        date_rules.week_start(),
        time_rules.market_open()
    )

    schedule_function(
        trade,
        date_rules.week_start(),
        time_rules.market_open()
    )


def make_pipeline(context):
    univ = Q3000US()
    factor = ms.ebitda.latest.rank(mask=univ, ascending=False)
    top = factor.top(context.FINE_FILTER)
    pipe = Pipeline(
        columns={'top': top}, screen=univ)
    return pipe


def stocks_weights(context, data):
    df = algo.pipeline_output('pipeline')
    rule = 'top'
    stocks_to_hold = df.query(rule).index
    stock_weight = 1.0 / context.FINE_FILTER
    context.stocks_weights = pd.Series(index=stocks_to_hold, data=stock_weight)


def trade(context, data):
    target_weights = opt.TargetWeights(context.stocks_weights)

    constraints = []
    constraints.append(opt.MaxGrossExposure(1.0))

    order_optimal_portfolio(
        objective=target_weights,
        constraints=constraints
    )

Net Income

(Revenue - expenses)

An algorithm that trades stocks with the highest net income values weekly.

Starting capital: $10,000
Max leverage: 1
Jan 2, 2006 - Sep 1, 2020

Returns: -62.58%
Drawdown: -88.95%
Benchmark (S&P 500): 276.95%
factor = ms.net_income_income_statement.latest.rank(mask=univ, ascending=False)

Operating Income

(Revenue - expenses - income from investing activities)

An algorithm that trades stocks with the highest operating income values weekly.

Starting capital: $10,000
Max leverage: 1
Jan 2, 2006 - Sep 1, 2020

Returns: -59.4%
Drawdown: -90.75%
Benchmark (S&P 500): 276.95%
factor = ms.operating_income.latest.rank(mask=univ, ascending=False)

Total Revenue

Income as produced by sales.

An algorithm that trades stocks with the highest total revenue values weekly.

Starting capital: $10,000
Max leverage: 1
Jan 2, 2006 - Sep 1, 2020

Returns: 95.16%
Drawdown: -76.52%
Benchmark (S&P 500): 276.95%
factor = ms.total_revenue.latest.rank(mask=univ, ascending=False)
Terms:
1. Depreciation and Amortization Investopedia
2. EBITDA Investopedia
3. Net Income Investopedia
4. Operating Income Investopedia
5. Total Revenue Investopedia


Statements on this website are for informational purposes only and do not constitute a recommendation or advice by the website owner to transact any security or market instrument. All trading activity involves known and unknown risk. Historical data presented is not always indicative of future performance.

Social

X
Github

Contact

Email