Quick Questions regarding comissions
-
How may I set commissions/transaction costs based of no. of shares ?
How does backtrader differentiate between a short sell and long that checks how it applies the interest parameter from .setcommission ? (in realation to when i use the self.sell() method, how is it different from a normal sell, does backtrader keep track of previous positions/trades to perform the short operation ?)
Thanks for your time.
-
This is all done with CommissionInfo objects (which can be quickly set via the broker or permanently customized with subclasses)
- Docs - Commissions
- Docs - Extending Comissions
- Docs - User Defined Commissions
- Docs - Commissions - Credit
@guachesuede said in Quick Questions regarding comissions:
How may I set commissions/transaction costs based of no. of shares ?
It is the standard mode. Choose if it is a percentage based commission or an absolute value one.
@guachesuede said in Quick Questions regarding comissions:
How does backtrader differentiate between a short sell and long that checks how it applies the interest parameter from .setcommission ?
See the documentation for
Credit
above.@guachesuede said in Quick Questions regarding comissions:
in realation to when i use the self.sell() method, how is it different from a normal sell
There is no special and normal
sell
. There is only one. The CommissionInfo schemes control what happens.@guachesuede said in Quick Questions regarding comissions:
does backtrader keep track of previous positions/trades to perform the short operation ?
backtrader keeps track of trades and positions. You are notified via
notify_trade
and you can always get the current position withgetposition
-
@backtrader Thanks for the reply. May i ask how do i get a list of buy/sells made ? Or must it be manually managed ?
-
You are notified of order execution in
notify_order
. Keep a reference to those that are interesting for you.