Automatic Order State Tracking
Building automated trading strategies in FXOne is easier than in any other platform because the hardest part is done automatically for you.
The most difficult aspect of any automated trading strategy from an implementation point of view is keeping track of and taking the appropriate actions based on order state. This is because once you generate an order you need to know its state (status) prior to any other order submission in order to avoid issuing duplicate orders and control your position direction and size.
![]() |
Order "state" is used interchangeably with order "status" throughout the documentation, and has the same meaning. |
For example, you need to know if your order was rejected and needs to be resubmitted, or if your order was partially executed and you need to submit another order to execute the residual amount.
In FXOne, each Trading Parameter Template has a unique identifier which is the name of the Named Range specified by the user, and which is displayed in the upper right hand cell of each Trading Parameter Template. All orders originating from a particular Trading Parameter Template are automatically tracked throughout their lifecycle so that the current order state is always known. This order state is displayed inside the Trading Parameter Template in the field containing the value for Status.
The Status is always initially set to Ready, and returned to a Ready state after a position has been closed. No new order can be generated from the same Trading Parameter Template unless the Status field is displaying one of several appropriate values, as more fully described below. The below example of a Trading Parameter Template called "BuyEntry" shows the Status field and the initial value "Ready".
![]() |
You do not need to deliberately structure trading signal logic to avoid duplicate orders because the order state tracking features will not allow duplicate orders from the same Trading PArameter Template. To scale into and out of positions, you can use multiple Trading Parameter Templates. |
The below table fully describes each potential state that can be displayed in the Status field, what it means with respect to originating new orders from the same Trading Parameter Template, and what can cause the state to to be displayed.
Status Field Value
Description
Ready
This state means a new order will be placed if the template is called with a trading custom function from within a formula.
The “Ready” state can be displayed for the following reasons:
- When you add a new Trading Parameter Template to a workbook
- When a workbook containing a Trading Parameter Template is first opened
- When FXOne is exited and re-launched and startup workbooks are first loaded
Pending
This state means that and order is pending from the template and no new orders can be sent from the template when called with a trading custom function from within a formula.
The “Pending” state can be displayed for the following reasons:
- An order has been sent for the Trading Parameter Template to the broker which has not yet been filled or cancelled

The state “Pending” can flash up briefly for any order including immediate orders such as market orders.
Executed
This state means that the order that originated from the template was executed in full and the position filled, and no new orders can be sent from the same template when called with a trading custom function from within a formula.
The “Executed” state can be displayed for the following reasons:
- An order has been sent for the Trading Parameter Template to the broker which has been executed and completely filled in the requested amount
PartDone
This state means that the order that originated from the template was executed partially and the position is partially filled, and no new orders can be sent from the same template when called with a trading custom function from within a formula.
The “PartDone” state can be displayed for the following reasons:
- An order amount is only partially filled.

This state will generally only be reached with certain order types, large orders and in ECN broker environments. Orders such as Open at Exact Rate are more susceptible to being partially filled.

You can ignore the “Part Done” status unless it is critical to your trading strategy to always fully fill your amounts, such as might be the case for a strategy that holds positions longer than intra-day. When the partially filled position is closed by another template’s CloseFirst, the partially filled amount will be closed automatically.

