Skip to content

Add activation_price support for trailing stop orders #2610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 8, 2025

Conversation

hope2see
Copy link
Contributor

@hope2see hope2see commented May 7, 2025

Pull Request

  • Introduce the activation concept to trailing stop orders by adding the activation_price attribute, a feature already supported by advanced exchanges such as Binance, OKX, and others.
  • Resolves Issue2573
  • Related with Issue2523

Type of change

Delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • [v] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [v] This change requires a documentation update

How has this change been tested?

Describe how this code was/is tested.

• All existing tests passed : pytest, pre-commit
• Updated 2 existing unit tests to include the activation_price attribute. (test_exchange_trailing_stops.py)
• Added 4 new tests for the extended features. (test_exchange_trailing_stops.py)

@cjdsellers
Copy link
Member

Hi @hope2see

Thank you for the contribution!

Very initial skim looks good, I'll do a proper review tomorrow.

@cjdsellers cjdsellers changed the title Extend features of trailng stop orders by adding 'activation_price' Add activation_price support for trailng stop orders May 8, 2025
@cjdsellers
Copy link
Member

Hi @hope2see

Thanks for your patience.

This is well-implemented and tested. I'll make some minor tweaks after merge, which won't affect the core behavior.

Could you add tests for str() and repr() for trailing stop orders, with and without the activation price? Since we're introducing the optional -ACTIVATION component, these can help catch formatting issues with commas or whitespace.

Many thanks again for this valuable contribution! 🙏

@cjdsellers cjdsellers changed the title Add activation_price support for trailng stop orders Add activation_price support for trailing stop orders May 8, 2025
@cjdsellers cjdsellers merged commit 25a4c16 into nautechsystems:develop May 8, 2025
17 checks passed
@cjdsellers
Copy link
Member

@hope2see

Another valuable follow-up would be implementing this on the Rust side as well. Even if its just the activation_price parameter for the trailing stop orders, although the full implementation and testing would be the most ideal.

I understand if you're not comfortable enough with Rust, or don't have the bandwidth if implementing for the production code meets your needs currently. But if you did want to become involved there too, this would be a great entry point.

@hope2see
Copy link
Contributor Author

hope2see commented May 9, 2025

@cjdsellers
Thank you for this quick merge and kind suggestion.

Could you add tests for str() and repr() for trailing stop orders, with and without the activation price?
No problem with adding this. :)

As for the Rust-side implementation, I would like to contribute, but I’m currently tied up with other work and don’t have much experience with Rust yet. So I think it would be better handled by someone else.

@nicolad nicolad added the adapter Nautilus integration with external systems label May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adapter Nautilus integration with external systems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add activation_price support for trailing stop orders
3 participants