Convert an absolute dollar amount to a percentage of a cost basis.
Use the result as the percent argument to commitPartialProfit / commitPartialLoss.
IMPORTANT: percentToClose in partial closes is applied to the REMAINING
cost basis (what is still held after prior partials), not to the total
invested amount. To close an exact dollar amount, pass the remaining cost
basis from getTotalCostClosed as costBasis — not getPositionInvestedCost.
Convert an absolute dollar amount to a percentage of a cost basis. Use the result as the
percentargument tocommitPartialProfit/commitPartialLoss.IMPORTANT:
percentToClosein partial closes is applied to the REMAINING cost basis (what is still held after prior partials), not to the total invested amount. To close an exact dollar amount, pass the remaining cost basis fromgetTotalCostClosedascostBasis— notgetPositionInvestedCost.Example