Skip to content

Commit af30aef

Browse files
committed
Add Excel wrappers for more products and curve node types
Added: - IborFixingDeposit - TermDeposit - Fra - FxNdf - FxSingle - FxSwap - IborFuture - FixedInflationSwap - FixedRateSwapLeg - IborIborSwap - InflationRateSwapLeg - OvernightIborSwap - ThreeLegBasisSwap - XCcyIborIborSwap
1 parent 198cc5d commit af30aef

File tree

75 files changed

+5122
-202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+5122
-202
lines changed

examples/swap-pricer.xlsx

1.21 KB
Binary file not shown.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* THIS FILE IS AUTO-GENERATED
3+
*
4+
* Copyright (C) 2017 - present by Tony Roberts.
5+
*
6+
* Please see distribution for license.
7+
*
8+
*/
9+
package com.exceljava.strataexcel.basics.currency;
10+
11+
import com.exceljava.jinx.ExcelAddIn;
12+
import com.exceljava.jinx.ExcelArgument;
13+
import com.exceljava.jinx.ExcelArguments;
14+
import com.exceljava.jinx.ExcelFunction;
15+
import com.opengamma.strata.basics.currency.Currency;
16+
import com.opengamma.strata.basics.currency.FxRate;
17+
18+
19+
public class FxRateXL {
20+
private final ExcelAddIn xl;
21+
22+
public FxRateXL(ExcelAddIn xl) {
23+
this.xl = xl;
24+
}
25+
26+
@ExcelFunction(
27+
value = "og.FxRate.of",
28+
category = "Strata",
29+
isThreadSafe = true
30+
)
31+
@ExcelArguments({
32+
@ExcelArgument("base"),
33+
@ExcelArgument("counter"),
34+
@ExcelArgument("rate")
35+
})
36+
public FxRate of(Currency base, Currency counter, double rate) {
37+
return FxRate.of(base, counter, rate);
38+
}
39+
40+
@ExcelFunction(
41+
value = "og.FxRate.toString",
42+
category = "Strata",
43+
isThreadSafe = true
44+
)
45+
@ExcelArguments({
46+
@ExcelArgument("fxRate")
47+
})
48+
public String toString(FxRate fxRate) {
49+
return fxRate.toString();
50+
}
51+
}

src/main/java/com/exceljava/strataexcel/basics/date/TenorXL.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import com.exceljava.jinx.ExcelArguments;
1515
import com.exceljava.jinx.ExcelFunction;
1616
import com.opengamma.strata.basics.date.Tenor;
17+
import java.time.Period;
1718

1819

