Created
April 26, 2013 01:36
-
-
Save ianwalter/5464565 to your computer and use it in GitHub Desktop.
JavaScript code that will evaluate whether a Stock is undervalued.
This file contains 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
var earnings = stock.getNetIncome() * 10; | |
earnings += (stock.getTotalCash() - stock.getTotalDebt()); | |
if (earnings > stock.getMarketCap()) { | |
stock.setUndervalued(true); | |
} else { | |
stock.setUndervalued(false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment