- ago
Hello,

I have been trying to set commission from code with

Position p = LastPosition;

p.EntryCommission = 10;
p.ExitCommission = 10;

But it is not working. How should I set the commission from the code?

Thanks
1
1,017
10 Replies

Reply

Bookmark

Sort
- ago
#1
As says the QuickRef, it's a getter property which returns the commission for the Position. One cannot use it or whatever to set commission from code. This is not supported currently.
0
- ago
#2
In WL6 it was possible to do it. Can we add this feature? I do not see any reason why it was changed.
0
- ago
#3
QUOTE:
I do not see any reason why it was changed.

Maybe the fact that WL7 was created from scratch with a different workflow may justify for the reason why it's changed.😉
0
- ago
#4
Can you tell what's your goal i.e. why are you trying to set commission from the code?
0
- ago
#5
When you are working with years of data, it doesnt work to have a static commission. Lots of parameters are changing and I am sure many people will have problems with it in the future. I need to assign commissions programmatically. I will be happy if you can include this in your list for next update.
0
- ago
#6
I am paying per the contract I trade plus the nominal value of the trade itself. I need to add up these two and nominal value of the trade varies with every trade. Also the commission per contract has increased in recent years and in the beginning of backtest and end of it the commission per contract is not the same.
0
- ago
#7
Let's mark this topic as a #FeatureRequest. If it raises to the top it will be considered. You can vote for it from there:
https://www.wealth-lab.com/wishlist
0
Cone8
 ( 5.57% )
- ago
#8
QUOTE:
When you are working with years of data, it doesnt work to have a static commission.
I used to think this way too, but no more. We don't live in the high commission environment of 10, or even worse, 20+ years ago. The goal is to use the historical data to see how your strategy would perform now. Sure, a strategy burdened by higher commissions wouldn't perform as well before, but that no longer matters because you won't be paying those commissions now.
1
- ago
#9
I was including the spread and slippage also as a cost in the commission section. These definetely varies greatly over time and if you have an intraday strategy these costs might make or break your strategy. I still believe it is quite important to give the flexibility inside the code. The spread for SPX 5 years before and now is not the same.
1
MIH8
- ago
#10
Hello mthta,

it is not relevant how the commissions were in the past.

First of all, you are not measuring the past but simulating a potential future with data from the past. This is a relevant difference.

Second, unlike market data, you already know today's and tomorrow's costs and can use them for the simulation to see into the potential future.

By combining the two statements, this leads to the following question.
If the market were to go this way and I use today's cost model, where might I end up at time X?

Now if the cost model or the costs really change in the future, the settings can be adjusted from that point.

Well, at least that's my perspective.
1

Reply

Bookmark

Sort