Active trade information is made available by accessing these Instrument Position Properties.

 

Unit Indexing:

Properties listed with a '[ ]' following them may be indexed using a number.  Index number is to identify which unit in the position a property is to reference.  

'  This statement will return the position quantity, in
'  contracts or shares, for the FIRST unit in the position
firstUnitQuantity = instrument.unitQuantity[ 1 ]

 

Position can have more than one unit.  To discover how many units are in a position use this property:

'  Count Position Units
UnitCount = instrument.currentPositionUnits

 

When a position has more than one unit change the value index value to reference that unit.  

'  This statement will return the position quantity, in
'  contracts or shares, for the SECOND unit in the position
firstUnitQuantity = instrument.unitQuantity[ 2 ]

 

When no index is supplied the property will return the information for the first unit "[ 1 ]".

'  This statement will return the position quantity, in
'  contracts or shares, for the FIRST and possibly the

'  ONLY unit in the position
firstUnitQuantity = instrument.unitQuantity

 

Syntax:

value = instrument.<position-property-name>

 

Position Properties:

Descriptions:

barsSinceExit

Number of bars since the last exit, regardless of unit

currentPositionGrossProfit

Gross profit is the basic profit computation, while net (currentPositionProfit) includes roll commission, entry commission, custom commission, roll slippage carry cost, dividends, and saved walk forward profit.

currentPositionProfit

Total profit, in dollars, using the current close, of all units in the current position. This includes roll profit, slippage, and commission that has already moved to closed equity, as well as forex carry and stock dividends. Does not include future expected commission for the trade once it has closed.

currentPositionQuantity

Total number of contracts or shares on for the current position

currentPositionRisk

Total risk for this position, in dollars, based on the close and the stop prices

currentPositionUnits

Total number of units on for the current position

IBSynchPositions

 

NetIBPosition

 

NetTBPosition

 

position

Current position, represented by the numerical constants SHORT, OUT, or LONG.

positionDescription

Current position as a string (equal to "Long", "Short", or "Out"). Useful for printing.

purchaseEquity

 

system

 

systemMarketOrderNetQuantity

Total net quantity (long minus short) for that instrument/system of market on open orders

unitBarsSinceEntry[ ]

the number of bars since the entry of this unit

unitCarry[ ]

the total carry cost of the unit for forex trades.

unitCommission[ ]

the computed commission that will be applied to the trade when the position exits.

unitCustomCommission[ ]

the accrued custom commission added to the instrument through the use of the AddCommission function.

unitCustomValue[ ]

the custom value as set through scripting into the unit, or the order that created the unit. Float value.

unitEntryDate[ ]

the entry date of the unit

unitEntryDayIndex[ ]

the day index of the entry

unitEntryFill[ ]

the fill price for the unit

unitEntryOrder[ ]

the order price for the unit

unitEntryRisk[ ]

the entry risk for the unit adjusted by the fill price

unitEntryTime[ ]

the entry time of the unit

unitExitLimit[ ]

the exit limit for the unit as set by SetExitLimit

unitExitStop[ ]

the exit stop for the unit as set by the original broker function call, or set by SetExitStop

unitNoExitStop[ ]

returns true if there is no exit stop set for the unit. Useful for cleaner reporting.

unitDeliveryMonth[ ]

the delivery month (YYYYMM) of the unit

unitMaxAdverseExcursion[ ]

the maximum unfavorable excursion of the unit

unitMaxFavorableExcursion[ ]

the maximum favorable excursion of the unit

unitMinFavorableExcursion[ ]

the minimum favorable excursion of the unit

unitPositionReferenceID[ ]

New orders are given a the unique reference ID.  This ID number is assigned to the position when it is enabled.  It is then available from this property.  See Order Properties

unitProfit[ ]

the open profit of the trade, net of commissions etc, in instrument currency.

unitQuantity[ ]

the quantity for the unit

unitRollCommission[ ]

the accrued commission of the futures trade from all rolls, in base currency.

unitRollProfit[ ]

the accrued closed profit of the futures trade for all rolls, in base currency.

unitRollSlippage[ ]

the accrued slippage of the futures trade from all rolls, in base currency.

unitRuleLabel[ ]

the rule label as set through scripting into the unit, or into the order that created the unit. String value.

unitSavedWFProfit[ ]

 

unitStockDividends

 

usedMargin

Each symbol's in use margin amount in a stock or a futures system.

 

Links:

Position Functions

See Also:

 

 


Edit Time: 9/25/2017 09:09:58 AM


Topic ID#: 468

 

 

 

 

 

Links:

 

See Also:

 

 

 

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