Wait 3 days for reentry after a StopLoss exit
Author: 07nioe
Creation Date: 10/14/2017 11:47 AM
profile picture

07nioe

#1
Hello,

I use a MPC and apply it on a portfolio of 60 stocks. I would like to allow a reentry of the same symbol not until 3 bars are passed after the stop loss instead of at the next bar. Does anybody know how to code it? Thank you for help.

Niels
profile picture

Eugene

#2
Hi Niels,

Prevent new entry if position was closed yesterday

As suggested, use the convenient CooledOff function which is a real timesaver.

P.S. You might be surprised but question like your are raised from time to time. If you type in "reentry" or "wait" in the forum's search box you might find more hits e.g. Wait condition for entry (which also refers you to an important Tutorial: Setups, Triggers, Delays, and Timeouts)
profile picture

07nioe

#3
Thank you Eugene. I am not sure if CooledOff works in the way I need it. An example: AAPL was exited by StopLoss. Currently, at the next day the strategy could generate an AAPL entry again, if the conditions are fine. I would like to exclude reentries for AAPL for three days. But only for AAPL. Other stocks could be opened regularly.

I think CooledOff make a pause for all stocks.

Thank you
Niels
profile picture

Eugene

#4
You're right, it means a pause for all entries. But it's pretty simple to extend CooledOff with a check for Bars.Symbol == current symbol being processed e.g. AAPL. I've done it before so here you have an example to learn and tweak:

Feature Request: Trade Settlement Preference Setting (T+3)
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).