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.