Hi there, I am a complete novice when it comes to ProRealtime and automated trading in general. I have read very positive things about Larry Connors simple but effective RSI-2 Swing Trading System and I’d really love to give it a try. I understand that somebody here tried his system but only in terms of Day Trading and really its the 4/5 day Swing trading system that appears to be most effective.
Is there anybody here who could help me implement this?
Kind regards
Dermot
Hi Diarmad,
You are referring to this post : http://www.prorealcode.com/prorealtime-trading-strategies/rsi-2-strategy-larry-connors/
The rules of this strategy are set for daily timeframe, so trade would last about some days. What are the rules you are talking about please?
Hi Nicolas,
Some of the rules that make the system operate better are not included here.
I’ll list these rules:
- The stock’s 100 day historical volatility is above 30.
- The stock’s 10 day Average Directional Index (ADX) is above 30.
- The stock has closed down for N-1 of the last N trading days for Longs (e.g. it has closed down 3 of the last 4 days) or the stock has closed up for N-1 of the last N trading days for Shorts (e.g. It has closed up 4 of the last 5 days)
- Today’s lowest price (for longs) is at least 3% below the previous day’s close. The highest price (for shorts) is at least 3% above the previous day’s close.
- The 2 period RSI value is above 98 for shorts or below 2 for longs. (this improves results significantly compared to the RSI used in the existing model).
- If the above rules are met buy the stock tomorrow at 4% below today’s close for Longs and sell the stock at 4% above today’s close for Shorts.
- Exit the trade when the stock shows closes with an RSI (2) value above 70 for Longs or and RSI (2) value below 30 for Shorts. (This could be done manually as there are a few different options for exiting trades with Connors and it usually happens day 4 or 5 after the trade has been placed.
How easy do you think it would be to add these rules to our existing model?
Kind regards
Dermot
This should not be so difficult.
Maybe I’ll have a look tomorrow. Please remind me if I forgot 🙂 Thanks.
Hello
Some rules are easy to code
Please find rules
with ADX[10]>30
and Today’s lowest price (for longs) is at least 3% below the previous day’s close. The highest price (for shorts) is at least 3% above the previous day’s close.
Each time you add a rule/condition >less trades , fewer drawdown and the ratio Earning€/loss € increase
Piece of backtest
DEFPARAM CumulateOrders = False
n = 2
// Conditions pour ouvrir une position acheteuse
myADX = ADX[10]
MM200 = Average[200](close)
MM5 = Average[5](close)
RSI2 = RSI[2](close)
c1 = close > MM200
c2 = close < MM5
c3 = RSI2 < 10
c11 =low<close [1]+0.029*close[1]
IF c1 AND c2 AND c3 and myADX>30 and c11 THEN
//
BUY n contracts AT MARKET
ENDIF
// Conditions pour fermer une position acheteuse
c4 = close > MM5
IF c4 THEN
SELL AT MARKET
ENDIF
// Conditions pour ouvrir une position en vente à découvert
c1v = close < MM200
c2v = close > MM5
c3v = RSI2 < 90
c21 =high >close [1]+0.029*close[1]
IF c1v AND c2v AND c3v and myADX>30 and c21 THEN
//
SELLSHORT n contracts AT MARKET
ENDIF
// Conditions pour fermer une position en vente à découvert
c4v = close < MM5
IF c4v THEN
EXITSHORT AT MARKET
ENDIF
SET STOP %LOSS 2
I started to work on this last evening, but have done something else instead, I were stuck there:
//The stock's 100 day historical volatility is above 30.
//The stock's 10 day Average Directional Index (ADX) is above 30.
//The stock has closed down for N-1 of the last N trading days for Longs (e.g. it has closed down 3 of the last 4 days) or the stock has closed up for N-1 of the last N trading days for Shorts (e.g. It has closed up 4 of the last 5 days)
//Today's lowest price (for longs) is at least 3% below the previous day's close. The highest price (for shorts) is at least 3% above the previous day's close.
//The 2 period RSI value is above 98 for shorts or below 2 for longs. (this improves results significantly compared to the RSI used in the existing model).
//If the above rules are met buy the stock tomorrow at 4% below today's close for Longs and sell the stock at 4% above today's close for Shorts.
//Exit the trade when the stock shows closes with an RSI (2) value above 70 for Longs or and RSI (2) value below 30 for Shorts. (This could be done manually as there are a few different options for exiting trades with Connors and it usually happens day 4 or 5 after the trade has been placed.
//indis
longN1 = 0
shortN1 = 0
histovolat = historicvolatility[100]>30
adxx = adx[10]>30
longvar = ((close[1]-low)/close[1])*100>=3
//shotvar = ((high-close[1])/close[1])*100>=3
rrsi = rsi[2](close)
longrsi = rrsi>98
//shortrsi = rrsi<2
//N-1 fetch lookback
N = 5 //nb of days to look for a N-1 condition
for i = 0 to N do
if close[i]<open[i] then
shortN1=shortN1+1
else
longN1=longN1+1
endif
next
if histovolat and adxx and longvar and longrsi and longN1=N-1 then
BUY 1 SHARE AT MARKET //close*0.96 LIMIT
endif
if rrsi>70 then
SELL AT MARKET
endif
No trade were initiated, so I gave up at that time. This strategy seems very interesting. We should certainly build something relevant all together next week 🙂
Hi Diarmad
For my information, where do your extra parameters come from?
your experience or from an other source?
Yannick and Nicolas,
Apologies, I was away for a few days and only saw your messages now. I’d love to see how this progresses and how it performs in backtests.
Yannick, the further parameters come from Larry Connors book “The 2 period RSI Pullback Trading Strategy” . You can get it on Amazon.
Nicolas,
Are you saying that all these parameters actually prevent any trades being initiated? Do you know which parameter creates the largest obstacle?
It does seem quite difficult to find stocks that meets all these criteria. Connors mostly does it on with S & P stocks but his system is supposed to work well in many markets.
Kind regards
Dermot
Hello
According to backtest, this strategy (code in my previous message) is winning on all stock index (US, Europe, Asia ),oil, natural gas but doesn’t on gold and bund.
For historicvolatility, I don’t find if the returned value is within 0-100% range or 0-1 range.
Yes “historicvolatility” is bounded between 0-1 range, sorry for this mistake.
Yesterday I did some tests and found very hard to meet all these criterias at the same time. I think Yannick’s code is more relevant.
great work Yannick. What sort of returns was it generating? I have heard as high is 11% per month!
Apologies if my question seems basic – but I am a complete newbie to automated trading
Hello
Please have a look on the backtest that I provided
It is more +3% a year /index . But you can run the algorithm on different contracts , if they are not too much correlated ex Eurostoxx, DAX, CAC40 or DowJones/SP500…
I don’t see further optimisation, maybe some can help us?