- ago
I have a need to define a specific commission schedule for a strategy, separate from the generic setting I have set under Preferences. Accordingly, added this code:
CODE:
BacktestSettings.CommissionType = CommissionType.PerShare; BacktestSettings.CommissionAmount = 0.01;    //0.01 per share


Works as expected.

Decided to add a minimum commission rule as well:
CODE:
BacktestSettings.CommissionType = CommissionType.PerShare; BacktestSettings.CommissionAmount = 0.01;    //0.01 per share BacktestSettings.MinimumCommission = 1.00;      //commission cannot be less than this


But this doesn't work, meaning trades of less than 100 shares continue to show commission @0.01/share instead of 1.00 as would be expected.

Qs:
1) Is there something wrong with my code?
2) Are the commission amount and minimum commission settings mutually exclusive and cannot be used together? If so, why not?
0
344
Solved
13 Replies

Reply

Bookmark

Sort
MIH8
- ago
#1
Hello.

There is a rule (from IB) that works like ...

QUOTE:

In the event the calculated maximum per order is less than the minimum per order, the maximum per order will be assessed. For example, a purchase to buy 10 shares of a $0.20 stock will be charged $0.02 (10 shares x 0.005/share = 0.05 commission, minimum 1.00 per Order, capped at 10 shares x 0.20 x 1% = 0.02).


You can have a look in the heated :-) discussion some months ago.
https://www.wealth-lab.com/Discussion/Commissions-configure-minimum-maximum-basic-separately-7862

There are some references/links for IB. If you are talking of a different broker maybe there is a conflict. Maybe that's a start.
0
- ago
#2
Thanks for the response, MIH.
I need to code this inside the strategy as its separate from the settings under Preferences.
What I can't figure out is why the minimum commission is not kicking in when it should.
0
Glitch8
 ( 10.41% )
- ago
#3
The BacktestSettings.Commission is currently not settable, and always just returns whatever commission is defined in Preferences. For Build 28 I changed things so you can assign a Commision to the Strategy BacktestSettings, so after the next release this will work:

CODE:
public override void Initialize(BarHistory bars) {          Commission c = new Commission();          c.CommissionType = CommissionType.PerShare;          c.Amount = 0.01;          c.Minimum = 1.0;          BacktestSettings.Commission = c;       }
0
Best Answer
- ago
#4
Thanks!!
0
MIH8
- ago
#5
I assume that setting the commission values does not change how they are applied in the end.
If so, the behaviour described may still occur. The application logic will not be able to be overwritten I think.

Glitch, can you confirm this?
0
Glitch8
 ( 10.41% )
- ago
#6
Can you give an example of the behavior you’re calling out, I’m having trouble understanding.
0
MIH8
- ago
#7
The example in #1 is taken directly from IB. The note 8 from https://www.interactivebrokers.com/en/index.php?f=commission.

minimum is $1.00 <= commission is value per share * number of shares <= maximum is 0.5% of tradevalue

So if the tradevalue is $150, then 0.5% is $0.75. Now there is a conflict because the minimum rule and the maximum rule contradict each other. Do you take 1$ (minimum) or 0.75$ (maximum). The additional rule you see above deals with this case.

Another example:
100 shares for $80, so $0.8 per share, would mean in general 100 x 0.005 = $0.5 but the minimum $1 kicks in.
The commission according to the maximum rule is 0.5% of $80 is $0.4 below the minimum $1. The commission should be $0.4
0
Cone8
 ( 24.57% )
- ago
#8
QUOTE:
The commission should be $0.4
... if the minimum is $1.00???

Glitch, do you have any objections if I add an "IB Stocks" commission? There aren't many U.S. brokers that still charge commission to trade stocks, but it may even be worthwhile for any user to test it before moving an account to IB.

Edit - disregard.
It's already possible to get IBKR Pro commissions with the settings available.
0
MIH8
- ago
#9
Hi Cone.

I am not sure how to interpret your post. There is no intention on my part to change anything because using the current settings is a bit more pessimistic, so it is safer.

My point is, that setting values in the code does not change the applied logic behind. (like in the example).

However, I would like to make two comments.
Some of the brokers that are so cheap can only be used as US residents, which reduces the choice. Even 1$ doesn't sound much at first, but if you trade with a small account, let's say $10000, and want to scalp in the intraday context, this is doubly noticeable. If you make one 1% profit a day with 10 trades, that's $20 (buy+sell * 10) out of $100 in commission while at the same time the profit is harder to make per trade compared to EOD. This puts the importance of commissions in a different light. In this case $4 would be much better than $20.

Unfortunately, I don't know the other brokers. However, I can imagine that some of them call up their fees indirectly via spreads. That would not be nearly as transparent for the trader and is usually more expensive. The marketing effect is then "no commissions" for shares.
0
Cone8
 ( 24.57% )
- ago
#10
QUOTE:
...using the current settings is a bit more pessimistic, so it is safer.
They're not more pessimistic because you can implement the IBRK Pro commissions precisely - 0.005 per share, $1 Minimum, and 0.5% Maximum - it's all there.
0
MIH8
- ago
#11
How often we talk past each other. The rule mentioned (which definitely exists as note 8 in the IB description) is cheaper when implemented. There are trades that can be cheaper than the $1 minimum, so using always $1 as the minimum is the more pessimistic option. So, it is.

I don't want to make this rule an issue either. It would only have been a possible answer to the initial question. All good.
1
Glitch8
 ( 10.41% )
- ago
#12
The maximum is calculated and applied after the minimum is calculated and applied, so it would take the maximum if there is a conflict.
0
MIH8
- ago
#13
This would then cover the rule and means for the initial question that there are also values smaller than $1 if the maximum is smaller than the minimum. Apart from the fact that the values are not taken from the code, such an observation can also be made as soon as the values are taken over (in rare cases). This would be correct and intended behaviour then.
0

Reply

Bookmark

Sort