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
@Entity | |
public class Person { | |
@Value | |
private String firstName; | |
@Value | |
private String middleName; | |
@Value | |
private String lastName; | |
Person() {} |
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
public class Person { | |
private final String firstName; | |
private final Optional<String> middleName; | |
private final String lastName; | |
public Person( | |
String firstName, | |
Optional<String> middleName, | |
String lastName) { | |
Objects.requireNonNull(firstName); |
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
void rebalancePortfolio(Account account) { | |
if (account.getPortfolio() != null) { | |
List<Holding> holdings = account.getPortfolio().getHoldings(); | |
if (holdings != null) { | |
for (Holding holding : holdings) { | |
if (holding != null) { | |
... | |
} | |
} | |
} |
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
void rebalancePortfolio(Account account) { | |
if (account != null && account.getPortfolio() != null) { | |
List<Holding> holdings = account.getPortfolio().getHoldings(); | |
... | |
} | |
} |
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
void rebalancePortfolio(Account account) { | |
List<Holding> holdings = account.getPortfolio().getHoldings(); | |
... | |
} |
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
public abstract class InvestmentVehicle extends AllocatedAssetType implements NumberedValue { | |
private final int number; | |
private final String name; | |
private final AssetClass assetClass; | |
// boilerplate POJO implementation | |
public static List<? extends InvestmentVehicle> getAll() {...} | |
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
public abstract class AllocatedAssetType { | |
public static List<AllocatedAssetType> getAllAllocatedAssetTypes() {...} | |
public static final Cash CASH = new Cash(); | |
public static final class Cash extends AllocatedAssetType { | |
private Cash() {} | |
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
sc.sanity.sharpe_ratio=40 | |
sc.sanity.sortino_ratio=20 | |
sc.sanity.information_ratio=0.6 | |
sc.sanity.concentration=2.3 | |
sc.sanity.turnover=9.7 | |
sc.sanity.investing_iq=15 | |
sc.sanity.max_new=5000 | |
sc.sanity.max_missing=5000 | |
sc.sanity.insanity_threshold_percent=10 |
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
public final class EtfVehicle extends InvestmentVehicle | |
{ | |
public static final EtfVehicle E01_EMERGING = new EtfVehicle(1, "E01_EMERGING", AssetClass.INTL_EMERGING, /*VWO*/8901L); | |
public static final EtfVehicle E02_DEVELOPED = new EtfVehicle(2, "E02_DEVELOPED", AssetClass.INTL_DEVELOPED, /*VEA*/5381L); | |
public static final EtfVehicle E03_REAL_ESTATE = new EtfVehicle(3, "E03_REAL_ESTATE", AssetClass.REAL_ESTATE, /*VNQ*/4229L); | |
... | |
private final InstrumentId instrumentId; | |
private EtfVehicle(int number, String identity, AssetClass assetClass, InstrumentId instrumentId) {...} |
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
public class EtfModel extends AbstractHibernateEntity { | |
private Id<EtfModel> id; | |
private InstrumentId instrumentId; | |
private AssetClass assetClass; | |
private DateTime createdAt; | |
// boilerplate POJO implementation | |
} |
NewerOlder