1920
public class TenorXL {
@@ -392,6 +393,19 @@ public Tenor TENOR_9Y() {
392393
return Tenor.TENOR_9Y;
393394
}
394395

396+
@ExcelArgumentConverter
397+
@ExcelFunction(
398+
value = "og.Tenor.getPeriod",
399+
category = "Strata",
400+
isThreadSafe = true
401+
)
402+
@ExcelArguments({
403+
@ExcelArgument("tenor")
404+
})
405+
public Period getPeriod(Tenor tenor) {
406+
return tenor.getPeriod();
407+
}
408+
395409
@ExcelArgumentConverter
396410
@ExcelFunction(
397411
value = "og.Tenor.parse",
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* THIS FILE IS AUTO-GENERATED
3+
*
4+
* Copyright (C) 2017 - present by Tony Roberts.
5+
*
6+
* Please see distribution for license.
7+
*
8+
*/
9+
package com.exceljava.strataexcel.basics.index;
10+
11+
import com.exceljava.jinx.ExcelAddIn;
12+
import com.exceljava.jinx.ExcelArgument;
13+
import com.exceljava.jinx.ExcelArgumentConverter;
14+
import com.exceljava.jinx.ExcelArguments;
15+
import com.exceljava.jinx.ExcelFunction;
16+
import com.opengamma.strata.basics.date.Tenor;
17+
import com.opengamma.strata.basics.index.FloatingRateIndex;
18+
19+
20+
public class FloatingRateIndexXL {
21+
private final ExcelAddIn xl;
22+
23+
public FloatingRateIndexXL(ExcelAddIn xl) {
24+
this.xl = xl;
25+
}
26+
27+
@ExcelArgumentConverter
28+
@ExcelFunction(
29+
value = "og.FloatingRateIndex.parse",
30+
category = "Strata",
31+
isThreadSafe = true
32+
)
33+
@ExcelArguments({
34+
@ExcelArgument("indexStr")
35+
})
36+
public FloatingRateIndex parse(String indexStr) {
37+
return FloatingRateIndex.parse(indexStr);
38+
}
39+
40+
@ExcelFunction(
41+
value = "og.FloatingRateIndex.parseWithTenor",
42+
category = "Strata",
43+
isThreadSafe = true
44+
)
45+
@ExcelArguments({
46+
@ExcelArgument("indexStr"),
47+
@ExcelArgument("defaultIborTenor")
48+
})
49+
public FloatingRateIndex parse(String indexStr, Tenor defaultIborTenor) {
50+
return FloatingRateIndex.parse(indexStr, defaultIborTenor);
51+
}
52+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* THIS FILE IS AUTO-GENERATED
3+
*
4+
* Copyright (C) 2017 - present by Tony Roberts.
5+
*
6+
* Please see distribution for license.
7+
*
8+
*/
9+
package com.exceljava.strataexcel.basics.index;
10+
11+
import com.exceljava.jinx.ExcelAddIn;
12+
import com.exceljava.jinx.ExcelArgument;
13+
import com.exceljava.jinx.ExcelArgumentConverter;
14+
import com.exceljava.jinx.ExcelArguments;
15+
import com.exceljava.jinx.ExcelFunction;
16+
import com.opengamma.strata.basics.index.PriceIndex;
17+
18+
19+
public class PriceIndexXL {
20+
private final ExcelAddIn xl;
21+
22+
public PriceIndexXL(ExcelAddIn xl) {
23+
this.xl = xl;
24+
}
25+
26+
@ExcelArgumentConverter
27+
@ExcelFunction(
28+
value = "og.PriceIndex.of",
29+
category = "Strata",
30+
isThreadSafe = true
31+
)
32+
@ExcelArguments({
33+
@ExcelArgument("uniqueName")
34+
})
35+
public PriceIndex of(String uniqueName) {
36+
return PriceIndex.of(uniqueName);
37+
}
38+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* THIS FILE IS AUTO-GENERATED
3+
*
4+
* Copyright (C) 2017 - present by Tony Roberts.
5+
*
6+
* Please see distribution for license.
7+
*
8+
*/
9+
package com.exceljava.strataexcel.data;
10+
11+
import com.exceljava.jinx.ExcelAddIn;
12+
import com.exceljava.jinx.ExcelArgument;
13+
import com.exceljava.jinx.ExcelArgumentConverter;
14+
import com.exceljava.jinx.ExcelArguments;
15+
import com.exceljava.jinx.ExcelFunction;
16+
import com.opengamma.strata.data.FxMatrixId;
17+
import com.opengamma.strata.data.ObservableSource;
18+
19+
20+
public class FxMatrixIdXL {
21+
private final ExcelAddIn xl;
22+
23+
public FxMatrixIdXL(ExcelAddIn xl) {
24+
this.xl = xl;
25+
}
26+
27+
@ExcelArgumentConverter
28+
@ExcelFunction(
29+
value = "og.FxMatrixId.of",
30+
category = "Strata",
31+
isThreadSafe = true
32+
)
33+
@ExcelArguments({
34+
@ExcelArgument("observableSource")
35+
})
36+
public FxMatrixId of(ObservableSource observableSource) {
37+
return FxMatrixId.of(observableSource);
38+
}
39+
40+
@ExcelFunction(
41+
value = "og.FxMatrixId.toString",
42+
category = "Strata",
43+
isThreadSafe = true
44+
)
45+
@ExcelArguments({
46+
@ExcelArgument("fxMatrixId")
47+
})
48+
public String toString(FxMatrixId fxMatrixId) {
49+
return fxMatrixId.toString();
50+
}
51+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* THIS FILE IS AUTO-GENERATED
3+
*
4+
* Copyright (C) 2017 - present by Tony Roberts.
5+
*
6+
* Please see distribution for license.
7+
*
8+
*/
9+
package com.exceljava.strataexcel.data;
10+
11+
import com.exceljava.jinx.ExcelAddIn;
12+
import com.exceljava.jinx.ExcelArgument;
13+
import com.exceljava.jinx.ExcelArguments;
14+
import com.exceljava.jinx.ExcelFunction;
15+
import com.opengamma.strata.basics.currency.Currency;
16+
import com.opengamma.strata.data.FxRateId;
17+
18+
19+
public class FxRateIdXL {
20+
private final ExcelAddIn xl;
21+
22+
public FxRateIdXL(ExcelAddIn xl) {
23+
this.xl = xl;
24+
}
25+
26+
@ExcelFunction(
27+
value = "og.FxRateId.of",
28+
category = "Strata",
29+
isThreadSafe = true
30+
)
31+
@ExcelArguments({
32+
@ExcelArgument("base"),
33+
@ExcelArgument("counter")
34+
})
35+
public FxRateId of(Currency base, Currency counter) {
36+
return FxRateId.of(base, counter);
37+
}
38+
39+
@ExcelFunction(
40+
value = "og.FxRateId.toString",
41+
category = "Strata",
42+
isThreadSafe = true
43+
)
44+
@ExcelArguments({
45+
@ExcelArgument("fxRateId")
46+
})
47+
public String toString(FxRateId fxRateId) {
48+
return fxRateId.toString();
49+
}
50+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* THIS FILE IS AUTO-GENERATED
3+
*
4+
* Copyright (C) 2017 - present by Tony Roberts.
5+
*
6+
* Please see distribution for license.
7+
*
8+
*/
9+
package com.exceljava.strataexcel.data;
10+
11+
import com.exceljava.jinx.ExcelAddIn;
12+
import com.exceljava.jinx.ExcelArgument;
13+
import com.exceljava.jinx.ExcelArgumentConverter;
14+
import com.exceljava.jinx.ExcelArguments;
15+
import com.exceljava.jinx.ExcelFunction;
16+
import com.opengamma.strata.data.ObservableSource;
17+
18+
19+
public class ObservableSourceXL {
20+
private final ExcelAddIn xl;
21+
22+
public ObservableSourceXL(ExcelAddIn xl) {
23+
this.xl = xl;
24+
}
25+
26+
@ExcelFunction(
27+
value = "og.ObservableSource.NONE",
28+
category = "Strata",
29+
isThreadSafe = true
30+
)
31+
public ObservableSource NONE() {
32+
return ObservableSource.NONE;
33+
}
34+
35+
@ExcelArgumentConverter
36+
@ExcelFunction(
37+
value = "og.ObservableSource.of",
38+
category = "Strata",
39+
isThreadSafe = true
40+
)
41+
@ExcelArguments({
42+
@ExcelArgument("name")
43+
})
44+
public ObservableSource of(String name) {
45+
return ObservableSource.of(name);
46+
}
47+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* THIS FILE IS AUTO-GENERATED
3+
*
4+
* Copyright (C) 2017 - present by Tony Roberts.
5+
*
6+
* Please see distribution for license.
7+
*
8+
*/
9+
package com.exceljava.strataexcel.market.curve.node;
10+
11+
import com.exceljava.jinx.ExcelAddIn;
12+
import com.exceljava.jinx.ExcelArgument;
13+
import com.exceljava.jinx.ExcelArguments;
14+
import com.exceljava.jinx.ExcelFunction;
15+
import com.opengamma.strata.market.curve.node.FixedInflationSwapCurveNode;
16+
17+
18+
public class FixedInflationSwapCurveNodeXL {
19+
private final ExcelAddIn xl;
20+
21+
public FixedInflationSwapCurveNodeXL(ExcelAddIn xl) {
22+
this.xl = xl;
23+
}
24+
25+
@ExcelFunction(
26+
value = "og.FixedInflationSwapCurveNode.toString",
27+
category = "Strata",
28+
isThreadSafe = true
29+
)
30+
@ExcelArguments({
31+
@ExcelArgument("fixedInflationSwapCurveNode")
32+
})
33+
public String toString(FixedInflationSwapCurveNode fixedInflationSwapCurveNode) {
34+
return fixedInflationSwapCurveNode.toString();
35+
}
36+
}

0 commit comments

Comments
 (0)