Increases or decreases an existing position by the specified factor as of the close.  

 

Increasing a position size will result in the addition position units since the contract/share additions will have a different entry date than any of the existing units.

 

Decreasing a position size will remove contracts/shares starting with the last unit on, and working back through the remaining units until enough quantity has been removed.

 

For instance:

broker.AdjustPositionOnClose( 1.4 )

would increase a position by 40%, while

 

broker.AdjustPositionOnClose( .8 )

would decrease the position by 20%.

 

This function is used by a Risk Manager Block to lighten a position to meet certain risk restrictions.  It can be used in other script where instruments have context.

 

Syntax:

broker.AdjustPositionOnClose( adjustmentFactor )

 

Parameter:

Description:

adjustmentFactor

Factor by which the current position quantity will be multiplied.  Result will determine position size after adjustmens have been processed.

 

Example:

' Reduce the position size by our computed adjustment.
broker.AdjustPositionOnClose( riskAdjustment )

 

Links:

Broker

See Also:

Risk Manager Block

 


 

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