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
You must be logged in to post a comment.
@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.
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
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
Sorry there might be few typos, pls send the full code. Thank you
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
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.
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 :)
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.
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.
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?
a = 10 b = 30, if you run the optimization this is what you will get
@Francesco78 i mean the results differ when i test on my own. so im curious of what the parameters a&b are based on?