Moving average trading system

Moving average trading system

EN / Hello everyone,

Here is an automatic trading strategy based on the Mobile Averages.

This code is very simple because I started in this discipline! 🙂

I need your help to optimize the code. I would like to filter out false signals in order to have more winning positions and reduce drawdown.

Thank you in advance for your help.

Best regards,

DJ

 

FR / Bonjour à tous,

Voici une stratégie de trading automatique basée sur les Moyennes Mobiles.

Ce code est très simple car je débute dans cette discipline ! 🙂

Je sollicite votre aide afin d’optimiser ce code. J’aimerais filtrer les faux signaux afin d’avoir davantage de positions gagnantes et réduire le drawdown.

Merci d’avance pour votre aide.

Bien cordialement,

DJ

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. klaus • 09/27/2016 #

    Hi Matriciel,
    on which timeframe and Indices does your code run?
    ciao Klaus

  2. Matriciel • 09/27/2016 #

    Hi Klaus,I’m about 15 minutes time frame and I trade on the DAX30.

  3. Matriciel • 09/27/2016 #

    Hi Klaus,I’m about 15 minutes time frame I trade on the DAX30.

  4. Fabio Anthony Terrenzio • 09/27/2016 #

    what do 0.998 and 1.002 factors represents?

  5. Matriciel • 09/27/2016 #

    These are the moving averages offset on the vertical axis.

  6. Fabio Anthony Terrenzio • 09/27/2016 #

    It’s incredible, this little offset make big difference! dunno why..

  7. PRT_kok • 09/27/2016 #

    Amusante cette petite strat : elle est positive sur 200000 ut mais tu obtiens un DD de 78% du benefice et un profit factor de 1,10.
    cordialement.

  8. chaostrader82 • 09/27/2016 #

    Hi Matriciel,
    How do you change the limit to take profit ? kindly advice 

    • Matriciel • 09/27/2016 #

      Hi Chaostrader82,
      You can play with the value of the trailing stop.This one works well : SET TARGET pPROFIT 300

  9. Matriciel • 09/27/2016 #

    Je voulais dire : “take profit” et non “trailing stop”… 🙂

  10. Matriciel • 09/27/2016 #

    I wanted to say “take profit” and not “trailing stop” … 🙂

  11. chaostrader82 • 09/27/2016 #

    hi marticiel , can you email me at xxxx ? i want to work with you on the development of the codes 

    • Nicolas • 09/27/2016 #

      Please dont put your email address publicly on the website. If you want to make a dev team for improvements of this strategy, I suggest you to make a new thread on the forums where everyone in interest should help. It makes senses since everything here is completely free and share the same sharing spirit. Thanks.

  12. chaostrader82 • 09/27/2016 #

    Dear Matriciel , you should try removing these 1.0998 , 0.0998 , these functions actually draws down your profits .I made it more cleaner but it is for scalping only. i only tested on some of the pairs so far. maybe you want to have a further look at it. This is only for a trending market that has a definate trend, if its a sideway market dont use this because the MAs will trigger and you will get whipped sawed.
    // Conditions pour ouvrir une position acheteuse setting (1000units 15mins chart )indicator1 = closeindicator2 = Average[5](close)c1 = (indicator1 CROSSES OVER indicator2)
    IF c1 THENBUY 3 CONTRACT AT MARKETENDIF
    // Conditions pour fermer une position acheteuseindicator3 = closeindicator4 = Average[7](close)c2 = (indicator3 CROSSES OVER indicator4)
    IF c2 THENBUY 3 CONTRACT AT MARKETENDIF
    // Conditions pour ouvrir une position acheteuseindicator5 = closeindicator6 = Average[60](close)c3 = (indicator5 CROSSES OVER indicator6)
    IF c3 THENSELL AT MARKETENDIF

  13. chaostrader82 • 09/27/2016 #

    Dear Matriciel , can you add in the following ? stoploss=30pips , take profit= 4pips <=== after you are done pls paste it back here. Thanks 

  14. chaostrader82 • 09/27/2016 #

    Theres some bugs still with this program , can somebody help to improve on the following?
    Improvements needed 

    BUY if current close is higher than previous close 
    No stoploss or take profit settings 

    Notes : Strategy only works in a upward trending market, heavy losses in a downward or whipped saw trend 

  15. Matriciel • 09/27/2016 #

    Hi Chaostrader82,You know, I’m starting in automatic strategy coding so I’m not going to be able to help you a lot.

avatar
Register or

Likes

