Position Adjustment Functions

Position adjustment functions are used to increase or reduce position size.  

 

A new instrument unit number can change when a position's size is changed.  

When size is added to a position, order.isEntry is TRUE.  

When size is added to a position that is LONG, order.isBuy is TRUE.

When size is removed from a position, order.isEntry is FALSE.  

When size is removed from a position that is LONG, order.isBuy is FALSE.

 

When these Position Adjustment Functions are called, they will reduce or increase the quantity in a position by reducing the quantity in a single unit, or in a group of units with multiple unit positions.  

 

When a larger quantity is required to be removed than what is available in a single unit, the next available unit will be reduced for what was not possible in the previous unit.  When all of quantity in a position is reduced to zero, all the units in the position will be terminated.  

 

As the quantities of a position are increased, a unit will be added to a position to contain the added quantity, and an incremental unit number will appear.

 


Note:

When this function is used to adjust the size of an order, it is best to place the Position-Adjustment function in either the Exit Orders or the Entry Orders script sections.  Placing the size adjusting function in the Update Indicators script executes after the close of the instrument's results for the date and time when the script is accessible.  This means the changes you expect to see on the Positions & Orders Report cannot appear on the same day the report is displayed.

 

Adjust Size On Open Order

Descriptions:

AdjustPositionOnOpen

Adjusts the position on the open

Adjust Size On Stop Order

Descriptions:

AdjustPositionOnStop

Adjusts the position any time if the market hits specified price

Adjust Size At Limit Order

Descriptions:

AdjustPositionAtLimit

Adjusts the position on any time if the market goes beyond specified price

Adjust Size On Close Order

Descriptions:

AdjustPositionOnClose

Adjusts the position on the close

 

Descriptions:

AdjustSystemRiskToMax

When this function is called, it will adjusts all positions in the system proportionally so that the total system risk is equal to this desired risk percent.

 

AlternateBroker:

When the Broker Object is out of the context of its default context scripts, the AlternateBroker object should be used to execute any of the Broker Object Entry and Exit Functions. AlternateBroker has the same functions and properties as the Broker Object and will work in the same way.  

 


Edit Time: 9/13/2020 3:46:09 PM


Topic ID#: 467

 

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