Cancelling Orders

CancelAll() functions are used to cancel orders associated with trade systems or individual entries.

CancelAll Parameters

Example

Formula:

A5 (our buy entry function)

Cancel:

B8 (reference to a condition formula)

 

The “Formula” parameter is identical to the “Formula” parameter in the “Exit()” function. The parameter requires a cell reference; you cannot use the actual formula. In this example, A5 is the cell used to specify the buy entry: =Buy(A4,B5,"Long1",A1).

 

The “Cancel” parameter requires a cell reference to a condition formula, such as “=C8 < D8”. When true, any working orders entered by the entry in A5 will be cancelled. Each entry can have more than one order working at one time depending on how often the “When” parameter changes to a non-zero parameter.

 

If you used a cell reference for the order size then any working orders would be canceled if the working order entry size were changed to 0.

Notice in the image above the displayed CancelAll formula in cell A8 uses “;” and not a “,” as a separator, which is used in the actual formula.

 

Sometimes you may want to cancel everything working, such as during market conditions of extreme volatility. In this case, you can use the system function reference rather than an individual entry. In the example below, all orders working, buys or sells, will be cancelled if the volatility measure exceeds 0.25 in cell B10, as shown in the second image below.