avatar avatar avatar avatar
Related users ' posts
Patrice210 bonjour STANKO, effectivement la première ligne apparait en anomalie et je ne comprend pas v...
KumoNoJuzza Hi guys, Thanks @Stanko and everyone for your contributions. I have been playing around ...
Stanko Hi KumoNoJuzza, thanks for the post. I also tried your code with Dax and the performance is ...
thomas2004ch Hi, Is this startegy suitable for daily SPY? Regards
ebous64 Je cherche à traiter des effets de bords avec un encadrement ajustable des variables. Vous a...
thomas2004ch What are the values for nbx, nby, pbx, pby, ptsup, stplos, stptg, tp, vsmax, vsmin?
JohnScher Postscript: It's running in the live right now. One position after the other is opened. ...
ullle73 nice!! how's it been since your last post on going live? :)
thomas2004ch Hi, Is this strategy suitable for daily SPY? Regards
adconsulting
3 years ago
japan 225 cash 1 h
japan 225 cash 1 h
31
Strategies
superfalcio Hello adconsulting, after the 2024 performance are you going to adjust the japan parameters?
adconsulting ciao, ho fatto delle modifiche. mi sono spostato sul time frame a 15 minuti per ridurre gli ...
superfalcio ok grazie, ottimo lavoro, sto vedendo le simulazioni... - a me non piace per principio il D...
Darren Nash I found this works well on the DOW
thomas2004ch Hi John, Is your strategy suitable for daily SPY? Regards
gatowman Hi, ich bin leider Anfänger, habe den Code zwar importiert, aber scheinbar läuft er nicht au...
KAMJKAZE thanks, really interesting!
2c95 thanks, why do U prefer average than lowest ? to close under average does'nt mean another...
emism12 Looks great, personally I don't use automated trading for single stocks, but is definitely o...
adconsulting Ciao, I look that the strategy (backtest 50 k), works very good wiht US 500 CASH 1 EURO in...
Kev Monaghan The equity curve looks to follow the stock price almost perfectly, Have you tested on stock ...
cdc.andersson Hello, I´m trying to paste the code and start testing but can´t get it to work in PRT. Shoul...
Lupo32 Thank You Aaron
superfalcio I'm having no more issue on the new Prorealtime release 11.1
Jigsaw20000 Bonjour, Je voudrais mettre le liens du code en format .itf mais je n'y arrive pas , quelqu'...
Corto78 Il faut aller dans la liste des ProBacktest & Trading Automatique (là ou tu as créer ton...
Malloc Bonjour, Votre système a l'air intéressant et prometteur mais en l'état il est inutilisable...
juanj
4 years ago
herke036 For the question how to fill the variables a,b,c,d,e,f,g, x and y? a,b,c,d,e,f,g is selecti...
herke036 In your code I see If onmarket = 0 and Type22 = 1 and hora1 and hora2 Then If InsideBar[1]...
UkDownUnder How do we apply this to a strategy we have made, Thanks
superfalcio Hello, on the 2h timeframe I got a better performance in terms of win% and profit factor. I ...
Jiankyr82 Juan thanks for sharing, I had played with it few days, as also try to catch up on my pro-re...
Lespa212 Hi Samsampop, are you using this strategy? did you add a SL and an exit in case of a trend ...
imonix Have been trying this on demo since Monday before deciding whether to go live with it. Using...
Roberto Blázquez I'm sorry, I've tried it since November 2012 and it's bad results.
Doctrading
5 years ago
Stanko Ciao doctrading, grazie per il tuo contributo. Volevo chiederti se hai tenuto in osservazion...
Stanko Buongiorno doctradinge buongiorno a tutti. Vorrei riportare all'attenzione questo sistema p...
Meta Signals Pro Hi, Yes I am monitoring all the strategies posted on this site and I confirm that the strat...
Pierreco1991 Hello Can you confirm this configuration for FRANCE ? //Time in UTC+8 Rest0Minutes =...
Godo Bonjour Souhait Sam, Après de nombreux essais pour le mettre en format afin d'utiliser ce c...
Nicolas Il faut supprimer celles qui existent dans la fenêtre d'optimisation et les créer en dur dan...
crusoe76 hi there, anyone can help making this strategy work, i have a message saying replace variabl...
Ciccarelli Franco Per lasciare che la strategia venga eseguita (dopo aver importato il file): Basta eliminare...
JADINVEST Hello Jan, hello everyone, Thanks Jan for this strategy! Since 2020, have any of you found a...
Alessandro Furlani Hi Ian, hope you still use PRT and so you can read this post. I have tested a lot your work ...
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....
Jan Wind Thanks for sharing ! The Gain/Loss ratio is a bit low, 1,16, hardly offset the risks take...
drive whats the period ?
Lucas0000 Hola. estoy buscando un programador en proorder, para hacer un programa basado en el Q-trend...
Ludwig Bonjour Merci pour le code, je souhaite intégrer un break even et mette en place un réinves...
superfalcio hello, this strategy is pretty interesting, anyway on index after diferent suggestion and im...
Fralex Hello everyone I optimized the original “LongOnly-DAX-4H-TMA-Channel” algorithm over a pe...
YvesRobert @robertogozzi. It's done. Thank you
YvesRobert Hello Roberto, some questions about your strategy. 1 - Do the 2 lines SET TARGET pPROFIT T...
robertogozzi 1. The 2 lines SET TARGET pPROFIT TP and SET STOP pLOSS SL are always executed, each bar. Bu...

Top