ATR Crossover EUR/USD 5min

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #39630 quote
    imokdesign
    Participant
    Senior

    Hi, I want to share my first simple EUR/USD (mini) 5 min Strategy, based on the ATR and two Moving Averages. As you can see it reacts to the recurring ATR pattern, when the EU Session starts, some Volume and Volatility came into the Market. It Trades Long, when the ATR Crosses above 0,0003 and the moving averages are positiv. It Trades Short, when the ATR Crosses above 0,0003 and the moving averages are negativ. I test it with a 1,5 Spread.

    I also test the Strategie with the following parameters:

    ATR (14)

    Stop 40
    Profit 40

    It is slightly worse than the current parameters, but it has not such a Drawdown at the end. Unfortunately I can not make a longer backtest. If someone has the possibility, I would be very happy, also if someone had good ideas to optimize it. 🙂

    // Festlegen der Code-Parameter
    DEFPARAM CumulateOrders = False // Kumulieren von Positionen deaktiviert
    // Das Handelssystem wird um 0:00 Uhr alle pending Orders stornieren und alle Positionen schließen. Es werden vor der "FLATBEFORE"-Zeit keine neuen Orderaufträge zugelassen.
    DEFPARAM FLATBEFORE = 080000
    // Stornieren aller pending Orders und Schließen aller Positionen zur "FLATAFTER"-Zeit
    DEFPARAM FLATAFTER = 210000
    
    // Verhindert das Platzieren von neuen Ordern zum Markteintritt oder Vergrößern von Positionen vor einer bestimmten Uhrzeit
    noEntryBeforeTime = 080000
    timeEnterBefore = time >= noEntryBeforeTime
    
    // Verhindert das Platzieren von neuen Ordern zum Markteintritt oder Vergrößern von Positionen nach einer bestimmten Uhrzeit
    noEntryAfterTime = 153000
    timeEnterAfter = time < noEntryAfterTime
    
    // Verhindert das Trading an bestimmten Wochentagen
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    // Bedingungen zum Einstieg in Long-Positionen
    indicator1 = AverageTrueRange[5](close)
    c1 = (indicator1 CROSSES OVER 0.0003)
    indicator2 = Average[10](close)
    indicator3 = Average[20](close)
    c2 = (indicator2 > indicator3)
    
    IF (c1 AND c2) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Bedingungen zum Einstieg in Short-Positionen
    indicator4 = AverageTrueRange[5](close)
    c3 = (indicator4 CROSSES OVER 0.0003)
    indicator5 = Average[10](close)
    indicator6 = Average[20](close)
    c4 = (indicator5 < indicator6)
    
    IF (c3 AND c4) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
    // Stops und Targets
    SET STOP pLOSS 36
    SET TARGET pPROFIT 54
    imokdesign-atr-crossover-eurusd-min-1498927837p84cl1.png imokdesign-atr-crossover-eurusd-min-1498927837p84cl1.png
    #39634 quote
    Nicolas
    Keymaster
    Master

    Hi @imokdesign, great idea and nice post. I moved your strategy to the forum instead, to discuss about it. I made longer backtest and even if the result is not so bad, I should it should desserve a deeper analysis to make it even better! 🙂

    Did you try to make dynamic stoploss and takeprofit instead of fixed ones in points?

    #39727 quote
    imokdesign
    Participant
    Senior

    Thanks for the qick reply. Yes, it would be nice if it will be discussed. 🙂 During the construction, I also tried just a ptrailingstop. But it didn’t work well. What do you mean exactly with “dynamic” Stop or Profit? Stop by an other indikator, ATR, or Trendstop at point3, etc. ? … or more then one Profittarget?  Maybe I have to look at it a little bit closer again, it looks that it close its actual position when the next signal comes (screenshot). Maby I could change something at this point, or maby it needs a just a simple 200 sma.

    Bildschirmfoto-2017-07-03-um-22.38.30.png Bildschirmfoto-2017-07-03-um-22.38.30.png
    #39729 quote
    imokdesign
    Participant
    Senior

    … oh I am sorry: that was the wrong screenshot here is the correct one:

    Bildschirmfoto-2017-07-03-um-22.52.05.png Bildschirmfoto-2017-07-03-um-22.52.05.png
    #39763 quote
    Nicolas
    Keymaster
    Master

    Stop by an other indikator, ATR, or Trendstop at point3, etc. ?

    Exactly, a 54 points profit target doesn’t mean the same thing in a quiet market than in a strong directional one. By increasing the target/profit, you could also increase the risk reward ratio and afford to reduce the win/loss one.

    #39923 quote
    imokdesign
    Participant
    Senior

    I think my knowledge for an coding an ATR Stop is not enough at the moment. I looked at some Threads, and find some snippets from this post.

    Open Range Breakout ATR(14)

    But i dont know it is the right way, maby i need some help, or just a small note.

    // Festlegen der Code-Parameter
    DEFPARAM CumulateOrders = False // Kumulieren von Positionen deaktiviert
    // Das Handelssystem wird um 0:00 Uhr alle pending Orders stornieren und alle Positionen schließen. Es werden vor der "FLATBEFORE"-Zeit keine neuen Orderaufträge zugelassen.
    DEFPARAM FLATBEFORE = 080000
    // Stornieren aller pending Orders und Schließen aller Positionen zur "FLATAFTER"-Zeit
    DEFPARAM FLATAFTER = 210000
    
    // Verhindert das Platzieren von neuen Ordern zum Markteintritt oder Vergrößern von Positionen vor einer bestimmten Uhrzeit
    noEntryBeforeTime = 080000
    timeEnterBefore = time >= noEntryBeforeTime
    
    // Verhindert das Platzieren von neuen Ordern zum Markteintritt oder Vergrößern von Positionen nach einer bestimmten Uhrzeit
    noEntryAfterTime = 153000
    timeEnterAfter = time < noEntryAfterTime
    
    // Verhindert das Trading an bestimmten Wochentagen
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    price = close
    atr = averagetruerange[5]*2
    triggerB = price+atr
    triggerS = price-atr
    
    // Bedingungen zum Einstieg in Long-Positionen
    indicator1 = AverageTrueRange[5](close)
    c1 = (indicator1 CROSSES OVER 0.0003)
    indicator2 = Average[10](close)
    indicator3 = Average[20](close)
    c2 = (indicator2 > indicator3)
    
    IF (c1 AND c2) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
    BUY 1 share at triggerB stop
    ENDIF
    
    // Bedingungen zum Einstieg in Short-Positionen
    indicator4 = AverageTrueRange[14](close)
    c3 = (indicator4 CROSSES OVER 0.0003)
    indicator5 = Average[10](close)
    indicator6 = Average[20](close)
    c4 = (indicator5 < indicator6)
    
    IF (c3 AND c4) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
    SELLSHORT 1 share at triggerS stop
    ENDIF
    
    // Stops und Targets
    SET STOP pLOSS atr
    SET TARGET pPROFIT 15
    
    MK_ATR-STOP-TEST.png MK_ATR-STOP-TEST.png
    #39932 quote
    Nicolas
    Keymaster
    Master

    You should replace your stoploss keyword:

    SET STOP LOSS atr

    pLOSS is for points (15 pips), while LOSS is for real price value (0.0015 pips for EURUSD) and this is the case of your “atr” variable.

    #41273 quote
    imokdesign
    Participant
    Senior

    Thanks for the note, I had it totally overlooked. Last Weeks, I have now tried to improve the Strategy and stoptechniques, but In no attempt I have come to a better result. There is a thing, I do not quite understand yet. If I make certain stop atr settings, it looks as if it is Trade less. Why that? The strategy is the same, i just change the stop loss?

    #43020 quote
    imokdesign
    Participant
    Senior

    I have been watching this strategy for several Weeks. Sometimes (Rare) it happens that the strategy turns itself off, without the regularly Date update has expired. Does anyone know why that is, or is it due to the new LRAccount and Proorder requirements? I can not find a Codeline that speaks for it.

    Would it be possible to program an email message when this case arrives?

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

ATR Crossover EUR/USD 5min


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
imokdesign @imokdesign Participant
Summary

This topic contains 8 replies,
has 2 voices, and was last updated by imokdesign
8 years, 7 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/03/2017
Status: Active
Attachments: 4 files
Logo Logo
Loading...