MIH8
- ago
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?
2
1,095
Solved
5 Replies

Reply

Bookmark

Sort
Glitch8
 ( 12.10% )
- ago
#1
What is the reason you don't want any more buy signals? This would inform how you go about coding the solution.
0
MIH8
- ago
#2
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.

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.
0
Glitch8
 ( 12.10% )
- ago
#3
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.
0
- ago
#4
How is this different from the Date filter in the PowerPack?

1
Best Answer
MIH8
- ago
#5
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.
0

Reply

Bookmark

Sort