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
Related users ' posts
Stockastiss Can this code be simply transferred into Backtestingcode so one doesnt need to use call ? (i...
Vonasi Sorry for the late reply. Add the code to your strategy and remove line 5 and line 39. Chang...
viktorthunss Hi! How many averages are there? Can I see the somewhere?
FXmike hey my friends, thank you for this great code. my problem is he make no trade open. backtest...
FXmike Can i put a Action that my start contract is smaller than 1 ? 0.3 or 0.5 ? In wich Position...
phoentzs I wrote the code for M15 back then and also variants in H1 and M1. Everything works so far....
leofi https://www.prorealcode.com/topic/simple-average-with-visual-color/
leofi Go visit www.prorealcode.com/topic/simple-average-with-visual-color/ and watch 2em post
Dritan Hi,I am new on Prorealtime and coding.I downloaded the indi but I have it on a separate wind...
Nicolas Just add it on the price series.
yomisadiku Hello Nicolas, Can I use high and low price at lines hh=max(hh,close) and ll=min(ll,close) ...
Nicolas Yes you can do that, the impact will be that the trailing stop line will be much close to th...
Byggtrader Hi Nicolas! How do I get the indicator in the price chart? It only stays under i new chart.
Nicolas Just add it on the price chart by using the wrench on the left upper side of the chart (pric...
Dom Hello, hello....je commence le trading et découvre par la même occasion le codage....et ce n...
Nicolas Merci, ça fait plaisir !
Be-n Bonjour tout le monde ! Dans l'indicateur de tendance, j'ai du mal à saisir la nuance entre ...
Globalmarkets79 Thank you Vonasi for the answer. I have an other question. When i tried to run the indicator...
Vonasi Lines is either 0 or 1 to turn on or off the drawing of them. Once again if you download and...
Globalmarkets79 Thank you Vonasi, this indicator is very helpful!!!
Nicolas
5 years ago
Bateson Merci pour la réponse Nicolas. C'est bien ce que j'ai fait mais ça ne fonctionne toujours pa...
Enzo Paliotti Veramente ottimo, era quello che cercavo, si potrebbe modificare inserendo come variazione a...
Nicolas Perché no, chiedetelo con una descrizione dettagliata nel forum degli indicatori, per favore!
jiddan78 how to convert to afl amibroker ?
Nicolas We do not supply free coding assistance for AFL Amibroker on the website. You can ask for pa...
Ngomsi @ Vonasi, how to use timeframe , 13 minutes ,21 minutes, 34 minutes,et 55 minutes with this...
manchokcity can we have it in mql4 platform? or how or which platform do we use it?
camporan I don't use MetaTrader so I won't be able to do the translation myself. Sorry!
Alexander9 This can for amibroker ? . Thanks
riz001 thnk u
geroniman bonjour Nicolas, j ai un indicateur le Tiger . J aiemrai placer des fleches buy et sell dire...
Nicolas Merci de formuler les demandes sur le forum. ça n'est pas le bon endroit et hors sujet ici ! ;)
avatar
Anonymous Hi robertogozzi - thank you very much for sharing this strategy. I have performed various ...
robertogozzi Thank you samsampop.
Dotan Hello guys I really appreciate this coding effort but can I use this code for Mt5 Forex Trad...
LucioleLucide Clean view, thanks for sharing
dertopen hi where i can found the window for candle configuration?
paolosab69 Ciao! . I have seen the pictures that explain this metod but i don't understand when is mome...
coscar Ottimo lavoro. come sempre!
luxrun Nello studio di Sepiashvili viene descritto anche un altro indicatore, il Q-indicator, che è...
Maik2404 wie kann ich den Code bekommen Paul?
jens_kittner Works with US Crude at 1h as well!
Jean-Claude REGIS Je préconise de regarder les graphiques H1 et M15 pour visualiser la tendance de fond et d'...
capgros Bonjour @Nicolas, Thanks a lot for this tool, it is very useful for me. I would like to s...
Hans63 Would you add the possibility to color also the Heikin Ashi and bar chart?
Nicolas That's possible, please open a new topic in the indicator forum explaining what you need exa...
Nicolas
6 years ago
BSTrend
v10.3
BSTrend
10
Indicators
Florian Legeard C’est à dire sur le prix et non sur le temps ? Merci
Rohit82189 bstrend repaints
Nicolas No, it doesn't repaint.
cfta Hi Fulvio, many thanks for sharing this clever indicator, much appreciated. As Pepsmile ment...
cfta Sorry adding the PRT to code didn't work in the above comment so I guess we will have to set...
juanj Something appears to be wrong with this formula as graphing t shows t to almost never be wit...
Nicolas
6 years ago
Maxime Baudin Interesting, Thank you! :)
franck-david Bonjour Nicolas , actuellement je me forme grace a vos videos tres tres bien expliques mer...
Nicolas Merci. ça n'est pas le lieu pour poser ce genre de question :) Merci d'utiliser le forum Pro...

Top