Are there any pitfalls to modifying the trade function?

The trade function returns the order stub which contains the order quantity among other fields. The order quantity is determined as a percentage of the NLV.

I have overridden the trade function to create order stubs with a fixed number of order quantity independent of NLV. Are there any pitfalls to overriding the trade function?

It's fine to override the trade function. There shouldn't be any pitfalls.

Another approach for what you're trying to achieve is to set the allocation and weights to something higher than you want, then use limit_position_sizes to set lower, fixed quantities. Either approach is totally fine. More on the second approach in the usage guide.

1 Like