Exiting after N days in an intraday strategy
Author: 07nioe
Creation Date: 11/30/2016 7:06 PM
profile picture


I use the exit rule as described in the wiki.


As I use a MultiPositionCode the rule doesn't work as it should. Every time the entry role is true, the counter will be reset to zero. That means the position will be extended because the exit condition is false. But I don't want to extend the trade. How can I prevent the cnt variable to go back to zero as long as a certain position (e. g. Apple) is still active? Thank you for help.


profile picture


Here's something for you to start with. It uses AddTradingDays from Community Components:

Please log in to see this code.
profile picture


Cool, I will try it! Thanks Niels
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).