How to exit a trade using RANKVALUE?
Posted: Tue Apr 02, 2024 12:24 pm
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?
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?