Record Class PortfolioBacktester.Financing
java.lang.Object
java.lang.Record
com.quantfinlib.backtest.portfolio.PortfolioBacktester.Financing
- Record Components:
cashRate- rate earned on positive cash (0.03 = 3%)marginRate- rate paid on negative cash (leverage)defaultBorrowBps- borrow fee on short notional, bps per yearborrowBpsBySymbol- per-symbol borrow fee overrides (hard-to-borrow names)
- Enclosing class:
PortfolioBacktester
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theborrowBpsBySymbolrecord component.doublecashRate()Returns the value of thecashRaterecord component.doubleReturns the value of thedefaultBorrowBpsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the value of themarginRaterecord component.none()No financing: cash, leverage and shorts are free.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Financing
public Financing(double cashRate, double marginRate, double defaultBorrowBps, Map<String, Double> borrowBpsBySymbol) Creates an instance of aFinancingrecord class.- Parameters:
cashRate- the value for thecashRaterecord componentmarginRate- the value for themarginRaterecord componentdefaultBorrowBps- the value for thedefaultBorrowBpsrecord componentborrowBpsBySymbol- the value for theborrowBpsBySymbolrecord component
-
-
Method Details
-
none
No financing: cash, leverage and shorts are free. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
cashRate
-
marginRate
public double marginRate()Returns the value of themarginRaterecord component.- Returns:
- the value of the
marginRaterecord component
-
defaultBorrowBps
public double defaultBorrowBps()Returns the value of thedefaultBorrowBpsrecord component.- Returns:
- the value of the
defaultBorrowBpsrecord component
-
borrowBpsBySymbol
Returns the value of theborrowBpsBySymbolrecord component.- Returns:
- the value of the
borrowBpsBySymbolrecord component
-