Agent trade settings - Placing orders
Agent trade settings
The Agent trade settings, as well as the Common settings, are available when creating a new agent. In addition, the Trade settings window can be opened by clicking on the gear icon in the Agent column.
Placing orders
Settings | Description |
Convert by market to limit orders | A market order is created not at the current price, but at the bar opening price (as in calculations) +/- slippage if the "Interval + trade" parameter is selected. If the "Interval" recalculation mode is selected, then the closing price of the last bar is used. |
Incorrect stop order is being converted to by market order | Conditional position close orders with a price below the market are placed as market orders. If a message appears: "A conditional order may not be triggered by the signal '{0}', since the current price in the market is {1} (While the price in the condition is equal to {2})! Thus, the order is placed as a market order, not as a conditional one. |
Open by limit orders | To open a position, the program creates limit orders without slippage. |
Slippage in price steps | The volume of slippage in steps of the instrument price that will be submitted to the order created by the agent. An order of the "By market" type does not take into account the slippage settings and is executed at the first offered price. Attention! The slippage settings are cumulative. |
Slippage in % | The volume of slippage as a percentage that will be submitted to the order created by the agent. |
Take-profit without slippage | Take-profit order is created not conditional, but limit (but without slippage). |
Order expiration, Days | Allows transferring the expiration time in days to the broker in a conditional order. By default, the program places conditional orders for two days. Recommended for use when working with large timeframes. (Does not apply to cryptocurrency markets) |
Additional Information
Slippage - works only for conditional orders. For other order types, slippage is not required. In trade settings, slippage is set for the entire script, both slippages are summed up. If you set slippage both in percentage and in price steps, both slippages are summed up. This slippage has a lower priority than slippage, which is set directly in the block of entry and/or exit from the position (set in absolute values). If 5 points are set in a certain entry block, and 1% is set in the total slippage, then 5 points will be set for orders of this entry block, and 1% will be set for the rest of the script.
Take-profit without slippage - by default, the "Take-profit" block places a conditional order. This flag changes the order type to "Limit". It should be remembered that for those data providers that have "Use related orders" the flag turns them off. And between stop and profit, at each recalculation, the program will select only one order, the price of which is currently closer to the current price.
Open by limit orders - Flag used specifically for "If greater than / if less than" entry blocks. By default, these blocks are used for placing conditional orders. If the flag is on, the order type is changed to "Limit". We advise you to use "Open by limit orders" for real trading.
Convert by market to limit orders - The flag is specially created for the "By market" blocks, it changes the order type from "By market" to "Limit", rather "Conditionally Limit". The order will be placed at the closing price of the previous bar, taking into account slippage. The flag affects all agent signals, including Automated open, Automated close, and signals in the command manager.
Attention. If recalculation is set to "Interval + trade", then the order will be placed at the Open price of the current bar. Do not use “Convert by market to limit orders” with Smartcom Data provider. This provider does not have such an option, orders will be placed at incorrect prices.
Incorrect stop order is being converted to by market order. Works for position close conditional orders. Places market orders instead of limit orders. It also works for "Take-profit without slippage", since first it is checked that the price is bad, only after that the "Take-profit without slippage" flag works.
Explanation on the example of a stop loss order:
Stop loss is a conditional order. When the price touches the price specified in the condition, it is converted into a limit order at the price specified in the condition "+ - slippage". Since the stop loss changes stepwise, with the next recalculation, the price in the condition may turn out to be much lower than the market immediately upon the opening of the bar. This is the “Incorrect stop order”. That is, you have a long position, and now the price is 100, and you submit an order to close if it is less than 120. Or you have a short position, the price is 100, and you want to close the position if the price is more than 80. Such an order will not be executed until the price will not return to the price specified in the condition"+ - slippage". If the option "Incorrect stop order is being converted to by market order" is enabled, then a market order will be placed instead of a limit order. For the stop-loss short position, a buy market order will be placed, and for a stop-loss long position, a sell market order will be placed. Consequently, trades will be executed at the best buy and sell prices that will be in the order queue at the time of recalculation. As a rule, this mechanism works automatically for most brokers, but some brokers (for example, Finam) do not support it, in this case it is recommended to set the flag.
Last updated