Page 1 of 1

How to exit a trade using RANKVALUE?

Posted: Tue Apr 02, 2024 12:24 pm
by danblum29
Hi, I wrote an entry script that is entering positions on Mondays based on the Rate of Change (ROC) indicator, which it uses as a RANKVALUE, and some other conditions. The script enters the top 10 (highest ROC) stocks.

ROC:= (CLOSE-REF(CLOSE,N))/REF(CLOSE,N)*100;
RANKVALUE:= ROC;
TODAY:= DAYOFWEEK ;
ISMONDAY : TODAY=1;
EVENT: RSI(CLOSE,MR) < 50 & ISMONDAY;

I also need to exit positions on Monday's if the stock's ROC is no longer in the top 10. However, I looked at the different rank selectors, and read about them, but couldn't figure out how.

Any ideas?

Re: How to exit a trade using RANKVALUE?

Posted: Wed Apr 17, 2024 3:59 am
by Chris White
I think the approach to take is to exit all positions on the Monday and re-enter that Monday's top 10. If there are stocks that carried over from the previous week they will be re-added.