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
kats Bonsoir, cet indicateur est vraiment très bien avec plusieurs possibilités en coloration . ...
roccafragius Thank you Ivan for your indicators, very very interesting!!!!
Gaspare Ciao Ivan si puo' inserire una strategia su questo indicatore per ottimizzare le variabil...
Iván Hi! You should change $rbox, $gbox and $bbox variables. Also r,g,b for last box.
finplus Thanks Ivan.
roccafragius Ivan, I just want to say you.. very very great job!!!! Thank you so much for this indicator!...
Iván
2 weeks ago
Iván Si lo descargas e importas en tu PRT verás que se han creado las variables para luego config...
WhyAskOZ Hi, Ivan As always you are doing great coding. The code works on my PRT, however the issu...
Iván You can delete in the last line (return) the configuration for color. Delete coloured(xx,xx,...
P. Marlowe Quite an impressive work, Iván. Extremely useful and accurate. Congratulations. Keep it up¡
lkiklkik i love it !!! thanks.
Stenozar Hi Ivan, can you translate from tradingviwe the EMA TREND METER INDICATOR? It couid be inte...
Iván Hi Yes I can. Please, create a new topic for that I will translate it.
Stenozar Hi Ivan, I've created a new topic about the indicator: https://www.prorealcode.com/topic/ema...
Doddge Hola Iván, ¿sería posible crear un screener que indique cuándo las velas coloreadas del indi...
RTR Ivan thank you for the pro-screener. I a trying to understand how to write the signals from ...
Iván Hi, Lines 62 and 63. These lines define buy and sell conditions.
Iván Hi You should delete from the indicator code all drawing functions and all variables not us...
Iván I've created a screener to show [longcondition or shortcondition]
Chrisinobi Hallo Ivan, Danke das ist Perfekt !! Kannst du bitte in der Screener-Bibliothek die itf. hoc...
MaoRai54 Thanks, now it's OK. in your first code at line 15-16 it's missing.
Madrosat Hello Ivan Did you try a strategy with this indicator
Iván Hi. No I didn't. This is a code translation requested by an user a few days ago.
Iván
2 months ago
cjr30 Simplemente modifica las lineas 19 y 21 por las siguientes: drawtext("▲",barindex,low-0.1*a...
groelandes Gracias!!
WhyAskOZ i copied the code into strategy and it gives error on line 21 and 23. it says " Line 1: ...
Iván
2 months ago
Madrosat Hello Ivan You have interesting topics on indicators , smart supertrend, optimised trend t...
Iván Hi! thanks. All of these codes are translations requested in the forum. I've on mind to back...
Raspete01 Buenos días Iván, estoy intentando llevar el código eliminando los colores y pasando un Back...
jacquesgermain sì da aggiungere
Maik2404 auf welchen Wert muss ich die Kompresionsperiode stellen?
jacquesgermain — Période de compression : ce paramètre détermine la période de rétrospection utilisée pour ...
Iván
3 months ago
ARLEQUIN49 Hello Ivan, Would it be possible to convert the code of this QQE MOD indicator which accomp...
ARLEQUIN49 here is the code: //@version=4 //By Glaz, Modified // study("QQE MOD") RSI_Period = i...
Iván Hi, Yes I can translate it but please, create a new topic for it.
Fgats quelques explications en Français ici : Some explanations in French here : https://www.p...
Nicolas Merci pour cette contribution, j'apprécie ! :)
Fgats Merci Nicolas pour ces encouragements et merci aussi pour le commentaire en Anglais accompa...
Alai-n I really like it when you develop ideas around price movement! I am much less a fan of all t...
finplus Bonjour, une petite demande concernant cet indicateur : comment faire pour que lorsque la bo...
LucasBest Bonjour, la coloration des bandes se fait ligne 111 et 112 à l'aide des instructions colorbe...
elcortijoverde Muy buen trabajo.Intuitivo y claro.Gracias por tu dedicación y aportación.

Top