I would like to ask for an idea about how to phase out my strategy.
In principle, I would like to avoid further buy signals. But to generate the sell signals I need the previously generated buy signals.
How is it possible to avoid future buying signals but continue to generate the selling signals for existing positions.
The only idea I can think of so far is to edit the code and implement the buy conditions with a date < today. Maybe even configurable as a parameter.
Does anyone have an alternative idea or solution?
In principle, I would like to avoid further buy signals. But to generate the sell signals I need the previously generated buy signals.
How is it possible to avoid future buying signals but continue to generate the selling signals for existing positions.
The only idea I can think of so far is to edit the code and implement the buy conditions with a date < today. Maybe even configurable as a parameter.
Does anyone have an alternative idea or solution?
Rename
What is the reason you don't want any more buy signals? This would inform how you go about coding the solution.
I just want to stop the strategy, but I still have open positions waiting for a sell signal.
My motivation to stop the strategy is simply not to trade September.
But other reasons could also play a role, such as using a different strategy.
It is important to know that this decision is not part of the strategy itself, I could also say I pause in October.
Coding the solution is trivial. I adjust the code like this.
What I don't like about this is that I have to modify the code for a "ready-made" strategy. If I phase out the strategy, it doesn't mean I never want to use it again. I think more of a setting for the strategy that controls this behavior from outside.
At the end of the day, the goal is to sell the remaining positions without opening more positions.
My motivation to stop the strategy is simply not to trade September.
But other reasons could also play a role, such as using a different strategy.
It is important to know that this decision is not part of the strategy itself, I could also say I pause in October.
Coding the solution is trivial. I adjust the code like this.
CODE:
// do not buy: set to let run out the strategy if (bars.DateTimes[idx].Date >= stop_date) return;
What I don't like about this is that I have to modify the code for a "ready-made" strategy. If I phase out the strategy, it doesn't mean I never want to use it again. I think more of a setting for the strategy that controls this behavior from outside.
At the end of the day, the goal is to sell the remaining positions without opening more positions.
I understand, it sounds like a valid feature request, the ability to block entry orders but allow exits to proceed. I’ll flag this as a #FeatureRequest so we can get it into the wish list.
It looks like it was introduced in the beginning of September 22, so before that date it was not availabe. ;-). Nice to see you care about some older topics.
Your Response
Post
Edit Post
Login is required