How do i retrieve VWAP of positions ?
-
What is backtrader's equivalent of the cost_basis attribute in quantopian's position object ?
https://www.quantopian.com/help#api-position -
Another side question to avoid duplicates, how does one calculate sharpe ratio of multiple stocks combined in backtrader ?
-
@guachesuede said in How do i retrieve VWAP of positions ?:
What is backtrader's equivalent of the cost_basis attribute in quantopian's position object ?
https://www.quantopian.com/help#api-positionIt is
self.position.price
within thestrategy
. The value is updated each time the size changes. -
@guachesuede said in How do i retrieve VWAP of positions ?:
Another side question to avoid duplicates, how does one calculate sharpe ratio of multiple stocks combined in backtrader ?
Sharpe ratio is calculated based on the returns == equity (broker's value) changes. It is independent from the number of stocks traded.