"Awesome" auto-trading robot

Post Reply
altec
Posts: 3
Joined: Fri Nov 18, 2011 2:12 am

"Awesome" auto-trading robot

Post by altec »

Hi everyone

Attached is an EA that was originally written by Steve which I have been trying to learn from and add some extras.

The EA is based on a breakout box and then uses a trading strategy called 'awesome' to trade the breakout and place a pending trade the alternate side of the breakout box. The box strategy was designed on a consolidation strategy outlined by 'ForexHard' over at FF. I'm not sure where the 'Awesome' trading method is derived from.

I have been playing around with this EA and noted it had promising gains over some weeks of forward trading (on demo account). I added Hanover to it following Steve's instructions on the basis that improving the odds of getting the trade direction right on the first breakout makes sense.

Also have it operating so it only trades on the second close of a bar outside of the breakout box (+ buffer). This is based on the strategy outlined by ForexHard and appears to operate ok.

Issues:

- The EA draws breakout boxes and trades happily to existing rules on my demo account but on my live account it does nothing. I have not seen this behavior before. Clearly I have done something wrong.

- I would like it to only trade a maximum of twice per breakout box (or any given number) but can't make this bit work.

- I would like to test two trades per breakout (one with a smallish target and one with a larger target) but kept getting a 'trade context busy' error when trying this. Tried to work around this but I failed.

I'm not sure if any of the experts on this forum have any time to take a look at this? I very much appreciate the generosity of time people give to to this forum. I am kind of hesitant to ask but I have got as far as I can on this without further help. Also my thanks to the originators of the strategy and Steve for writing the original EA (sorry Steve if I've mucked up any of the original code).

Cheers

Altec
You do not have the required permissions to view the files attached to this post.
User avatar
DING
Trader
Posts: 103
Joined: Wed Nov 16, 2011 11:53 am

Re: "Awesome" auto-trading robot

Post by DING »

you demo test and real trading on which broker?
you are trading for OOTB ? and on which time frame?
altec
Posts: 3
Joined: Fri Nov 18, 2011 2:12 am

Re: "Awesome" auto-trading robot

Post by altec »

DING wrote:you demo test and real trading on which criminal?
you are trading for OOTB ? and on which time frame?
FX Pro

OOTB

M15

Cheers

Altec
User avatar
gaheitman
Trader
Posts: 655
Joined: Tue Nov 15, 2011 10:55 pm
Location: Richmond, VA, US

Re: "Awesome" auto-trading robot

Post by gaheitman »

altec wrote: Issues:

- The EA draws breakout boxes and trades happily to existing rules on my demo account but on my live account it does nothing. I have not seen this behavior before. Clearly I have done something wrong.
I can't imagine why this would be the case. Is your demo and live accounts with the same broker?
altec wrote:- I would like it to only trade a maximum of twice per breakout box (or any given number) but can't make this bit work.
When you declare a variable as in the following code from your start() procedure:

Code: Select all

  double num_trades;
   
   if (num_trades == MaxBreakoutTradesPerBox) return; // don't take more trades than expected until the next Box forms
it actually creates a local variable of that name and sets the value to zero. So in this code, num_trades will always be zero. A quick scan of your code showed you re-declaring num_trades in most of the procedures. You need to declare it once at the beginning of your EA (outside procedures) so that every procedure will see the same copy of it and it will keep it's value. You also need to remove the declarations within each procedure.
altec wrote: - I would like to test two trades per breakout (one with a smallish target and one with a larger target) but kept getting a 'trade context busy' error when trying this. Tried to work around this but I failed.
When you send trades in succession, you need to make sure the previous trade is completed. In your code, you use

Code: Select all

      if (IsTradeContextBusy() ) Sleep(100);
which is close. You actually want

Code: Select all

      while (IsTradeContextBusy() ) Sleep(100);
altec wrote: I'm not sure if any of the experts on this forum have any time to take a look at this? I very much appreciate the generosity of time people give to to this forum. I am kind of hesitant to ask but I have got as far as I can on this without further help. Also my thanks to the originators of the strategy and Steve for writing the original EA (sorry Steve if I've mucked up any of the original code).

Cheers

Altec
George
altec
Posts: 3
Joined: Fri Nov 18, 2011 2:12 am

Re: "Awesome" auto-trading robot

Post by altec »

George you are a star!

Thanks for your help. I will apply this over Christmas and see where I get to.

Cheers


Mark
Post Reply

Return to “Coders Hangout”