Get number of shares for current bar?
Author: BAJER
Creation Date: 1/5/2018 11:02 PM
profile picture


Is there a function that would get # of shares for current bar in the trading loop? Do I need to keep track of this separately? If so, any ideas on how to do this.

My goal is to make a strategy decision about how many additional shares to buy, or how many to sell based on the strategy and the current purchased share total for the bar.

profile picture



There is no built-in function for the number of shares (current equity etc.) but you will find a workaround in this FAQ:

How to display portfolio equity (exposure, drawdown etc.) series and/or interact dynamically with the portfolio level equity in Strategy?
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).