Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend security CSV loading to GenericSecurity #1735

Merged
merged 3 commits into from Jun 15, 2018
Merged

Conversation

@jodastephen
Copy link
Member

@jodastephen jodastephen commented Jun 13, 2018

Allows loading without reference data.
Use BuySell column for security trades.
Remove undocumented support for long/short quantity (positions only).

jodastephen added 2 commits Jun 13, 2018
Allows pricing without reference data
Remove undocumented support for long/short quantity (positions only)
@jodastephen jodastephen force-pushed the topic/security-csv branch from 221215f to 7ab368e Jun 15, 2018
/**
* The column name for the tick size.
*/
public static final String TICK_VALUE = "Tick Value";

This comment has been minimized.

@Mistuus

Mistuus Jun 15, 2018
Contributor

probably a copy-paste error. Should be tick value

positions.add(posType.cast(SecurityCsvLoader.parseSimple(row, info, resolver)));
if (posType == SecurityPosition.class || posType == ResolvableSecurityPosition.class) {
positions.add(posType.cast(SecurityCsvLoader.parseBase(row, info, resolver)));

This comment has been minimized.

@Mistuus

Mistuus Jun 15, 2018
Contributor

Space not required

@@ -92,19 +131,12 @@ static SecurityPosition parsePositionLightweight(CsvRow row, PositionInfo info,
}
} else {
// simple
return parseSimple(row, info, resolver);
return parseBase(row, info, resolver);

This comment has been minimized.

@Mistuus

Mistuus Jun 15, 2018
Contributor

Is the comment still applicable?

*/
static SecurityPosition parseSimple(CsvRow row, PositionInfo info, PositionCsvInfoResolver resolver) {
// parses the base SecurityPosition
static SecurityPosition parseBase(CsvRow row, PositionInfo info, PositionCsvInfoResolver resolver) {

This comment has been minimized.

@Mistuus

Mistuus Jun 15, 2018
Contributor

I see we've got javadocs for the other static methods, could you add one for this one please?

This comment has been minimized.

@Mistuus

Mistuus Jun 15, 2018
Contributor

I feel like the method naming could be more explicative but can't really find a better alternative for this one and parseSimple(). Up to you if you think you can improve them.

@@ -113,6 +145,22 @@ static SecurityPosition parseSimple(CsvRow row, PositionInfo info, PositionCsvIn
return resolver.completePosition(row, position);
}

// parses the additional GenericSecurityPosition information
static Position parseSimple(CsvRow row, PositionInfo info, PositionCsvInfoResolver resolver) {

This comment has been minimized.

@Mistuus

Mistuus Jun 15, 2018
Contributor

Same javadoc and method name comment.

.price(17.8)
.build();
assertBeanEquals(expected2, filtered.get(1));
}

public void test_load_generiSecurity() {

This comment has been minimized.

@Mistuus

Mistuus Jun 15, 2018
Contributor

typo 'genericSecurity'

@jodastephen jodastephen merged commit 797db63 into master Jun 15, 2018
15 checks passed
15 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
security/snyk - modules/basics/pom.xml No dependency changes
Details
security/snyk - modules/calc/pom.xml No dependency changes
Details
security/snyk - modules/collect/pom.xml No dependency changes
Details
security/snyk - modules/data/pom.xml No dependency changes
Details
security/snyk - modules/loader/pom.xml No dependency changes
Details
security/snyk - modules/market/pom.xml No dependency changes
Details
security/snyk - modules/math/pom.xml No dependency changes
Details
security/snyk - modules/measure/pom.xml No dependency changes
Details
security/snyk - modules/pom.xml No dependency changes
Details
security/snyk - modules/pricer/pom.xml No dependency changes
Details
security/snyk - modules/product/pom.xml No dependency changes
Details
security/snyk - modules/report/pom.xml No dependency changes
Details
security/snyk - pom.xml No dependency changes
Details
@jodastephen jodastephen deleted the topic/security-csv branch Jun 15, 2018
@jodastephen jodastephen added this to the v2.0 milestone Jun 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants