So could you please tell what's the difference between positionprofit and positionprofit_checked keywords?
These commands work with the Realized PnL only, so you need to have at least a partially filled order in the current position for it to return any value. The only difference is the following: If PosBack value is greater that the real number of previously opened positions, PositionProfit_Checked will generate an error.
i did try these 2 in my script for checking the profit of the current position, they both showed '0' while openpositionprofit showed the unrealized profit in the current position.
That's expected. OpenPositionProfit is specifically designed to show the unrealized profit for the current position, while positionprofit and positionprofit_checked work with the realized PnL.