Trendfollower EUR/USD 5M

Trendfollower EUR/USD 5M

The algorithm is searching for situations, where the range of the last 8 bars is wider than 60 pips. Opens a long position if the close is above and a short positions if the close is below the range.

Unfortunately I only have backtest data since 11/2015 for the 5 minute chart. Maybe somebody can backtest with more data? Thanks!

 

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. Elsborgtrading • 05/03/2017 #

    Thumbs up for considering your stop loss and take profit that generates RR more that 1
    Cheers Kasper

  2. juanj • 05/03/2017 #

    Here is another spin on your code that aslo works nicely;
    // Timeframe M5
    // EURUSD (IG - Markets)
    // Spread 2 pips

    DEFPARAM CumulateOrders = False
    DEFPARAM FLATBEFORE = 080000
    DEFPARAM FLATAFTER = 220000

    possize = 1

    rng = 0
    HighestClose = close[8]
    LowestClose = close[8]
    pips = 0.0019

    For i = 1 to 8 Do
    IF (abs(close-open[i]) > pips) THEN
    rng = rng + 1
    EndIf

    If close[i] > HighestClose then
    HighestClose = high[i]
    ElsIf close[i] < LowestClose then
    LowestClose = close[i]
    EndIf
    Next

    If rng >= 4 and (abs(close-open) > pips) then

    IF close > HighestClose THEN
    BUY possize CONTRACTS AT MARKET
    ElsIF close < LowestClose THEN
    SELLSHORT possize CONTRACTS AT MARKET
    ENDIF

    EndIf

    SET STOP pLOSS 50
    SET TARGET pPROFIT 225
     

    • avatar
      bjoern • 05/03/2017 #

      Thanks!!!

  3. juanj • 05/03/2017 #

    Here are another small tweak (just check Flatafter time as I am in a different timezone);
    // Timeframe M5
    // EURUSD (IG - Markets)
    // Spread 2 pips

    DEFPARAM CumulateOrders = False
    DEFPARAM FLATBEFORE = 080000
    DEFPARAM FLATAFTER = 220000

    possize = 5
    f = 12
    pips = 0.0019
    rng = 0
    HighestClose = close[f]
    LowestClose = close[f]

    For i = 1 to f Do
    IF (abs(close-open[i]) > pips) THEN
    rng = rng + 1
    EndIf

    If close[i] > HighestClose then
    HighestClose = high[i]
    ElsIf close[i] < LowestClose then
    LowestClose = close[i]
    EndIf
    Next

    If rng >= 4 and (abs(close-open) > pips) then

    IF close > HighestClose THEN
    BUY possize CONTRACTS AT OPEN + averagetruerange[f](close) stop
    SELLSHORT possize CONTRACTS AT OPEN - averagetruerange[f](close)*3 stop
    ElsIF close < LowestClose THEN
    SELLSHORT possize CONTRACTS AT OPEN - averagetruerange[f](close) stop
    BUY possize CONTRACTS AT OPEN + averagetruerange[f](close)*3 stop
    ENDIF

    EndIf

    SET STOP pLOSS 50
    SET TARGET pPROFIT 320
     

  4. juanj • 05/03/2017 #

    Also change the ATR multiplier to 2 instead of 3. Slightly better drawdown.

  5. imokdesign • 05/03/2017 #

    Hi Everybody,
    when I look at the strategy I felt the need to implement a Moneymanagement-System. Because I cant Prog this by myself, I took Kasper’s reinvestment version Code from “ALE’s Fractals breakout intraday Strategy EUR/USD 1H” and ty to implement it. Mayby it looks a little bit rudimentary, but it seems to be working! I couldn’t believe my eyes! I also take some different Numbers. Does someone get similar results (Spread: 1,5 Pips)?
     
    Here is the code:
     
    // Timeframe M5// Timeframe M5
    // EURUSD (IG - Markets)
    // Spread 2 pips

    DEFPARAM CumulateOrders = False
    DEFPARAM FLATBEFORE = 080000
    DEFPARAM FLATAFTER = 210000

    Reinvest=1
    if reinvest then
    Capital = 10000
    Risk = 1//0.1//in % pr position
    StopLoss = 26
    REM Calculate contracts
    equity = Capital + StrategyProfit
    maxrisk = round(equity*(Risk/100))
    MAXpositionsize=5000
    MINpositionsize=1
    Positionsize= MAX(MINpositionsize,MIN(MAXpositionsize,abs(round((maxrisk/StopLoss)))))//*Pointsize))))
    else
    Positionsize=1
    StopLoss = 26
    Endif

    IF (abs(close-open[2]) > 0.006) THEN
    IF (close > open[2]) THEN
    BUY positionsize CONTRACT AT MARKET
    set stop loss stoploss*pointsize
    SET TARGET pPROFIT 191
    ENDIF

    IF (close < open[2]) THEN
    SELLSHORT positionsize CONTRACT AT MARKET
    set stop loss stoploss*pointsize
    SET TARGET pPROFIT 191
    ENDIF
    ENDIF
    I would like to upload a picture but for some reason it did not work.
    Results in 3 Jears on 15min Timeframe (EUR/USD) from Juli 2015 till now: From 10.000 to 22.344 $ (without MM)From 10.000 to 236.428 $ (with MM)
     

  6. Inertia • 05/03/2017 #

    <// Timeframe M15
    // EURUSD (IG - Markets)
    // Spread 2 pips

    DEFPARAM CumulateOrders = False
    DEFPARAM FLATBEFORE = 080000
    DEFPARAM FLATAFTER = 210000

    TS = 25 // 35 default
    SL = 50
    PT = 80
    m = 8 // 8 default

    once startpositionsize=1
    once positionsize=startpositionsize
    once flatoverweekends=1
    once startequity=0
    once Reinvest=1

    if reinvest then
    //------------ Fixed fraction money management ----------
    once multiplier=1
    once delta=100 // newlevel then
    multiplier=multiplier+1
    oldlevel=newlevel
    newlevel=strategyprofit+startequity+multiplier*fraction
    positionsize=multiplier*startpositionsize
    elsif strategyprofit+startequity=2 then
    newlevel=strategyprofit+startequity
    oldlevel=strategyprofit+startequity-multiplier*fraction
    multiplier=multiplier-1
    positionsize=multiplier*startpositionsize
    endif
    Endif

    if flatoverweekends then
    //————— daylight-saving corrections ——————
    if currentmonth=3 and day>=15 then
    dlc=10000
    elsif currentmonth=11 and day=(223000-dlc))
    else
    fridaynight=0
    endif

    if fridaynight then
    if longonmarket then
    sell at market
    elsif shortonmarket then
    exitshort at market
    endif
    endif

    REM Conditions to enter long hereafter
    IF (abs(close-open[m]) > 0.006) THEN
    IF (close > open[m]) THEN
    BUY positionsize CONTRACTS AT MARKET
    SET STOP pLOSS SL
    SET TARGET pPROFIT PT
    ENDIF
    ENDIF

    //trailing stop
    trailingstop = TS
    if not onmarket then
    MAXPRICE = 0
    priceexit = 0
    endif

    //LONG order
    if longonmarket then
    MAXPRICE = MAX(MAXPRICE,close) //saving the MFE of the current trade
    if MAXPRICE-tradeprice(1)>=trailingstop*pointsize then //if the MFE is higher than the trailingstop then
    priceexit = MAXPRICE-trailingstop*pointsize //set the exit price at the MFE – trailing stop price level
    endif
    endif

    //exit on trailing stop price levels
    if onmarket and priceexit>0 then
    EXITSHORT AT priceexit STOP
    SELL AT priceexit STOP
    endif

    SET STOP ploss SL//
    >

  7. Inertia • 05/03/2017 #

    Hi Bjoern, I was playing around with your code this morning (EUR/USD 5′).
    Thank you to the community for the piece of code (Despair for the MM module…).

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Dunstan I would like to get guidance_ How do I access and attach this indicator to my MT5 platform...
Nicolas You can't, use prorealtime, it's way better
jc84 Thank you very much for this indicator , not provided by PRT I was actually working at thi...
Nicolas Oui le code est correct et il fonctionne, j'ai de bons résultats sur la liste NASDAQ par exe...
pincherman Bonjour :-) J'ai coller le script dans prorealtime pour jouer avec le supertrend et j'ai un...
Nicolas Vous l'avez sans doute collé au mauvais endroit, dans l'éditeur de code pour les stratégies,...
IV Mcm Bonjour, Je ne reconnais pas cette ligne dans le code, essayer de télécharger directement le...
Manu L. Bonjour, Possible de créer un screnner multiframe Mois dans Ichimoku semaine dans Ichimok...
Guillaume Mcm I gave the above message fix ;)
Tradingrob Is it possible to put the itf-file in the right way here in Prorealcode? so the right 'trend...
Guillaume Mcm Update link ;) https://www.prorealcode.com/topic/trend-histogramme-cci-mise-a-jour-suite-...
oliverkeim Hi, also here not working. Only white lines.
killerplatuze Dont work anymore with the current version?
KryptoKat tolle Arbeit, professionell
Bard Hi @Vonasi, this is an excellent tool! I noticed you times by 180 and was wondering why? W...
Bard I have no idea what is wrong with the posting on this website. I have problems editing posts...
Bard And now my first post displays okay? It literally had copies of my orig post all added toget...
Screw27 Hi man, I installed the indicator and i don't know why but my graph it is so big
HelixKing sounds interesting I'll take a look
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...
Nicolas Ask on an Excel website?!
JJMR HOLA NICOLAS, TENGO LA ULTIMA VERSION ACTUALIZADA DEL INDICADOR TTM SQUEEZE PRO EN LA VERSIO...
imokdesign @nicolas ,if in want to "call" this indicator, which values i have to write down?
Screw27 Salut nicolas j'aimerais savoir tes résulats grace a cettte methode
eva.g.forsgren It dose not work, I get a strap instead of candels???????????????????????????????????????????
Nicolas That indicator is the one below the chart. The indicator to put on the price chart is this o...
pyhrus P.S : IG , que j'ai contacté ,m'indique que la version V11 , ne sera pas disponible avant un...
Hasardeur Dear Nicolas, is there someting at the arry to modify in order to run the trend at the actu...
MALIMALO Dear Nicolas, just try touse your indicator with backtest but it's not working. is anybody...
ribes65 Bonjour Nicolas, Merci pour votre travail. Est-il envisageable de créer un screener pour ...
Nicolas Bien sûr, merci de formuler une demande dans le forum des screeners pour prorealtime. En res...
ipbvba Est il possible de le transformer en indicateur (pour ne plus avoir les lignes mais uniqueme...
supertiti Bonjour Nicolas, Je ne comprend pas bien , le trend change de couleur quand les prix sont a...
Nicolas Oui ce serait possible, cependant l'indicateur est bien prévu pour conserver la couleur de l...
supertiti Quand tu pourras si tu peux nous coder la troisième couleur cela améliorerait les trades cou...
Nicolas How to import file page: in the help section of the website explains howto
kenssa import through the indicator page/window in the Proreal time
chicoteca Buenas, no consigo que se me muestre en el chart de DAX. ¿Cómo procedo? Gracias.-
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 ...
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?
carpentier Joffrey Bonjour à tous, Avant tout merci pour ce travail, cependant je suis bloqué quand je l'insta...
carpentier Joffrey Re, C'est ok, j'ai trouvé mon erreur... Cependant sur quel base peut on calculer son CALC...
Aragorna Hi Nicolas, How is it possible to use it in a higher timeframe plotted on a lower timeframe?...

Top