Skip to content

Commit

Permalink
Renamed FixedCommissionModel to FixedFeeModel
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Apr 13, 2024
1 parent d28da76 commit c7c1a9e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Released on TBD (UTC).

### Enhancements
- Implemented `FeeModel` including `FixedCommissionModel` and `MakerTakerFeeModel` (#1584), thanks @rsmb7z
- Implemented `FeeModel` including `FixedFeeModel` and `MakerTakerFeeModel` (#1584), thanks @rsmb7z
- Implemented `TradeTickDataWrangler.process_bar_data` (#1585), thanks @rsmb7z
- Implemented multiple timeframe bar execution (will use lowest timeframe per instrument)
- Standardized adapter client logging (handle more logging from client base classes)
Expand Down
2 changes: 1 addition & 1 deletion nautilus_trader/backtest/models.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ cdef class FeeModel:
cdef class MakerTakerFeeModel(FeeModel):
pass

cdef class FixedCommissionModel(FeeModel):
cdef class FixedFeeModel(FeeModel):
cdef Money _commission
7 changes: 3 additions & 4 deletions nautilus_trader/backtest/models.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ cdef class MakerTakerFeeModel(FeeModel):
return commission


cdef class FixedCommissionModel(FeeModel):
cdef class FixedFeeModel(FeeModel):
"""
Provides a fixed commission model for trades.
Provides a fixed fee model for trades.
Parameters
----------
Expand All @@ -252,8 +252,7 @@ cdef class FixedCommissionModel(FeeModel):
"""

def __init__(self, Money commission):
Condition.type(commission, Money, "commission")
def __init__(self, Money commission not None):
Condition.positive(commission, "commission")

self._commission = commission
Expand Down
4 changes: 2 additions & 2 deletions tests/unit_tests/backtest/test_commission_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import pytest

# fmt: off
from nautilus_trader.backtest.models import FixedCommissionModel
from nautilus_trader.backtest.models import FixedFeeModel
from nautilus_trader.backtest.models import MakerTakerFeeModel
from nautilus_trader.model.currencies import USD
from nautilus_trader.model.enums import OrderSide
Expand Down Expand Up @@ -55,7 +55,7 @@ def sell_order(instrument: Instrument) -> Order:
def test_fixed_commission(buy_order, instrument):
# Arrange
expected = Money(1, USD)
fee_model = FixedCommissionModel(expected)
fee_model = FixedFeeModel(expected)

# Act
commission = fee_model.get_commission(
Expand Down

0 comments on commit c7c1a9e

Please sign in to comment.