SP500 – riding the trend

SP500 – riding the trend

 

Simple strategy on S&P500 with “controlled” averaging down orders. Strategy has stoploss (100 points by default). Default is 5 contracts per order, but you can modify it in the code if you want (please adapt it to your account size). Could be adapted to other markets for sure.

 

 

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Leonida1984 • 09/04/2017 #

    Troppi pochi trade per uno storico così elevato. La probabilità nella sua accezione frequentista , è attendibile se il campione preso a riferimento sia ampio. Mia personalissima opinione. Buona giornata!

  2. reedthomaslawrence • 09/04/2017 #

    Is there anyway to make this system work for the us market? Thanks!

  3. JR1976 • 09/04/2017 #

    DO you mean US Market ? Like Nasdaq or Dow ?

  4. reedthomaslawrence • 09/04/2017 #

    Yes! Thanks for your reply. Also, can you give any more details on how this system works? It says it’s automated. Does that mean that it will automatically make daily trades or weekly trades? What type of returns will it generate and does it work with any portfolio size? I know you have to sign-up for Prorealtime monthly in order to use. Thanks in advance!

  5. JR1976 • 09/04/2017 #

    Hi Thomas,
    The system is totally automatic , make daily trade ( daily timeframe ) .
    Follow the trend because need to know if the close is above or below the ‘Average 125’ and entry when the market have the weak points , only at the break of previous Daily high or low

    About your portfolio size …
    Depend of your risk , but I think 3000 €/US is the minimum

  6. Ricx • 09/04/2017 #

    Hi! Looks like a good system, I would like to try it out and see if I can make it fit into any of my ideas. However I’m having a hard time understanding the system, can you explain in words when the system is supposed to enter a long position?

    • JR1976 • 09/04/2017 #

      I Ricx,
      Thanks an advance for your comment
      The most important condition to go long are :

      SP500 – riding the trend 3
      SP500 – riding the trend

      Simple strategy on S&P500 with “controlled” averaging down orders. Strategy has stoploss (100 points by default). Default is 5 contracts per order, but you can modify it in the code if you want (please adapt it to your account size). Could be adapted to other markets for sure.

      // TF Giornaliero
      // JR1976 TRADERS
      // Molto Buono con Cumulate order LONG

      // MM125=filtro lungo periodo , MM14 media di corto periodo per le operazioni long , MM4 media di corto periodo per le operazioni short + check RSI 2
      // TIme Frame DAYLY
      // MAX dd …
      // Loss …

      // JR1976 TRADERS

      DEFPARAM Cumulateorders = true
      //defparam flatafter = 220000
      //defparam flatbefore = 130000

      MM125=average[125](close)
      MM14=average[14](close)
      MM4=average[4](close)

      RSI2 = RSI[2](close)
      //h1 = high > Bollingerup[20]
      short = RSI2 > 90
      mm200=average[200](close)

      // Condizioni per entrare su posizioni long
      IF NOT LongOnMarket and close >MM125 and MM125>MM125[1] and close<MM14 THEN
      BUY 5 CONTRACTS AT high stop
      trading = 0
      ENDIF
      //if trading < 7 then
      if trading mm200 and Close-TRADEPRICE(1)>1 then
      IF LongOnMarket and close>mm200 and TRADEPRICE(1)- close>1 then
      BUY 5 CONTRACTS AT market
      trading = trading +1
      ENDIF
      endif

      // Condizioni per uscire da posizioni long
      //If LongOnMarket AND close>mml and close>close[1] THEN
      If LongOnMarket AND close>MM14 THEN
      SELL AT market
      ENDIF

      // Stop e target: Inserisci qui i tuoi stop di protezione e profit target
      if not shortonmarket and close<MM125 and MM125MM4 and short then
      sellshort 5 contracts at low-3 stop
      endif

      if shortonmarket and close<MM4 and close1 then
      exitshort at market
      endif

      //if shortonmarket then
      //exitshort at high+10 stop
      //endif
      //set target pprofit 25
      set stop ploss 100

      // TF Giornaliero
      // JR1976 TRADERS
      // Molto Buono con Cumulate order LONG

      // MM125=filtro lungo periodo , MM14 media di corto periodo per le operazioni long , MM4 media di corto periodo per le operazioni short + check RSI 2
      // TIme Frame DAYLY
      // MAX dd …
      // Loss …

      // JR1976 TRADERS

      DEFPARAM Cumulateorders = true
      //defparam flatafter = 220000
      //defparam flatbefore = 130000

      MM125=average[125](close)
      MM14=average[14](close)
      MM4=average[4](close)

      RSI2 = RSI[2](close)
      //h1 = high > Bollingerup[20]
      short = RSI2 > 90
      mm200=average[200](close)

      // Condizioni per entrare su posizioni long
      IF NOT LongOnMarket and close >MM125 and MM125>MM125[1] and close<MM14 THEN
      BUY 5 CONTRACTS AT high stop

      First of all, simple average 125 , previous close must be above
      Then the trend of the average 125 must be in up direction
      Previous close are below average 14
      And the last condition but important is to break the previous high to entry in the market

      To avoid the big drawdown , cumulate order if you are not in profit

      The stop loss obviously are most important

      Regards

    • JR1976 • 09/04/2017 #

      I Ricx
      Sorry but there is an error in copy paste of the previous reply.

      The follow the simple condition to set up LONG

      1 previous close must be above simple moving average 125
      2 the trend of the average 125 must be up direcction
      3 previous bar close below average 14
      4 at the last open a position if the current price break the previous daily high

      Cumulate order (limited) if you are not in profit

      That’s all
      Regarda

  7. ALE • 09/04/2017 #

    Good ideas!

  8. danibo • 09/04/2017 #

    Hi JR1976,
    thank you for posting this trading system.

    In the screenshot you attached there are some incoherences that make me think you messed up with the screenshot because in the bigger window I see:

    the CFD is “US 500 cash”
    the timeframe is “Daily” (Giornaliero)
    the test period is from somewhere before 1999 and september 2018

    while in the “Rapporto dettagliato” window I see:

    the CFD is “France 40 cash”
    the timeframe is 4 hours
    the test period is from 29/04/2013 to 01/09/2017

    The system applied to US 500 on a daily frame breaks after a few positions and if applied to the CAC 40 index, it works better but not that much.

    Please may you review your whole post?

    Thank you

    Danibo

  9. JR1976 • 09/04/2017 #

    Hi Danibo ,
    Is an error in the attachment
    Not consider screenshot cac40 .
    Soon I enclosed the complete figure of the equity Us
    obviously you can try to play the strategy on other index like cac ecc

  10. danibo • 09/04/2017 #

    JR1976, thank you for your reply.

    Still I can’t make the TS work with the US 550 because it breaks after few trades.
    Did you change the code?

  11. JR1976 • 09/04/2017 #

    NOthing change … tried with CFD US500 cash mini

  12. EchnatonX • 09/04/2017 #

    Hallo
    Im Demomodus bei IG habe ich das Problem, dass oft keine Orders ausgeführt werden können, da anscheinend der STOP Kauf zu nahe am gegenwärtigen Martlevel liegt. Änderung von STOP Kauf auf Market funktioniert im Code leider nicht. Was müsste ich da ändern?

    Translate:
    In demo mode with IG I have the problem that often no orders can be executed, because apparently the STOP purchase is too close to the current market level.
    The minimum distance must be 10 points. Change of STOP Buying on Market does not work in the code unfortunately. What should I change there?

  13. Jan • 09/04/2017 #

    EchnatonX, nice late answer of me:
    Make the stop loss a percentage of the close, like 100/10000 * close. For currency pairs just use the required pips distance x close, like 100 * close /// for Euro/dollar likewise 100 * 1,09

  14. guleny • 09/04/2017 #

    Hello
    I made some optimization to make it better. But there are 5 transacttion which increase drawdown. Can you help to optmize too
    Thanks

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Steven Bahia Hi Nicolas - great indicator - is there a way to place a alert when the Oscillator crosses ...
Nicolas Alerts can't be programmed, you have to set them yourself with the Alert tool of the platfor...
Steven Bahia just to add to this would there be a way to establish a entry price from the Oscillator
jens_kittner Since 2018 this strategy leads to bankruptcy)))))))
Jan Wind You do not HAVE to run it
Brisvegas As an exersize in writing code its fine but as a tool to make money not so much . If you hap...
JanWd Hi Francesco, nice algorithme, works with me on other markets as well !
Francesco78 thank you Janwd. Do you mind sharing where it works? happy new year!
Aaron Bennett Nice analysis, with the proposed tweak I'm seeing great performance since 2008/QE on the CAC...
juanj And the point of violation is the close of the candle that violates the line by generating a...
juanj For the latest version of the strategy or to follow updates and developments see the thread ...
phanz i backtested it with 10K units of EURUSD 1 hour i get an equity curve that is going one way ...
Wing Not yet but I plan to.
Leo Have a look in this Forum, I got something interesting for you... https://www.prorealcode.co...
Dávid Gyalus Dear Wing, As I am a daytrader, and one of my best friend is a programmer we think your a...
stratobast Good afternoon everyone. Thanks Doctrading for your work. I have an issue while using this ...
stratobast My bad guys. I understood what was the problem. The indicator uses highs and lows for the Re...
samwarduk Has anyone tried this on Bitcoin GBP1? The results look amazing but every time mine trie...
Kris75 Hi Bolsatrilera, I love this indicator! Thanks; => did you develop a strategy around...
Doctrading AH ok, I think the ca3 is the same : ca3 = pB[1] < 0.2 and pB < 0.2 Best regards,
chromosome21 Hello everybody, First, thank you so much for all your advices, I'm a begginer in trading a...
bertrandpinoy bonjour j ai un probleme avec ce code modifié, apparement PRT ne veut pas...avez vous une so...
rispardin no entiendo como funciana este indicador, por favor alguien podria explicar como utilizarlo???
AVT No se trata de un solo indicador, pero cada linea muestra otra información, de abajo hacia ...
IV Mcm Your indicator is interesting, I evaluated its relevance with the squeeze to detect the phas...
Kris75 Hi Gabri I launched a very simple strategy based on the 3 bars trailing stop that you cre...
TimDeCat Hi. Has anyone coded a version that you could alter it to say 5 bar trailing stop? ie make ...
Nicolas Please open a new topic in forums so we can code it there, thanks.
finplus bonjour, il y a un problème à la fin du code avec elsif (close 0 then ... ne manque t il pas...
kj1988 Hello Nicolas, thank you for this useful indicator. Could you tell me how I can remove the...
Nicolas remove lines 101 to 103
GraHal Yes sorry, I set up a link to a screen shot on my google drive and then I got locked into th...
gabri Here's the thread https://www.prorealcode.com/topic/multiframe-rsi-of-rsi/
Bernard13 Bonjour Nicolas, Pourriez-vous m'indiquer si cet indicateur fonctionne avec la V11 ? Le di...
HeikinAshi Do you have an update of this indicator since you've created them, or is this still the actu...
mcha Thank you for this work. Do you try to transform/put this indicator on candlesticks and is ...
David Balance thanks for sharing this excellent indicator.  Here are some thoughts.  please ad...
reb Hello Marc your strat seems very intersting, will take a look Reb
897148 What exactly is meant by Total price? Is r1 =28 in your example the no of days for "Total P...
otty82  THX looks good!
century nice one , thank you
arvindrao01 Hey! Does anyone have a pinescript (tradingview) code for this?
imokdesign Hi Everybody, when I look at the strategy I felt the need to implement a Moneymanagement-Sy...
Inertia newlevel then multiplier=multiplier+1 oldlevel=newlevel newlevel=strategyprofit+startequi...
Inertia Hi Bjoern, I was playing around with your code this morning (EUR/USD 5'). Thank you to the...
CavalierDeCesDames Bonjour Nicolas, Thanks for your use full job. I tried this indicator on a shorter timefram...
Nicolas You are welcome. I'm glad you like it.
Bolbo It does not appear over the price indicator on V11. Thanks in advance.
bearbull As per PhilipSchultz question above, has anybody managed to add code for when it turns blue,...
Ybr35 Bonjour Nicolas, lorsque je lance l'indicateur, il m'est indiqué que je dois définir les var...
Nicolas L'idéal est de télécharger le fichier itf joint sur cette page et de l'importer dans la plat...
Nicolas Merci dans ce cas d'ouvrir un sujet dans le forum ProScreener svp.
Andrea Hi Nicolas, thx for your code. Please i need your help to understand this part of your code:...
Nicolas the MA200 is ascending since 20 periods.

Top