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

Add IB Tiered Fee Model #8446

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Algorithm.Python/InteractiveBrokersTieredFeeModelAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# limitations under the License.

from AlgorithmImports import *
from Orders.Fees.InteractiveBrokersTieredFeeModel import InteractiveBrokersTieredFeeModel

### <summary>
### Test algorithm using "InteractiveBrokersTieredFeeModel"
Expand All @@ -21,9 +22,9 @@ class InteractiveBrokersTieredFeeModelAlgorithm(QCAlgorithm):

def initialize(self):
''' Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''
self.set_start_date(2013, 10, 7) #Set Start Date
self.set_end_date(2013, 10, 10) #Set End Date
self.set_cash(1000000000) #Set Strategy Cash
self.set_start_date(2013, 10, 7) #Set Start Date
self.set_end_date(2013, 10, 10) #Set End Date
self.set_cash(1000000000) #Set Strategy Cash

# Set the fee model to be shared by all securities to accurately track the volume/value traded to select the correct tiered fee structure.
self.set_security_initializer(lambda security: security.set_fee_model(self.fee_model))
Expand Down
584 changes: 584 additions & 0 deletions Common/Orders/Fees/InteractiveBrokersFeeHelper.cs

Large diffs are not rendered by default.

386 changes: 15 additions & 371 deletions Common/Orders/Fees/InteractiveBrokersFeeModel.cs

Large diffs are not rendered by default.

559 changes: 32 additions & 527 deletions Common/Orders/Fees/InteractiveBrokersTieredFeeModel.cs

Large diffs are not rendered by default.

554 changes: 554 additions & 0 deletions Common/Orders/Fees/InteractiveBrokersTieredFeeModel.py

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions Common/QuantConnect.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackageCopyToOutput>true</PackageCopyToOutput>
</Content>
<Content Include="Orders\Slippage\VolumeShareSlippageModel.py">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Orders\Fees\InteractiveBrokersTieredFeeModel.py">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackageCopyToOutput>true</PackageCopyToOutput>
</Content>
<Content Include="Orders\Slippage\VolumeShareSlippageModel.py">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>
224 changes: 112 additions & 112 deletions Tests/Common/Orders/Fees/InteractiveBrokersFeeModelTests.cs

Large diffs are not rendered by default.

600 changes: 300 additions & 300 deletions Tests/Common/Orders/Fees/InteractiveBrokersTieredFeeModelTests.cs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to run at least a few of these tests for the Python model as well? Just to make sure they are always kept the same when changed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC: @LouisSzeto 👁️

Large diffs are not rendered by default.