Coygo Adds OTO and OCO Orders for Crypto Trading Bots!
In our latest release we've added support for OTO and OCO orders to Coygo Forge! You can now use these advanced order types in your own crypto trading bots.
When it comes to trading most people are familiar with the basic order types such as market orders, which have no guanarteed rate but will always execute, or limit orders, which have a guaranteed rate but may or may not execute. These simple tools give you a choice when developing your trading strategy.
As you expand your knowledge you will eventually encounter more advanced order types such as stop-limit orders, which trigger a limit order after a particular “stop” price is reached.
There are two advanced order types in particular that allow extremely powerful trading automation: OTO (One-Triggers-Other) and OCO (One-Cancels-Other). These two tools can be combined to do things that simply are not possible otherwise and are extremely helpful for mitigating risk in your strategy. For example, with a single order you could configure an entry price, stop-loss condition, and take-profit condition simultaneously.
What is an OTO (One-Triggers-Other) order?
An OTO order allows you to submit a “parent” order. When that “parent” order executes (fills completely) it can then automatically trigger submitting one or more other “child” orders. As a basic example, you could submit a “parent” limit order to buy an asset at a rate of 100 that will then submit an accompanying “child” limit order to sell that same asset at a rate of 110. This allows you to configure your entry and exit prices in a single order submission.
What is an OCO (One-Cancels-Other) order?
An OCO order allows you to submit a limit order and another “sibling” order at the same time. When one order executes (fills any amount) or is canceled the other “sibling” will be automatically canceled. For example, an OCO stop-market order can be used to mitigate risk by configuring simultaneous stop-loss and take-profit conditions.
Example: Configure entry, stop-loss and take-profit simultaneously
Let's walk through a real example of how we can use these powerful advanced order types to our advantage. We will use an OTO parent order and an OCO stop-market child order.
For this example:
- We want to purchase BTC at 1% below the current “ask” rate.
- After buying BTC we want to set our take-profit target to 1% profit. If the price reaches 1% above the buy price we want to sell to realize profits.
- After buying BTC we want to set our stop-loss target to -1%. If the price drops 1% below the buy price we want to sell to avoid further losses.
We can achieve this by:
- Submitting an OTO buy order
- This is a limit order that will buy BTC at 1% below the ask arte.
- Configuring a “child” order that is an OCO (One-Cancels-The-Other) stop market order at +1% with a stop at -1%.
- The OCO order will generate a limit sell order at the buy rate + 1%.
- The OCO order will also generate a stop-market sell order at the buy rate -1%, which triggers a market sell order as soon as the price drops <= the stop.
- If either of these sell orders fills or is canceled the other is canceled.
Code example: Use OTO & OCO orders in a crypto trading bot w/Coygo!
With Forge you can use OTO & OCO orders in your crypto trading bots!
Try Coygo Forge for free!
If you'd like to try coding your own crypto trading bot that uses OTO or OCO orders you can sign up for Coygo today! All subscription plans include a free trial. We'd love to hear your feedback!
Follow us on social media and subscribe to our blog to keep up to date with Coygo’s progress as we continue to develop the best tools for cryptocurrency and digital asset traders.