ContractProfit (Reserved Word)

image\trumpet2.gif Disclaimer

Calculates the Position Profit per contract or share. ContractProfit divides the current position profit by the number of outstanding shares or contracts for the position profit for a single share or contract.

ContractProfit

Remarks

The reserved words ContractProfit and MaxContractProfit include both closed profits and losses and open profits and losses in their calculations.  The sum of open and closed P&L is then divided by only the number of shares in the open position to obtain the value returned by ContractProfit or MaxContractProfit.  For this reason, when scaling out of a position using exits that do not exit the entire position all at once, the values returned by these reserved words will not be the profit or max profit per open contract or share.  Instead, the value returned is the result of this calculation:

ContractProfit = ( Closed P&L + Open P&L ) / Number of Open Shares (or contracts)

If it is desired to calculate the profit per open share or contract, the following formula may be implemented in your EasyLanguage strategy:

Variables:  PerSharePL( 0 ) ;
If CurrentShares <> 0 then
PerSharePL = OpenPositionProfit / CurrentShares ;

The same value can be calculated by the formula, since CurrentContracts and CurrentShares are synonymous and do not depend upon the type of security traded:

If CurrentContracts <> 0 then
PerSharePL = OpenPositionProfit / CurrentContracts ;

Example

Value1 will hold the position profit of 1 contract/share for the current position.

Value1 = ContractProfit;

Additional Example

If you wanted to exit a long position after the profit per share reached $25, you could use the following syntax:

If ContractProfit >= 25 Then
 Sell This Bar on Close;