I am trying to code a stale exit. My code thus far is:
I still have a trailing stop that will trigger as well.
My current issue is that I am having my new positions exited too prematurely. I would prefer that my system will check after 20 bar's if the ROC is < 0, whereas at the moment the statement ROC(C, 20) is checked periodically so it sells after only a few bars which makes the trailing stop almost pointless.
Code:
Stale = 20;
StaleStop = ROC(C, Stale) < 0;
Sell = SellingCross OR StaleStop;
I still have a trailing stop that will trigger as well.
My current issue is that I am having my new positions exited too prematurely. I would prefer that my system will check after 20 bar's if the ROC is < 0, whereas at the moment the statement ROC(C, 20) is checked periodically so it sells after only a few bars which makes the trailing stop almost pointless.