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

Nanningbob 10.2 auto-trading EA
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=552
Page 29 of 54
Author:  SteveHopwood [ Tue May 29, 2012 10:46 am ]
Post subject:  Re: 10.2; the auto-trading EA is born.

phil_trade wrote:Steve

I found an incorrect code that could do some strange things

in modules LookForD1H4TrendTrade and LookForD1TrendTrade, you define double Target in If Buy...so if it's a SELL, MQL found a no declared variable target = xxxx

You always have to declare variables at top of module to avoid this... of course...if you're kind enough :lol:
I am not so sure it matters because the editor would grumble at compile time.

I have made the changes, so V 1y is in post 1. In light of Phil's latest post (just above this one), you might all like to hang on for V 1z.

:D
Author:  grimweasel [ Tue May 29, 2012 12:17 pm ]
Post subject:  Re: 10.2; the auto-trading EA is born.

Hi Gang.

Been testing this EA with Alpari for a few weeks now with mixed results. Understand that we are still in development .

I keep getting loads of errors saying 'trade context is busy' - would you know how to stop these or what it means? It matters not if I have ECN true or false.

Many thanks in anticipation
Author:  phil_trade [ Tue May 29, 2012 12:53 pm ]
Post subject:  Re: 10.2; the auto-trading EA is born.

SteveHopwood wrote:
phil_trade wrote:Steve

I found an incorrect code that could do some strange things

in modules LookForD1H4TrendTrade and LookForD1TrendTrade, you define double Target in If Buy...so if it's a SELL, MQL found a no declared variable target = xxxx

You always have to declare variables at top of module to avoid this... of course...if you're kind enough :lol:
I am not so sure it matters because the editor would grumble at compile time.

I have made the changes, so V 1y is in post 1. In light of Phil's latest post (just above this one), you might all like to hang on for V 1z.

:D
I am not so sure it matters because the editor would grumble at compile time.

Oh no, this compilateur is not cleaver enough ! for him, you declare these variable before but he can"t see if it's in a if condition

It's a good way to code to avoid this

if (1 == 2)
{
double xy = 5;
}
Print(DoubleToStr( xy + 10,0));

Print will always return 10 instead of 15. :mrgreen:
Author:  astral77 [ Tue May 29, 2012 12:58 pm ]
Post subject:  Re: 10.2; the auto-trading EA is born.

Trade context busy is generated by crap Empty4 when your criminal`s server is overloaded and even after the busy time is over it still persists. Often closing and restarting the Empty4 will solve the problem.

Kind regards
Author:  phil_trade [ Tue May 29, 2012 1:36 pm ]
Post subject:  Re: 10.2; the auto-trading EA is born.

astral77 wrote:Trade context busy is generated by crap Empty4 when your criminal`s server is overloaded and even after the busy time is over it still persists. Often closing and restarting the Empty4 will solve the problem.

Kind regards
please do some homework and google this expression...you will see it's not a bug !
Author:  phil_trade [ Tue May 29, 2012 1:41 pm ]
Post subject:  Re: 10.2; the auto-trading EA is born.

phil_trade wrote:Steve

a friend has an Empty4 on Alpari which generates the Open/close bug.

I have add a Print in LookForTradeClosure() to see value

as you can see TP is 0.77782 but take read from line is 80.65200 so for a sell BID < take and LookForTradeClosure() close the trade !

Now we have to find why line is set to 80.652 :mrgreen:

2012.05.29 10:37:11 Nanningbob 10.2 auto-trading EA EURGBP,H4: open #1800554604 sell 0.60 EURGBP at 0.79938 sl: 0.83496 tp: 0.77782 ok
2012.05.29 10:37:13 Nanningbob 10.2 auto-trading EA EURGBP,H4: close #1800554604 sell 0.60 EURGBP at 0.79938 sl: 0.83496 tp: 0.77782 at price 0.79949
2012.05.29 10:37:13 Nanningbob 10.2 auto-trading EA EURGBP,H4: EURGBP Close By LookForTradeClosure() : Bid = 0.79937 take = 80.65200 stop = 0.00000
Steve

I confirm it's not a bug, but Empty4 that's become crasy.
I delete all history and restart a fresh copy of Empty4 and all is normal. I suspect to much history loaded by F2 with old Empty4 version 419. The new one 427 can allocate 3Go memory on 32bits and 4Go on 64bits windows and work fine for me.
Author:  Dumuzi [ Tue May 29, 2012 4:32 pm ]
Post subject:  Re: 10.2; the auto-trading EA is born.

I installed version 1x this morning and it took one trade. Around 15:00 (GMT+3) it started to buy/close USDCAD. Every minute for a period, then a pause followed by a new series buying/closing. And so on.
Installed version 1y, but the problem persists.

I have worked as a professional programmer for 30 years until my brain put up a fuss. If needed I can do some debugging but I need to know where to start looking. Any particular function? I can print any information you want and pass it over to you.
Author:  phil_trade [ Tue May 29, 2012 4:41 pm ]
Post subject:  Re: 10.2; the auto-trading EA is born.

Dumuzi wrote:I installed version 1x this morning and it took one trade. Around 15:00 (GMT+3) it started to buy/close USDCAD. Every minute for a period, then a pause followed by a new series buying/closing. And so on.
Installed version 1y, but the problem persists.

I have worked as a professional programmer for 30 years until my brain put up a fuss. If needed I can do some debugging but I need to know where to start looking. Any particular function? I can print any information you want and pass it over to you.
The problem is not is the code but in your Empty4.

Try to install a fresh Empty4 with version 427.

Which broker ?
Author:  Dumuzi [ Tue May 29, 2012 5:12 pm ]
Post subject:  Re: 10.2; the auto-trading EA is born.

phil_trade wrote: The problem is not is the code but in your Empty4.

Try to install a fresh Empty4 with version 427.

Which criminal ?
I can of course try a fresh installation of build 427. My criminal is FxPro.

At work we regularly blamed the compiler or the platform (Windows). However, 99% of the time we were wrong. Later it was required that I proved the problem to be in the the compiler or the platform. I find this to be sound because the alternative is to become a victim. Pardon me, but I still believe this problem can be fixed in the EA and I really, really hope it can because the alternative is "unbearable".
Author:  juliank [ Tue May 29, 2012 5:15 pm ]
Post subject:  Re: 10.2; the auto-trading EA is born.

phil_trade wrote:
Dumuzi wrote:I installed version 1x this morning and it took one trade. Around 15:00 (GMT+3) it started to buy/close USDCAD. Every minute for a period, then a pause followed by a new series buying/closing. And so on.
Installed version 1y, but the problem persists.

I have worked as a professional programmer for 30 years until my brain put up a fuss. If needed I can do some debugging but I need to know where to start looking. Any particular function? I can print any information you want and pass it over to you.
The problem is not is the code but in your Empty4.

Try to install a fresh Empty4 with version 427.

Which criminal ?
... in my case it was a problem as well even if I installed the latest version of Empty4.... it made troubles only on the pairs where I saw it did not made an update on history (maybe slow internet connection) and the histograms displayed the same height and value for the chart
All times are UTC Page 29 of 54