Hello all,
I wanted to reach out to ask for help with a situation I've encountered a few times within a trend following system. I'm seeking a way to have the system exit a specific position at a specific date, and I haven't been able to find a way to do so. Basically I feel like I'm asking how to be able to add discretion into a system.
For example the system will generate an entry signal rarely on a security like a preferred stock or acquisition vehicle which then never has enough movement to generate an exit signal and the system gets stuck in the position. Or a an existing holding has been acquired and instead of recognizing the acquisition and generating new entry, it is going back in time and suggesting that it entered a different position.
I'd like to not change the base code of the system which would then change the backtest. For example I'm trying to not enter a hold period or similar to remove the positions that it gets stuck in. Some have been very good long term holdings.
I feel like the acquisitions might be a separate issue as I note that my data source (Norgate Premium Data) doesn't have the symbol anymore, so it's generating a survivor bias.
What I have been trying to do is code something like "if Symbol=X and date=Y sell the position". I don't think that is something that I can code into my system after a few attempts. Is this something I would accomplish by editing the data source? For example would I just somehow overwrite a data value that could force an exit? Or is this something I would need to do in a custom backtest. I'm not at all familiar with the custom backtests. Programming is not my strongest suite so if that is the case any resources to help with learning how to do that would be appreciated.
Please let me know if I can address any questions to help with the answer. I appreciate you taking a look!