Skip to content
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

Kill switch feature #863

Closed
sebasira opened this issue Dec 28, 2021 · 7 comments
Closed

Kill switch feature #863

sebasira opened this issue Dec 28, 2021 · 7 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@sebasira
Copy link

Is there a way to implement a kill switch functionality? Let's say that I want to stop an @Strategy from receiving ticker updates (or maybe receive them but not making any operation).

Because I did something like that on my implementation and my custom Strategy has a way to stop creating new Positions but I can not stop those position from being closed with TickerUpdates

@straumat straumat added this to the 5.0.8 milestone Dec 29, 2021
@straumat straumat self-assigned this Dec 29, 2021
@straumat straumat added the enhancement New feature or request label Dec 29, 2021
@straumat
Copy link
Member

@sebasira at this moment, there is no way to do that as positions are supposed to be managed automatically by Cassandre.
To be sure of what is required, do you just want positions to not be closed automatically? (meaning all non-closed positions will not receive tickers updates) or do you want to be able to stop received tickers for a period?

@sebasira
Copy link
Author

What I'd like is to have the possibility to freeze the Positions of a Strategy. And just pause them until whenever I want.

Maybe a FREEZE status? With a freeze and defrost methods. I'm just thinking out loud. Because this way I can turn on/off the bot from a dashboard. Also if the bot has several Strategies I can leave some ON and other OFF.

@straumat
Copy link
Member

straumat commented Jan 1, 2022

@sebasira ok, last question to be sure, so what you want is to be able to stop one or several opened position to be automatically closed by Cassandre? so if you want to froze a strategy, you will just call freeze on every strategy's positions ?

@sebasira
Copy link
Author

sebasira commented Jan 3, 2022

Yes!

so if you want to froze a strategy, you will just call freeze on every strategy's positions ?

And also why not another methods at the Strategy level to freezes and defrost all positions?

The idea is to stop the bot (or only some strategies of the bot), without stopping the whole application.

@straumat
Copy link
Member

straumat commented Jan 6, 2022

@sebasira the question is the level to choose.

  • Being able to stop the bot.
  • Or being able to stop a strategy.
  • Or being able to stop an opened position.

I think I will add an autoclose property in PositionDTO with a method setAutoClose(boolean). And maybe add a parameter to the constructor. This way, I will allow users to use positions in two ways (automatically managed or not).

And i will add a method in strategy to set auto close to all its opened strategies.

@cassandre-tech cassandre-tech deleted a comment from hlevel Jan 7, 2022
straumat added a commit that referenced this issue Jan 9, 2022
straumat added a commit that referenced this issue Jan 9, 2022
@straumat
Copy link
Member

straumat commented Jan 9, 2022

Feature available in5.0.8-SNAPSHOT.
A method setAutoClose(long, boolean) is now available in strategy.

@straumat
Copy link
Member

I close. Reopen if any problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants