Nicolas

RSI 3 periods QQQ Powerness

Category: Strategies By: Nicolas Created: February 8, 2016, 7:12 PM
February 8, 2016, 7:12 PM
Strategies
4 Comments
RSI 3 periods QQQ Powerness

Another long only strategy built with mean reversion in mind with a classic Relative Strength Index indicator on 3 periods. Buying the deep RSI 3 periods (under 10 level) and sold the long position when RSI rise above the 50 level.

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).

14.5% drawdown while almost being 8% of traded time in the market. Annualized return of 11.5% profit, 16 years long.

//indicator
myRSI = RSI[3](close)

//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 myRSI<10 THEN
  BUY myLOT CONTRACTS AT MARKET
ENDIF

If LongOnMarket AND myRSI>50 THEN
  SELL AT MARKET
ENDIF

 

No files found.

Nicolas
Nicolas Legend
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

DonDollar
10 years ago
#

I found the answer by myself for the second question. But still no idea about the False and True thing.

Nicolas
10 years ago
#

The line 12 of the code is the answer of your question. Before launching a new trade, the code check if there is already a long trade opened. 

DonDollar
10 years ago
#

...and I do not see any opened positions...strange...

DonDollar
10 years ago
#

Hi Nicolas,

very easy and very interesting strategy. But one question: Why is there no 'DEFPARAM CUMULATEORDERS = False' at the beginning? I tried it with False and True but...there is no difference if. So why do I need it?

Rads,

Clemens

ProRealCode ProRealCode
Loading...