Francesco78

S&P 500 daily RSI(2) long short strategy

Category: Strategies By: Francesco78 Created: October 21, 2017, 4:36 PM
October 21, 2017, 4:36 PM
Strategies
17 Comments
S&P 500 daily RSI(2) long short strategy

Hi all,

Have a look to this daily strategy on S&P 500. I guess many of you already know it, as it is made very famous by Larry Connors, I just added a bit of asymmetry between long and short, but the code is still extremely light, with only 2 parameters optimized and a stable performance of over 20 year!

defparam cumulateorders = false

cl = RSI[2]<a
cs = RSI[2]>100-a

if cl then
 buy 10 contracts at market
endif

if cs then
 sellshort 10 contract at market
endif

if longonmarket and RSI[2]>100-(a+b) and close < open then
 sell at market
endif

if shortonmarket and RSI[2]<(a+b) then
 exitshort at market
endif

Download
Filename: rsi_2_SPDAILY.itf
Downloads: 823
Download
Filename: prc_wf_sp_daily.png
Downloads: 255
Download
Filename: prc_sp_daily.png
Downloads: 315
Francesco78
Francesco78 Master
Currently debugging life, so my bio is on hold. Check back after the next commit for an update.
Author’s Profile

Comments

snucke
7 years ago
#

@Francesco78 i mean the results differ when i test on my own. so im curious of what the parameters a&b are based on?

Francesco78
7 years ago
#

@snucke the results are not the same because the pictures refers to a few years ago. I am not sure how the strategy will look now with the same parameters.

sfl
sfl
3 years ago
#

still working, using with filters like : trendFilterUp=close>average[190](close) trendFilterDw=close<average[190](close) same parameters 10,30

snucke
7 years ago
#

Hello Francesco! when i replace a&b with 10&30 the results are not the same? how can i make this code applicable for live trading? cause i must remove the a&b with values

Manuel9z
7 years ago
#

ok, sorry, I've already configured it with a = 10 b = 30 thanks Francesco for your post

Manuel9z
7 years ago
#

Hola Francesco, gracias por tu estrategia. Cuando intento activarla en ProOrder, no lo permite, indica este mensaje: Deben aplicarse los siguientes cambios antes de enviar el código a ProOrder: - Reemplace las variables. Para lanzar esta estrategia en trading automático, suprima las variables de la ventana de programación en la sección BroBacktest y reemplácelas por valores específicos en el código de su sistema de trading. Puedes ayudarme en que he de hacer. Muchas gracias

Robin von Bauhn
9 years ago
#

Oh, it's "cs" that's missing. I don't have the code right now but it's the exact same conditions as in your code above so you can copy it from there. But as you might see I made the sides more symmetrical and removed "close < open" as condition for long exit

Francesco78
9 years ago
#

Sorry there might be few typos, pls send the full code. Thank you

Robin von Bauhn
9 years ago
#

Here you go! Would like to hear your feedback :) cl = RSI[2]100-a if cl and close > close[180] then buy 5 contracts at market endif if cs and close 100-(a+b) then sell at market endif if shortonmarket and RSI[2]<(a+b) then exitshort at market endif

Francesco78
9 years ago
#

hi Robin, thank you for yiur comment. Would you mind to post the exact modification to the code that you make? Id love to test it. have a great day.

Robin von Bauhn
9 years ago
#

Nice strategy! Really like the stuff you are posting. Although the performance on the short side is quite bad when in raging bull markets. So try out my favourite filter; close > close[180] (or anywhere between 100-250) for longs and opposite for shorts. Greatly reduces drawdown :)

quietlife
9 years ago
#

HI. My first post on PRC. I tied this on UKX I am limited with 2500 bars, but the results looked very good.

Vonasi
9 years ago
#

It seems that buy and hold outperforms this strategy. Removing the short side of the strategy (I'm not keen on shorting indices especially the SP500) results in close to buy and hold performance without the amount of time in the market and far less volatility in the equity curve. Not many trades though. Settings of 15 and 35 seem to be optimal for this.

Francesco78
9 years ago
#

Hi Vonasi. The logic is based in the fact that the market has a bias to go up. This asymmetry allows long positions to have an "advantage" over short positions.

Vonasi
9 years ago
#

I'm a big fan of anything with Larry Connors on the SP500 with RSI[2]. I notice that your exit criteria are different for long and short positions. A long position needs a down candle to exit but the short positions exit on up or down candles. Can you explain any logical reasoning behind this or is it just something that seemed to work better?

Francesco78
9 years ago
#

a = 10 b = 30, if you run the optimization this is what you will get

maorai
9 years ago
#

hi Francesco, the variables a and b are missing !! thanks for clarify it

ProRealCode ProRealCode
Loading...