Is GetPositionValue() based on today's close?

The manual does not especify which price GetPositionValue() is based on

Using TRACE it seems to me that the value of GetPositionValue() is calculated using today's close multiplied by the number of shares minus commisions. If that's the case the following code cannot balance positions today at open since it uses today's close for calculating the number of shares to scale:

I am using a modification of the code above for my own proposes so I need to understand what I am misunderstanding here. Please help.

Thank you

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.