Filter | 0 or "" for closing all
trades with the current algo/asset component (default). An algo name for closing all trades with the given algo and the current asset. An asset name for closing all trades with the given asset and the current algo. "c" for closing all call trades with the current component. "p" for closing all put trades with the current component. "cp" for closing all contract trades with the current component. "u" for closing all underlying trades with the current component. "*" for closing all trades with the current asset. "**" for closing all trades. |
TRADE* | A pointer to the trade to be closed, or ThisTrade for closing the current trade in a trade enumeration loop. |
Price | Optional price or distance to current price for selling the position, or 0 (default) for selling at market. A positive price or price distance constitutes an exit stop, a negative price is an exit limit (similar to Entry). An exit stop closes the position when the asset price is at or worse than the given price, like a stop loss; an exit limit closes the position when the asset price is at or better than the given price, like a profit target. |
Lots | Optional number of lots to be closed, or 0 (default) for closing all open lots. Partially closing trades is not available with some brokers. |
Id | Identifier of the trade to be cancelled. Either the full number as assigned by the broker, or the last 4 digits as displayed in the Zorro window. |
exitShort(0,1.234); // exits all short trades with the current Algo/Asset as soon as the price is at or above 1.234 (exit stop).