Daily breakout system

User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Daily breakout system

Post by SteveHopwood »

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.
You do not have the required permissions to view the files attached to this post.
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

Daily breakout system

Post by milanese »

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
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
Stefan61200

Daily breakout system

Post by Stefan61200 »

Hi Tommaso,

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

Cheers
Stefan
You do not have the required permissions to view the files attached to this post.
trader689
Trader
Posts: 644
Joined: Thu Nov 17, 2011 12:53 am

Daily breakout system

Post by trader689 »

hey any test updates for this? initial results looked very promising
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Daily breakout system

Post by SteveHopwood »

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:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
fxolive
Posts: 1
Joined: Sat Jun 14, 2014 3:29 pm

Daily breakout system

Post by fxolive »

Steve, Also can you please add the Auto MM. Thanks!
Radar
Trader
Posts: 437
Joined: Fri Mar 23, 2012 5:39 pm
Location: Round the bend ;)

New-Bar Test

Post by Radar »

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^)
Check out my new, (well, old now), manual trade & automatic scale-in manager,
StackManV2
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

New-Bar Test

Post by SteveHopwood »

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:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

Daily breakout system

Post by milanese »

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

Cheers :)

Tommaso
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
Radar
Trader
Posts: 437
Joined: Fri Mar 23, 2012 5:39 pm
Location: Round the bend ;)

New-Bar Test

Post by Radar »

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^)
Check out my new, (well, old now), manual trade & automatic scale-in manager,
StackManV2
Locked

Return to “Automated trading systems”