stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Daily breakout system
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3662
Page 1 of 3
Author:  SteveHopwood [ Tue Jun 03, 2014 3:00 am ]
Post subject:  Daily breakout system

OK guys, here is V1 of the slightly revamped ea. I will post further updates here.

There was more recoding to do than I originally envisaged, and I am fairly sure that there are some faults - the ea appears to be doing a lot of sl mods in backtesting.

I have added a new input, TradeExpiryHours. Unfilled pending trades will delete themselves after this number of hours have expired.

Not sure the OCO thingy is working, but if not then that is the fault of the original coder and I will sort it out if there really is a problem.

Have a play with this on Monday and see what happens. Those of you with Sunday candles will probably see strange thingies, as I have not seen a check for this and did not think about it. I have run out of steam tonight, and will sort out details like these next week.

:xm:

Revision history:
  • V 1.01: Spidexx added Matt's liborderreliable stuff and the pips to points conversion. Thanks Spi.
  • V 1.02:
    • added SendTradesNow input. This tells the ea to send the pendings immediately and not wait for a new candle to form. Disabled by default.
    • added code to ignore the Saturday and Sunday candles when calculating the pending prices, and to look only at the Friday candle.
Author:  milanese [ Tue Jun 03, 2014 9:22 pm ]
Post subject:  Daily breakout system

Stefan61200 » Tue Jun 03, 2014 9:06 pm wrote:Hhmmm...

I am not able to upload the results. Do I have to use a specific format? I used a html document.

Thanks
Stefan
you can use *pdf, *doc ecc, but not html

Cheers :)

Tommaso
Author:  Stefan61200 [ Tue Jun 03, 2014 9:38 pm ]
Post subject:  Daily breakout system

Hi Tommaso,

thanks for your help. I guess I found a way.

Cheers
Stefan
Author:  trader689 [ Sat Jun 14, 2014 1:25 am ]
Post subject:  Daily breakout system

hey any test updates for this? initial results looked very promising
Author:  SteveHopwood [ Sat Jun 14, 2014 9:31 am ]
Post subject:  Daily breakout system

This is a simple daily breakout strategy, intended to catch a big move if this happens.

The EA looks at the previous D1 candle then:
  • takes a reading from the Volumes indicator. I think this is merely a device to ensure the ea trades only at the open of the new D1 candle because:
    • if Volume < 5
      • send a grid of 4 pending buy trades trades starting at the High of the previous candle if the market is below this, or Ask + RangePoint pips if the market has already crossed yesterday's high. Pendings are set to expire 1 minute before the close of the D1 candle.
        • Take profit and stop loss for the four trades are set at TP1/SL1 for the first trade, then TP2/SL2 for the second trade and so on.
      • repeat the process in reverse for sell stop trades.
  • This leaves a grid of 8 pending trades.
    • DelOpposite: if enabled, this tells the ea to delete the opposite pending trade at each level. For example, the level buy pendings fill, so the opposite direction pending sells are deleted.
    • Further trade management is by:
      • MoveToBEP: move SL to breakeven at TP1 - applies to trades 2, 3 and 4 as the market moves in our direction, as trade 1 has already closed at TP1.
        TrailingStop: the ea trails the sl by this value if it is > 0
The coding is a masterpiece of simplicity. I am going to change the code so that it sets the pendings at the start of a new D1 candle rather than using Volumes, and add a chart feedback display with the usual information. Apart from that, there is nothing to do. Your list of trades is impressive, so I will add a link to my wrup to bring some attention here.

Thanks for posting this, Stefan. :clap:

:xm:
Author:  fxolive [ Sat Jun 14, 2014 4:32 pm ]
Post subject:  Daily breakout system

Steve, Also can you please add the Auto MM. Thanks!
Author:  Radar [ Sat Jun 14, 2014 6:02 pm ]
Post subject:  New-Bar Test

Hey Steve,
SteveHopwood » Sat Jun 14, 2014 7:01 pm wrote:
I am going to change the code so that it sets the pendings at the start of a new D1 candle rather than using Volumes
Whilst working with Khalaad on his TrendTrading EA, I found that using Volume as a new-bar test is better than the usual OldBars method.

Khalaad had originally coded the EA to work on new bars, using...

Code: Select all

int start()
{
    if(Volume[0]>1)return;
    code
    code
    more code
}
...but I didn't realize what it was doing, so replaced it with the OldBars method. When he was testing the modified TT on demo, he found that it had opened 3 trades in one day (not a good thing, considering that it's a daily strategy).

On further investigation, we found that his demo had disconnected twice that day, and on re-connection, it had re-initialized the EA, which reset OldBars (presumably to 0), which allowed the EA to cycle through and enter the extra trades.

We went back to using Volume for the new-bar test, and no longer have extra trades on re-initialization of the EA.

Hope you find this tidbit useful.

Have fun!

Radar =8^)
Author:  SteveHopwood [ Sat Jun 14, 2014 6:51 pm ]
Post subject:  New-Bar Test

Radar » Sat Jun 14, 2014 6:02 pm wrote:Hey Steve,
SteveHopwood » Sat Jun 14, 2014 7:01 pm wrote:
I am going to change the code so that it sets the pendings at the start of a new D1 candle rather than using Volumes
Whilst working with Khalaad on his TrendTrading EA, I found that using Volume as a new-bar test is better than the usual OldBars method.

Khalaad had originally coded the EA to work on new bars, using...

Code: Select all

int start()
{
    if(Volume[0]>1)return;
    code
    code
    more code
}
...but I didn't realize what it was doing, so replaced it with the OldBars method. When he was testing the modified TT on demo, he found that it had opened 3 trades in one day (not a good thing, considering that it's a daily strategy).

On further investigation, we found that his demo had disconnected twice that day, and on re-connection, it had re-initialized the EA, which reset OldBars (presumably to 0), which allowed the EA to cycle through and enter the extra trades.

We went back to using Volume for the new-bar test, and no longer have extra trades on re-initialization of the EA.

Hope you find this tidbit useful.

Have fun!

Radar =8^)
Thanks Radar. All you have to do is set OoldBars in init() so the ea cannot trade until the open of a new bar. This saves a call to an indi on every tick - helps lesson the burden on the cpu when running an ea on umpteen charts.

:xm:
Author:  milanese [ Sat Jun 14, 2014 8:10 pm ]
Post subject:  Daily breakout system

You will find Steve's modified version in the second post of this thread http://www.stevehopwoodforex.com/phpBB3 ... 477#p94477

Cheers :)

Tommaso
Author:  Radar [ Sun Jun 15, 2014 1:06 am ]
Post subject:  New-Bar Test

Hey Steve,
SteveHopwood » Sun Jun 15, 2014 4:21 am wrote: Thanks Radar. All you have to do is set OoldBars in init() so the ea cannot trade until the open of a new bar. This saves a call to an indi on every tick - helps lesson the burden on the cpu when running an ea on umpteen charts.

:xm:
Thanks for that :)

To paraphrase a line from Abbott & Costello movies...

Slooowly I learn! Step by step! Step by step...

Take care,

&

Have fun!

Radar =8^)
All times are UTC Page 1 of 3