the internal properties that you need to audit the current position profit.
Syntax:
|
instrument.unitRollSlippage
instrument.unitRollCommission
instrument.unitRollProfit
instrument.unitRollPrice
|
Example:
|
' Futures Contract Unit Roll Calculations
' Start with the accrued profit.
' -------------------------------------------------
' The accrued closed profit of all the Futures
' rolls in the trade is returned in the
' simulation's base currency
computedProfit = instrument.unitRollProfit
' -------------------------------------------------
If instrument.position = LONG THEN
computedProfit = computedProfit _
+ ( instrument.close _
- instrument.unitRollPrice ) _
* instrument.conversionRate _
* instrument.unitQuantity _
* instrument.nativeBPV
ENDIF
' -------------------------------------------------
If instrument.position = SHORT THEN
computedProfit = computedProfit _
+ ( instrument.unitRollPrice _
- instrument.close ) _
* instrument.conversionRate _
* instrument.unitQuantity _
* instrument.nativeBPV
ENDIF ' i.position = SHORT
' -------------------------------------------------
|
Edit Time: 10/28/2020 4:52:45 PM
|
|
Topic ID#: 717
|