Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Problem by building my own Factor EBIT_EV

Hi,

I want to use the fundamental data of ebit_ev (ebit to ev). Since the Morningstar has no such a parameter but the ebit and ev, so I want to build it myself. I did as follow:

class EBIT_EV(CustomFactor):  
    # get most recent price to earnings ratio  
    inputs = [mstar.income_statement.ebit,  
              mstar.valuation.enterprise_value]  
    window_length = 1  
    def compute(self, today, assets, out, ebit_last, ev_last):  
        out[:] = ebit_last[-1] / ev_last[-1]  

At the first glance is seems OK, but the problem is, if both the ebit and ev negativ it, the ebit_ev is positive. This must be filtered out.

Has someone idea?

Cheers

Thomas

3 responses

I think I've solved the problem myself. I do as follow:

class EBIT_EV(CustomFactor):  
    # get most recent price to earnings ratio  
    inputs = [mstar.income_statement.ebit,  
              mstar.valuation.enterprise_value]  
    window_length = 1  
    def compute(self, today, assets, out, ebit_last, ev_last):  
        ebit_last[ebit_last < 0] = np.nan  
        ev_last[ev_last <0] = np.nan  
        out[:] = ebit_last[-1] / ev_last[-1]  

Hope I am right.

class Value(CustomFactor):  
    inputs = [morningstar.income_statement.ebitda,morningstar.valuation.enterprise_value]  
    def compute(self, today, asset_ids, out, ebitda,ev):  
        ev = np.maximum(ev,1)  
        out[:] = ebitda/ev  

I like setting the floor of EV to 1, which allows me to compare earnings alone.

Hi Minh,

The reason I use the 'ebit to ev' is based on the so-called "magic formular" from Greenblatt. But your answer is interessting. Could you explain a litte bit? :-/