How do I not buy a stock, if I've sold it, in the last 30 days?
Author: akar
Creation Date: 11/14/2018 5:14 PM
profile picture



Looked for a solution in the forum but couldn't find it.

I want to buy a stock that has dropped 10% over last 10 days and sell it next close. I've got the code to do that. However, I want to restrict it to the first time this happens and not again for next 30 days. How do I do that ?

Simply put, how do I not buy a stock if I've sold it in the last 30 days.

profile picture


I looked too and could find it! :) Out of curiosity, here's a selection of topics that all point to the same solution in Community Components. Check out the difference in the wording of the same query:

Skip a trade for 15 days after the exit of the last trade
Prevent new entry if position was closed yesterday
No trade for 3 days after last one closed
Wait 3 days for reentry after a StopLoss exit
profile picture


Thanks Eugene. My bad, I was not using the correct terms for the query.

-- Andy
profile picture


Glad to help. No problem, just wanted to highlight that finding the correct terms is not trivial in this case exactly.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).