Calculates the unrealized profit for a position.

Namespace:  RightEdge.Common
Assembly:  Common (in Common.dll) Version: 2010.1.0.0 (2010.1.0.0)

Syntax

C#
public double GetUnrealizedProfit(
	PositionStats stats,
	double currentPrice,
	IAccountInfo accountInfo
)
Visual Basic (Declaration)
Public Function GetUnrealizedProfit ( _
	stats As PositionStats, _
	currentPrice As Double, _
	accountInfo As IAccountInfo _
) As Double
Visual C++
public:
double GetUnrealizedProfit(
	PositionStats^ stats, 
	double currentPrice, 
	IAccountInfo^ accountInfo
)

Parameters

stats
Type: RightEdge.Common..::.PositionStats
The PositionStats object corresponding to the most recent trade at the time you want to calculate the unrealized profit.
currentPrice
Type: System..::.Double
The current price of the instrument that is being traded.
accountInfo
Type: RightEdge.Common..::.IAccountInfo
An object which provides account information.

Return Value

The unrealized profit.

Remarks

The unrealized profit is the amount of profit that would be gained if the position were to be closed at . However, this value does not take into account the commission that may be paid on the trade which closes the position.

See Also