Universal XBody Strategy on CAC (1Day)

Universal XBody Strategy on CAC (1Day)

Hello everyone,

I have the pleasure to share with you this simple but practical, universal daily strategy (for Forex, Indices, and Stocks), optimized on the CAC from 1992 to today. I hope that this opensource contribution can bring more developments in the field of automatic trading strategies on prorealtime, and demonstrate once and for all that a strategy to work does not necessarily have to be complicated, indeed (as I see it) the simpler it is, the more likely it is to work in the future as in the past.

  • Brief explanation

The strategy has 3 fundamental parameters to optimize primarily which are: Period, Mode, and invertsignal. Once these have been chosen, we move on to the optimization of the two filters: filter1 and filter2. Finally, if you want you can add, a stop loss based on the average true average.

Here is the code

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. Lavallette • 261 days ago #

    Hello David, thanks for sharing this strategy that gives good results for many different instrument types.

    A couple of questions if you don’t mind.
    The range of Filter2 is from 1-100 but the value is 0.
    Are you trading this strategy live? I’m asking as it is always on the market, the number of trades is important. With the slippage in real trading, I wonder if the results are close from the backtests.

    Talking backtests, I tried various trailing strategies but have not found a good one yet. Have you?

    If you are trading it live, are you using the parameters optimized on the whole time? I’m asking because when I try various walk-forward optimizations the results are not as good.

  2. davidelaferla • 261 days ago #

    Hello Lavalette! The filter interval starts from 0, and not from 1, in fact when period and mode are optimized, it must remain 0. I trade with this strategy in real and I’m not finding substantial differences with the backtest at least in this or higher timeframes of the daily . I mostly don’t use trailing, as I wrote in the post it is better to use a simple stop loss. I always use the optimized parameters especially when they work in many years of backtesting at least 10-15 years, and return a graphically constant equity.

  3. davidelaferla • 261 days ago #

    The most interesting finding about this strategy is that natural selection of the best parameters is observed over time, so that after a sufficiently long time the best parameter stabilizes.

  4. Ciccarelli Franco • 247 days ago #

    Ciao David, sto provando il tuo ottimo codice sulla coppia EUR/USD TF un giorno test esteso a 10 anni e i risultati sembrano buoni (allego foto), ma nell’ottimizzare facendo come dici tu , il valore del filtro 2 che dovrebbe essere 0 , mi da invece 28. Non ho cambiato nulla, ho solo aggiunto un SL e TP che lavorano sull’ATR.

    • davidelaferla • 242 days ago #

      Ciao Franco! Non riesco a vedere la foto allegata (è meglio se me la mandi tramite link) . Il valore del filtro 1 e del filtro 2 , devono rimanere a 0 solo durante l’ottimizzazione del period e del mode, infatti sono solo un perfezionamento della strategia e quindi vanno ottimizzati dopo. E’ normale che il valore del filtro 2 ottimizzato dia un valore diverso da zero, nel tuo caso 28.

  5. Ciccarelli Franco • 237 days ago #

    Grazie per la risposta, non riesco (o non sono capace) a mandarti il link , comunque farò come dici tu per l’ottimizzazione. Sto continuando a provare in demo, da dei buoni risultati, ma se l’entrata è sbagliata, il loss funziona solo a fine giornata ed è un guaio, si può ovviare?
    Grazie

    • davidelaferla • 236 days ago #

      Lo Stop loss, come anche il target profit, essendo funzioni native di prorealtime, funzionano in tempo reale e non solo a fine giornata. Chiaramente lo stop loss, può essere eseguito una sola volta a candela , e non deve interferire con il target profit, quindi controlla bene che la modalità tick per tick ti risulti 0, o comunque un numero molto basso in confronto al numero totale dei trade. Ti saluto e ti auguro profitti costanti.

  6. Ciccarelli Franco • 235 days ago #

    Hai ragione, mi dava valori alti perchè usavo questo loss “SET STP LOSS 1xAverageTrueRange{10} (close)”, ho provato a mettere un un semplice loss in punti e le cose sono diventate ragionevoli. Almeno questo è quello che è successo e non so il motivo, forse tu capirai.
    Grazie
    Grazie

  7. YvesRobert • 217 days ago #

    Hello davidelaferla, how do you put a stop loss and where exactly ? the moment you enter on the market I suppose ? how many distance with the tradeprice ?.
    I tried to find optimized parameters in low time units 1mn 5mn, 15mn, to do daytrading, but I suppose they dont remain the same from one day to another, or one week to another ?
    Thank you and have a good day

  8. Hypersimo • 179 days ago #

    Buongiorno Davide
    a quale distanza inserire stop loss e tp nella strategia?
    grazie

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar
Related users ' posts
Kris75 Hi, This is great !! anyone ever developped a strategy about it ???
swapping hello Kris75, not that I know but it is possible to make a scenario ;)
digitation Hi swapping, Thanks for sharing this useful tool. I was wondering how difficult it would be...
fredfilm Hi Nicolas, how could we add a price screen to this? eg stock prices between $1 to $3 etc
Despair What do you mean by “German extra stocks”?
odin i mean german xetra stocks :-)
Despair Ok! Thanks.
Mully Bonjour, est ce que quelqu'un sait comment ajouter les niveaux de résistances / supports su...
Nicolas Il s'agit de l'indicateur "volume par niveau de prix" disponible par défaut dans la plateforme.
Actabi Thank you ! Have you realised your "next step" ?
Jessar guten Tag, gibt es bereits die Aktualisierte Datei?
Per Inge Gents - An update - I have been studying various trading approaches, as this one that is bas...
Gianluca thank you very nice screener
Vonasi An interesting idea that was easily turned into a strategy on a shorter time frame that appe...
Stenozar Hi Vonasi, is it possible for you to share your code here? thanks in advance
Vonasi Sorry Stenozar. I have only really spent an hour or so on this strategy so far and it is far...
Nicolas Sorry again, doing my best to fix this problem..
Gianluca Sorry but the 2° code that you posted have some problem it doesn't work
Leo I have to check
LancerX This catch my attention, tried to load in pro order but not coming through. What variables n...
macdopa Hello ALE. Is there any way to help us develop or program an algo-strategy for automatic tr...
Giuseppe68 Ciao, sono nuovo e poco esperto, volevo chiedere perchè il ProBacktest lo esegue correttamen...
GraHal Is this the Discussion Topic you need @Gregg https://www.prorealcode.com/topic/scalping-i...
bertrandpinoy bonjour Nicolas y a t il une possibilité de signal sonore dès qu une vente ou un achat serai...
Nicolas Oui cela nécessitera une adaptation du code cependant, merci de formuler une demande sur le ...
bertrandpinoy BONJOUR PAUL impossible de tenter le trading automatique, PRT me dis que l instruction "GRAP...
Paul Bonjour, supprimez les lignes avec un "graph"
bertrandpinoy merci. vous l utiliser actuellment sur quel instrument vous? et quel timeframe? Merci
EchnatonX Hallo Im Demomodus bei IG habe ich das Problem, dass oft keine Orders ausgeführt werden kön...
Jan EchnatonX, nice late answer of me: Make the stop loss a percentage of the close, like 100/...
guleny Hello I made some optimization to make it better. But there are 5 transacttion which incr...
Francesco78 Hi CKW, yes I do run it live, and so far I had no problem, which kind of errors?
JohnScher Hello Francesco. Are you still active with the Threeliner? I also follow that, that you ...
fatlung Hi Francesco May I know the time zone applicable to this strategy?
Doctrading Hello, Higher timeframes are better. I suggest D1 or H4.Best regards,
Pinkybouh hello, I propose to add another conditions: ie: haussier: close > open and close >...
TheHovisTrader I'd be interested in the actual profit of this - in the example the stop range is at least 2...
DEIO Hi sublime06, I tank you for the compliments, but first of all I STRONGLY want to warn yo...
bertrandpinoy Bonjour Deio excusez moi je ne comprend pas le principe du SL et du TP sur votre strategie.....
bertrandpinoy bonjour avez vous un TP et SL pour cette strategie? merci
Lyam Pareil ne marche pas dommage
ahmedbouaziz89 Bonjour, quand j'ajoute le code ou le fichier dans l'outils screeners de Prorealtime je ne v...
tyvix Bonjour le code marche bien c est juste qu'il n y a pas d opportunité au moment ou vous le...
julien1978 The ADR value that is plotted intraday does not match the value of the regular ATR indicator...
Fab666 I've tried to get a fix for this also but no luck, it doesn't print the correct data as far ...
Seabiscuit Hi! With the new PRT update, this indicator does not work anymore

Top