The Status field of one Trading Parameter Template can be monitored for a value such as the string “Part Done” from within a formula in an independent cell. This can be used as a condition for calling a secondary template that can have a variable amount specified with a formula that checks a parameter for your full target amount (such as the amount field of the primary template if static and not itself variable and the actual current position size (e.g., using the POS() custom function) so that an order for the un-filled amount can be placed.
Cancelled
This state means that the last order that originated from the template was cancelled, and a new order can now be sent from the same template when called with a trading custom function from within a formula.
The “Cancelled” state can be displayed for the following reasons:
- A linked Trading Parameter Template that lists the template in its CancelFirst field gets called while in a state that allows for the template’s order to be generated.
- A call to CAN() or CNR() from a formula that cancels the order.
- A manual removal of the order via the Orders panel in either FXOne or the broker’s trading platform.
IgnoringConsecutive
This state means that the optional trading setting “Ignore consecutive trades” is enabled and that the last order that originated from the template was in the same direction as the last trade that was executed and so the last order is being ignored. A new order can not be sent from the template until after a trade in the other direction has taken place first. Once a trade in the other direction has been executed a subsequent call to the template will result in an order being generated, after which, the “IgnoringConsecutive” state will change to the new state.
The “IgnoringConsecutive” state can be displayed for the following reasons:
- The trading option “Ignore consecutive trades” is enabled and the order is in the same direction as the last executed trade.
Rejected
This state means that the last order that originated from the template was rejected by the broker, and a new order can now be sent from the same template when called with a trading custom function from within a formula.
The “Rejected” state can be displayed for the following reasons:
- The Trading Parameter Template is incorrectly parameterized, e.g., a Limit rate is on the wrong side of the Bid or Ask depending on whether the order is a Buy or a Sell.
- The price specified in the order is not available, e.g., when using an Open at Exact Rate template.
- You have insufficient margin to place the trade.

If your trading strategy uses orders such as Open at Exact Rate, you may frequently experience rejected orders. When this is expected due to the trading strategy or order types used, it may be appropriate to continuously resubmit the order using the same template without any changes. However, if this is unexpected, there may be an error in the template parameterization. In this case, you need to correct the error.
PendingAdd
This state is transitional when moving from one primary state to another as a result of automatically handled interactions with the broker.
The "PendingAdd" state can be displayed for the following reasons:
- A new order has been generated and is in the process of being submitted to the broker.

When Semi-Automated trading is enabled and a new order is generated and visible in the Proposed Trades panel, the Trading Parameter Template that originated the order will display PendingAdd in the Status field until the trade is either accepted or rejected.
PendingModify
This state is transitional when moving from one primary state to another as a result of automatically handled interactions with the broker.
The "PendingModify" state can be displayed for the following reasons:
- An existing order or is being modified and the new modified order is in the process of being submitted to the broker.
PendingCancel
This state is transitional when moving from one primary state to another as a result of automatically handled interactions with the broker.
The "PendingCancel" state can be displayed for the following reasons:
- An existing order or is being cencelled and the cencel request is in the process of being submitted to the broker.
Status Field Value
Description
Ready
This state means a new order will be placed if the template is called with a trading custom function from within a formula.
The “Ready” state can be displayed for the following reasons:
- When you add a new Trading Parameter Template to a workbook
- When a workbook containing a Trading Parameter Template is first opened
- When FXOne is exited and re-launched and startup workbooks are first loaded
Pending
This state means that and order is pending from the template and no new orders can be sent from the template when called with a trading custom function from within a formula.
The “Pending” state can be displayed for the following reasons:
- An order has been sent for the Trading Parameter Template to the broker which has not yet been filled or cancelled
![]() |
The state “Pending” can flash up briefly for any order including immediate orders such as market orders. |
Executed
This state means that the order that originated from the template was executed in full and the position filled, and no new orders can be sent from the same template when called with a trading custom function from within a formula.
The “Executed” state can be displayed for the following reasons:
- An order has been sent for the Trading Parameter Template to the broker which has been executed and completely filled in the requested amount
PartDone
This state means that the order that originated from the template was executed partially and the position is partially filled, and no new orders can be sent from the same template when called with a trading custom function from within a formula.
The “PartDone” state can be displayed for the following reasons:
- An order amount is only partially filled.
![]() |
This state will generally only be reached with certain order types, large orders and in ECN broker environments. Orders such as Open at Exact Rate are more susceptible to being partially filled. |
![]() |
You can ignore the “Part Done” status unless it is critical to your trading strategy to always fully fill your amounts, such as might be the case for a strategy that holds positions longer than intra-day. When the partially filled position is closed by another template’s CloseFirst, the partially filled amount will be closed automatically. |
![]() |
The Status field of one Trading Parameter Template can be monitored for a value such as the string “Part Done” from within a formula in an independent cell. This can be used as a condition for calling a secondary template that can have a variable amount specified with a formula that checks a parameter for your full target amount (such as the amount field of the primary template if static and not itself variable and the actual current position size (e.g., using the POS() custom function) so that an order for the un-filled amount can be placed. |
Cancelled
This state means that the last order that originated from the template was cancelled, and a new order can now be sent from the same template when called with a trading custom function from within a formula.
The “Cancelled” state can be displayed for the following reasons:
- A linked Trading Parameter Template that lists the template in its CancelFirst field gets called while in a state that allows for the template’s order to be generated.
- A call to CAN() or CNR() from a formula that cancels the order.
- A manual removal of the order via the Orders panel in either FXOne or the broker’s trading platform.
IgnoringConsecutive
This state means that the optional trading setting “Ignore consecutive trades” is enabled and that the last order that originated from the template was in the same direction as the last trade that was executed and so the last order is being ignored. A new order can not be sent from the template until after a trade in the other direction has taken place first. Once a trade in the other direction has been executed a subsequent call to the template will result in an order being generated, after which, the “IgnoringConsecutive” state will change to the new state.
The “IgnoringConsecutive” state can be displayed for the following reasons:
- The trading option “Ignore consecutive trades” is enabled and the order is in the same direction as the last executed trade.
Rejected
This state means that the last order that originated from the template was rejected by the broker, and a new order can now be sent from the same template when called with a trading custom function from within a formula.
The “Rejected” state can be displayed for the following reasons:
- The Trading Parameter Template is incorrectly parameterized, e.g., a Limit rate is on the wrong side of the Bid or Ask depending on whether the order is a Buy or a Sell.
- The price specified in the order is not available, e.g., when using an Open at Exact Rate template.
- You have insufficient margin to place the trade.
![]() |
If your trading strategy uses orders such as Open at Exact Rate, you may frequently experience rejected orders. When this is expected due to the trading strategy or order types used, it may be appropriate to continuously resubmit the order using the same template without any changes. However, if this is unexpected, there may be an error in the template parameterization. In this case, you need to correct the error. |
This state is transitional when moving from one primary state to another as a result of automatically handled interactions with the broker.
The "PendingAdd" state can be displayed for the following reasons:
- A new order has been generated and is in the process of being submitted to the broker.
![]() |
When Semi-Automated trading is enabled and a new order is generated and visible in the Proposed Trades panel, the Trading Parameter Template that originated the order will display PendingAdd in the Status field until the trade is either accepted or rejected. |
This state is transitional when moving from one primary state to another as a result of automatically handled interactions with the broker.
The "PendingModify" state can be displayed for the following reasons:
- An existing order or is being modified and the new modified order is in the process of being submitted to the broker.
This state is transitional when moving from one primary state to another as a result of automatically handled interactions with the broker.
The "PendingCancel" state can be displayed for the following reasons:
- An existing order or is being cencelled and the cencel request is in the process of being submitted to the broker.
![]() |
You can override any state and trade from a Trading Parameter Template with a right click trade in the template when in Fully-Auto mode. Any manual trades done using a Trading Parameter Template are associated with that Trading Parameter Template and will be cancelled or closed by other Trading Parameter Template linked using CancelFirst CloseFirst. |
![]() |
The only way to reset a Trading Parameter Template's Status field to Ready is to re-start FXOne. Closing and re-opening the workbook will not reset the state. |
![]() |
The prior state is not saved when you shut down FXOne and re-start or close a workbook and reload it. It is recommended that before you set trading to Fully-Auto, you first check the current pending orders and open positions and cancel and/or close them so that they do not interfere with the automated trading activity. |