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
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
)
F#
member GetUnrealizedProfit : 
        stats : PositionStats * 
        currentPrice : float * 
        accountInfo : IAccountInfo -> float 

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

Type: Double
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