Dynamic Breakout EURUSD by George Pruitt

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #50250 quote
    Despair
    Blocked
    Master

    I stumbled over an article about a channel breakout system that varies the length of the channel depending on volatility.

    Here is the article:

    https://www.quantconnect.com/tutorials/dynamic-breakout-ii-strategy/

    I thought it was an interesting idea and programmed it. It produces quite good backtest for EURUSD on daily bars.

    There are not many trades but maybe this can be developed in a useful strategy. Varying the deviation of the bollinger bands would be definitely worth trying (i did not try that). I just took the rules from the articles and gave it a run – no optimization at all.

    I almost forgot, I made 1 change. The article uses the standard deviation of the lookback as measure for volatility. I had this first and this worked but then i tried ATR instead as measure of volatility and results improved. The code to use standard deviation instead of ATR is there still as comment.

    defparam cumulateorders=false
    
    once lookback=20
    once positionsize=1
    
    atr=AverageTrueRange[lookback](close)
    
    tradingtime=(currentdayofweek>=1 and currentdayofweek<=5)
    
    If tradingtime then
      todayvol=atr //STD[lookback](close)
      ydayvol=atr[1] //STD[lookback](close[1])
      deltavol=(todayvol-ydayvol)/todayvol
      lookback=round(lookback*(1+deltavol))
      lookback=MIN(60,lookback)
      lookback=MAX(20,lookback)
     MA=Average[lookback](close)
     BoUp=BollingerUp[lookback](close)
     BoDown=BollingerDown[lookback](close)
     LC1=close[1]>BoUp
     LC2=close>highest[lookback](high[1])
     SC1=close[1]<BoDown
     SC2=close<lowest[lookback](low[1])
     if LC1 and LC2 then
       buy positionsize contract at market
     elsif SC1 and SC2 then
       sellshort positionsize contract at market
     endif
     if longonmarket and (close < MA ) then
       sell at market
     elsif shortonmarket and (close > MA ) then
       exitshort at market
     endif
    endif
    
    Berra, victormork and Nicolas thanked this post
    Bildschirmfoto-2017-10-22-um-20.43.02.png Bildschirmfoto-2017-10-22-um-20.43.02.png DynBreak-EURUSD-Daily-V1.1.itf
    #50815 quote
    Nicolas
    Keymaster
    Master

    Thank you Despair for sharing this code with us. Could be a nice addition to the library too, just for learning purpose and maybe helping others ideas come to us. Should work with other forex pairs with some WFO for validation?

    Apparently, the good trade (big breakout) are greatly helping the equity curve to climb up! False signals came from ranging market and it can still long times like months/years 🙁

    #50829 quote
    Despair
    Blocked
    Master

    Definitely. This is nothing you want to trade as is. But I thought the idea is interesting and maybe somebody wants to proceed to work with it. I did not put much work/time in it.

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

Dynamic Breakout EURUSD by George Pruitt


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Despair @despair Blocked
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 10/22/2017
Status: Active
Attachments: 2 files
Logo Logo
Loading...