Created
August 6, 2016 18:19
-
-
Save Michael-J-Ward/034e4c0f937df523c9bb50f6f190c6ae to your computer and use it in GitHub Desktop.
magic formula
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Magic_Formula(CustomFactor): | |
inputs = [mstar.income_statement.ebit, mstar.valuation.enterprise_value, | |
mstar.operation_ratios.roic] | |
outputs = ['earnings_yield', 'roic'] | |
window_length = 1 | |
def compute(self, today, assets, out, ebit, ev, roic): | |
out.earnings_yield[:] = ebit[-1] / ev[-1] | |
out.roic[:] = roic[-1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment