Here is a simple “long only” automated strategy built upon the mean reversion behaviour of the QQQ ETF. It uses the Internal Bar Strength indicator which represent the weight of the closing price related to the day’s range. It is a simple indicator that point the fact that deepest close would regain on the few next days. This indicator is the same as a stochastic oscillator with only 1 period = short term deviation from the price mean would expect that price will came back to it.
When the IBS (or stochastic oscillator) fall below the 10 level, buy at next open. Close the trade if a candle close above the previous day high.
I also add a dynamic lot calculation made upon the strategyprofit. You can change the value of the “initial lot” (100 shares at start) and the “step profit” which add more shares whenever the strategy gain a new stepprofit (50$ by default).
This strategy would be adapted to other indices, i will certainly go forward on it.
//indicator
STO = (Close - Low) / (High - Low) * 100
//initial lot
initLOT = 100
//profit step of the strategy to increase lot
stepPROFIT = 50
myLOT = max(initLOT,initLOT+ROUND((strategyprofit-stepPROFIT)/stepPROFIT))
IF NOT LongOnMarket AND STO<10 THEN
BUY myLOT CONTRACTS AT MARKET
ENDIF
If LongOnMarket AND Close>High[1] THEN
SELL AT MARKET
ENDIF