Limit Orders

Optimize the executions of rules with different order types

Oleg Giberstein avatar
Written by Oleg Giberstein
Updated over a week ago

Market vs Limit orders


A market order executes immediately at the best available market conditions when it reaches the exchange order book.


In this example, imagine the condition is set to buy with a market order LINKUSDT if the price is lower than 20.77 USDT. The last traded price on the exchange is lower, so Coinrule will try to buy the LINK. The best available price for buyers is 20.7738 USDT, which would result in executing the order at a slightly higher price than expected.

LINKUSDT order book

This difference may be small for coins with high liquidity, but the difference may be much larger in some cases!


To avoid this, you can use a limit order. In this way, you can set up a maximum (or minimum) price for buying (or selling), so you won't trade at unexpected prices.


Using limit orders

Of course, using limit orders reduces the chances of executing trades, as that depends on market conditions.


You can set up the price-margin on the settings page to apply to your limit order to adjust the likelihood of executing trades according to your preferences.


Here is how it works.

  • The rule is going to buy ETHUSD

  • The price that triggers the order is 1240 USD

  • The margin for the limit order is set to 0,5%

  • Therefore, the bot will send an order with a limit price of 1246.20 USD

  • If it's possible to buy ETHUSD immediately at 1246.20, the trade is confirmed. Otherwise, the rule will try again shortly if the condition to trade still applies.

Note: if you set a margin to 0% the limit price will be equal to the price that triggers the condition, and it's the more restrictive option. Increasing the margin result in more executed trades, but you could also get less convenient execution prices within the rule.

Important: Coinrule makes use of Fill or kill (FOK) orders on all crypto exchanges apart from Coinbase Advanced. These are either filled immediately, or they’re killed (cancelled). If your order instructed the exchange to buy 10 BTC at $10,000, it wouldn’t partially fill. If the entire order of 10 BTC isn’t immediately available at that price, it will be cancelled. On Coinbase Advanced, FOK orders are not supported. We therefore use Good-till-Date (GTD) Limit Orders with 1 minute expiration. Once placed, if the order does not get filled within 1 minute, it will be cancelled.

On Stock Exchanges such as Alpaca or Robinhood that are supported by Coinrule, Limit Orders are also Good-till-Date (GTD) Limit Orders with 1 minute expiration.

Disclaimer: Please note that this article contains affiliate links.

Did this answer your question?