the internal properties that you need to audit the current position profit. 

 

 

Syntax:

instrument.unitRollSlippage
instrument.unitRollCommission
instrument.unitRollProfit
instrument.unitRollPrice

 

Parameter:

Description:

 


 

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
  '  -------------------------------------------------

Returns:

An example Blox is available here:

Example Roll Profit.tbx

 

 

Links:

 

See Also:

 

 


Edit Time: 10/28/2020 4:52:45 PM


Topic ID#: 717

 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software