RSI-EMA EurUsd M15

Viewing 15 posts - 1 through 15 (of 80 total)
  • Author
    Posts
  • #169771 quote
    phoentzs
    Participant
    Master

    Here is a little strategy from me. Profitable over a full 200,000 bars in a small time unit. Unfortunately, the yield is not huge. But the interesting thing is that you can trade well with just a single filter for such a long time. Also works with a Bollinger entry and EMA60 as a filter.
    Maybe someone has an idea how to get more yield out.
    Unfortunately, I have not yet found any other currency pair that works consistently well in a similar manner.
    Ideas and improvements are very welcome.

    //-------------------------------------------------------------------------
    // Hauptcode : #KISS RSI5 EurUsd M15
    //Spread = 1
    //-------------------------------------------------------------------------
    DEFPARAM CumulateOrders = false
    defparam preloadbars = 2000
    
    Nlong = 1
    Nshort = 1
    
    MAXSHARES = abs(COUNTOFPOSITION) <= 1
    
    //EMA-Trend
    EMA1 = ExponentialAverage[45](close) //50
    //EMA2 = ExponentialAverage[ma*1](close)//H1
    EMA3 = ExponentialAverage[45](close) //60
    
    EMAlong = close > EMA3
    EMAshort = close < EMA3
    
    steigunglong = EMA1 > EMA1[1]
    steigungshort = EMA1 < EMA1[1]
    
    myATR = AverageTrueRange[12](close)
    
    //RSI5-Eingang
    myRSI = RSI[5](close)
    rsilong = (myRSI[1] > 30) and (myRSI < 30)
    rsishort = (myRSI[1] < 70) and (myRSI > 70)
    
    rsilongraus = myRSI > 75
    rsishortraus = myRSI < 30
    
    IF Time >= 010000 AND Time <= 230000 THEN
    
    IF rsilong and EMAlong and steigunglong and MAXSHARES THEN //and emalongkurz
    BUY Nlong shares at market
    //SET STOP %LOSS 0.35 //120
    //Set target %profit 0.975 //40
    SET STOP LOSS myATR*6 //120
    Set target profit myATR*7
    ENDIF
    
    IF rsishort and EMAshort and steigungshort and MAXSHARES THEN //and emashortkurz
    sellshort Nshort shares at market //BollUp[1]limit
    //SET STOP %LOSS 0.975 //130
    //Set target %profit 0.9 //40
    SET STOP LOSS myATR*10 //120
    Set target profit myATR*9.25
    ENDIF
    endif
    
    if longonmarket and rsilongraus then //c2
    sell at market
    endif
    if shortonmarket and rsishortraus then //c1
    exitshort at market
    endif
    
    //if time = 230000 then //and dayofweek = 5 then
    //sell at market
    //EXITSHORT at market
    //endif
    
    //************************************************************************
    //trailing stop function
    trailingstartL = 23 //30 15 trailing will start @trailinstart points profit
    trailingstartS = 18 //30 15 trailing will start @trailinstart points profit
    trailingstepL = 9 //2 1 trailing step to move the "stoploss"
    trailingstepS = 2 //2 1 trailing step to move the "stoploss"
    //reset the stoploss value
    IF NOT ONMARKET THEN
    newSL=0
    ENDIF
    //manage long positions
    IF LONGONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND close-tradeprice(1)>=trailingstartL*pipsize THEN
    newSL = tradeprice(1)+trailingstepL*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND close-newSL>=trailingstepL*pipsize THEN
    newSL = newSL+trailingstepL*pipsize
    ENDIF
    ENDIF
    //manage short positions
    IF SHORTONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND tradeprice(1)-close>=trailingstartS*pipsize THEN
    newSL = tradeprice(1)-trailingstepS*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND newSL-close>=trailingstepS*pipsize THEN
    newSL = newSL-trailingstepS*pipsize
    ENDIF
    ENDIF
    //stop order to exit the positions
    IF newSL>0 THEN
    SELL AT newSL STOP
    EXITSHORT AT newSL STOP
    ENDIF
    Nicolas, Midlanddave and Eric thanked this post
    #169985 quote
    phoentzs
    Participant
    Master

    Can one of the coders please help me? Unfortunately, my abilities are limited. If I understand correctly, my strategy here is a greatly simplified variant of the Vectorial DAX system. The trend is only given via the slope of an EMA. With WF in different variants, I always got EMA45 as a result. So I assume that it seems to be quite robust.

    Can someone give me the code snipet with which I can calculate the slope directly? Or the angle of the slope? Or even incorporate it into my strategy? Many Thanks!

    #169987 quote
    robertogozzi
    Moderator
    Master
    #170007 quote
    phoentzs
    Participant
    Master

    Thank you Roberto for pointing this out. I can now see how simple my code is. But maybe this simplicity also makes it so robust? 8 years in M15 and always a winner almost every quarter. I’ll try to work my way into the topic and maybe even tinker something.

    #172642 quote
    deletedaccount100622
    Participant
    New

    Lovely system

    #172644 quote
    phoentzs
    Participant
    Master

    Sehr einfach, aber profitabel über Jahre hinweg. Hast du einen Vorschlag für Verbesserungen? Ich habe festgestellt, je mehr Filter man verwendet, desto eher landet man bei Überoptimierung.

    Very easy, but profitable for years. Do you have a suggestion for improvements? I’ve found that the more filters you use, the more likely you are to end up over-optimizing.

    #172647 quote
    robertogozzi
    Moderator
    Master

    @phoentzs

    Only post in the language of the forumthat you are posting in. For example English only in the English speaking forums and French only in the French speaking forums.

    Thank you 🙂

    #172655 quote
    phoentzs
    Participant
    Master

    Oh sorry, my mistake.

    #172659 quote
    Magifina
    Participant
    Master

    Hello phoentzs,

    Great strategy with potential of improvment^^.

    You must be careful with spread that has a high impact on performance. Your strategy is running at night and spread can be higher.
    Otherwise you have included a trailing stop but it doesn’t improve the performance and you can curve fit results.

    #172663 quote
    phoentzs
    Participant
    Master

    In the strategy, the spread is: 1, since the spread is 0.9 at night and 0.6 during the day, the maximum risk is for positions over the weekend. In the backtest, however, weekend positions do not have a bad effect. The trailing stop is actually only an emergency solution for large movements. The strategy without a TP also works almost as well.

    #172664 quote
    deletedaccount100622
    Participant
    New

    Hi

    I’ve recommended it to viewers of my site, at the moment I have tried a couple of things, will attach the code for you to review

    It seems hard to balance the increasing P/L with drawdowns, it feels like there’s another filter needed

    I tried making it a day trading system but that didn’t work so maybe as an overnight scalping system?

    https://robofuturestrader.com/kiss-eur-usd-system-on-prorealcode-to-pick-up/

    phoentzs thanked this post
    #172666 quote
    phoentzs
    Participant
    Master

    Thank you for your interest. I’ll look at the code later. I tried a lot as a filter … EMA tandem, EMA triple, momentum … a rising / falling EMA had the best results. I still have a version with an EMA angle, similar to Vectorial DAX … but this version is only slightly better. I think the “secret” lies in this: you only take / get what the market gives you. The more trades you filter out, the bigger the drawdown will be later. Tonight I’ll have a look at your code.

    #172679 quote
    Eric
    Participant
    Master

    Maybe change time filter to 22 instead of 23?

    Long time since i traded forex but i remember the spread could be wide sometimes in the evening, dont remember exactly when but around 22-23?

    #172680 quote
    phoentzs
    Participant
    Master

    Yes that’s right. From 23: 00-01: 00 the spread is around 5 … that’s why I took a break during this time.

    #172681 quote
    Eric
    Participant
    Master

    Yes 2300 seems to the line in the sand

    This another shop but i guess IG also do this?

    https://www1.oanda.com/forex-trading/markets/recent

Viewing 15 posts - 1 through 15 (of 80 total)
  • You must be logged in to reply to this topic.

RSI-EMA EurUsd M15


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
phoentzs @phoentzs Participant
Summary

This topic contains 79 replies,
has 14 voices, and was last updated by fifi743
2 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/17/2021
Status: Active
Attachments: 24 files
Logo Logo
Loading...