---
id: faq_item.1134
page_type: faq_article
title: "Why do I need the CancelBuyAfterSell parameter in the strategy settings?"
description: "This setting works in a similar way to the checkbox on the Settings - Main tab (Cancel Buy After Sell), if CancelBuyAfterSell=YES, then when the Sell order of t..."
section: faq
category: "Strategy settings"
url: https://moonbot.pro/faq/strategy-settings/1134?format=md
locale: en
alternate_ru: https://moonbot.pro/ru/faq/strategy-settings/1134?format=md
alternate_zh: https://moonbot.pro/zh/faq/strategy-settings/1134?format=md
parent: https://moonbot.pro/faq/strategy-settings?format=md
previous: https://moonbot.pro/faq/strategy-settings/1133?format=md
next: https://moonbot.pro/faq/strategy-settings/1135?format=md
status: published
updated_at: 2026-11-19T15:08:11+03:00
---

# Why do I need the CancelBuyAfterSell parameter in the strategy settings?

This setting works in a similar way to the checkbox on the Settings - Main tab (Cancel Buy After Sell), if CancelBuyAfterSell=YES, then when the Sell order of this strategy is executed and the trade is closed in profit or loss, all outstanding Buy orders or the rest of the order grid that were still in the order book will be cancelled. The setting of this option only affects orders of the same strategy or other strategies that place orders with the same JoinKey value (not zero).

## Navigation

Path: [Main](https://moonbot.pro/?format=md) / [FAQ](https://moonbot.pro/faq?format=md) / [Strategy settings](https://moonbot.pro/faq/strategy-settings?format=md) / Why do I need the CancelBuyAfterSell parameter in the strategy settings?

Parent section: [Strategy settings](https://moonbot.pro/faq/strategy-settings?format=md)

Previous: [Why do I need AutoCancelLowerBuy parameter in the strategy settings?](https://moonbot.pro/faq/strategy-settings/1133?format=md)

Next: [Where can I select the order type (Limit or Pending) in the strategy settings of the Moonbot terminal?](https://moonbot.pro/faq/strategy-settings/1135?format=md)

## Related

- [Where can I select the order type (Limit or Pending) in the strategy settings of the Moonbot terminal?](https://moonbot.pro/faq/strategy-settings/1135?format=md)
- [Can I place pending orders in Moonbot not manually, but by using strategies in the green order book?](https://moonbot.pro/faq/strategy-settings/1136?format=md)
- [Can I place pending orders in Moonbot not manually, but by using strategies in the red order book?](https://moonbot.pro/faq/strategy-settings/1137?format=md)
- [What is the PendingOrderSpread parameter in the Moonbot strategy settings?](https://moonbot.pro/faq/strategy-settings/1138?format=md)
- [Can I set a fixed order size in the Moonbot terminal strategies without affecting the order size in the main settings?](https://moonbot.pro/faq/strategy-settings/1139?format=md)
