Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/cetusfinance/qwack
Browse files Browse the repository at this point in the history
  • Loading branch information
gavbrennan committed Apr 18, 2022
2 parents 6729af4 + 89c2ac4 commit 3079276
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Qwack.Core/Instruments/Portfolio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ public static (Portfolio newTrades, Portfolio removedTrades, Portfolio ammendedT
FloatingRateLoanDepo loanDepositFl => loanDepositFl.Notional,
CashWrapper wrapper => wrapper.UnderlyingInstrument.Notional(),
ETC etc => etc.Notional,
CashAsset ca => ca.Notional,
_ => 0.0,
};

Expand Down
12 changes: 12 additions & 0 deletions src/Qwack.Futures/FutureCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ public DateTime GetExpiry()
.IfHolidayRollBack(_settings.RollGen.CalendarObject)
.Day;
break;
case "LASTWED":
var dateInMonth4 = new DateTime(YearNumber, monthNum, 1);
dayOfMonthToStart = dateInMonth4.NthLastSpecificWeekDay(DayOfWeek.Wednesday, 1)
.IfHolidayRollBack(_settings.RollGen.CalendarObject)
.Day;
break;
case "LASTMON-EUA":
var dateInMonth3 = new DateTime(YearNumber, monthNum, 1);
var lastMon = dateInMonth3.NthLastSpecificWeekDay(DayOfWeek.Monday, 1);
Expand Down Expand Up @@ -253,6 +259,12 @@ public DateTime GetRollDate()
.IfHolidayRollBack(_settings.RollGen.CalendarObject)
.Day;
break;
case "LASTWED":
var dateInMonth4 = new DateTime(YearNumber, monthNum, 1);
dayOfMonthToStart = dateInMonth4.NthLastSpecificWeekDay(DayOfWeek.Wednesday, 1)
.IfHolidayRollBack(_settings.RollGen.CalendarObject)
.Day;
break;
case "LASTMON-EUA":
var dateInMonth3 = new DateTime(YearNumber, monthNum, 1);
var lastMon = dateInMonth3.NthLastSpecificWeekDay(DayOfWeek.Monday, 1);
Expand Down

0 comments on commit 3079276

Please sign in to comment.