Position.Size as of current bar?
Author: innertrader
Creation Date: 4/2/2014 7:10 PM
profile picture

innertrader

#1
It appears that the LastPosition.Size property returns the dollar value of the position on the entry date, not the Bar date (i.e. current market value of position). Is there another property that provides this? I am trying to estimate the cash that will be generated by the sale of a split position.

If none exists then I am thinking of using something like:

CODE:
Please log in to see this code.


Do you agree?
profile picture

Eugene

#2
That's right: the Size property returns the dollar size of the position i.e. the shares multiplied by the entry price (or by the margin for futures). In portfolio simulation mode though, all trades are pre-executed using 1 share per Position anyway, so your strategy's results are always based on 1 share while it is executing. Consequently, the correct dollar value on a given bar is available after Strategy execution in a module like PosSizer or Performance Visualizer.
profile picture

Cone

#3
but...
you can access the actual dollar size of a position in a Strategy in Raw Profit mode or if using "WealthScript Override (SetShareSize)" in Portforlio Sim. mode.
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).