need coding help please - page 3

 
unclebigpete:

Ran it just now on audnzd from 17/05 to 22/05, and it opened 3 trades, 2 buys that were stopped out, and one sell that was closed at the end of the test.

Here's the Journal info, top line first.

2012.05.22 21:38:51 QQE-4hr_15min- testing-2205: loaded successfully


2012.05.22 21:39:17 2012.05.21 23:59 c_QQEA AUDNZD,M15: removed

You ran it for less than one minute and you expect to see any errors in that time ? so with those 3 trades you can tell that your code is working as it should ?

OK, now do the same on a live chart but watch the Experts tab this time . . .

 
unclebigpete:
deVries, if you stopped your rant long enough to explain WHY the code I started with is so 'bad' I might understand what I can do to fix it. Read your response again, and then explain how your answer could help anyone.

Thank you, RaptorUK, finally an answer I can use.

To help explain, I only want this EA to run one one pair, one trade at a time. As I said earlier '... and placed one on each of 5 different pair charts, all on the same MT4 platform...' giving 5 separate (?) charts with that EA on them. At this stage I don't want or need to check Magic Numbers, do I ?

Re the comment on bars, thank you.

Re the slippage, 4/5 brokers etc, at this stage that doesn't matter, does it ? I'm using this for myself, on the same broker etc.


When do you gonna become a little bit more sensible....

I wrote in the first message here why your Expert Advisor Builder is a bad program for making your EA's. Now after RaptorUk and onewithzachy came also with examples why your program build with this EA Builder is bad coded. (Errors often handled here in this forum inside your program) your still defending it that it doesn't matter because the program written you do only want to use to run on one pair, one trade at a time.

... and placed one on each of 5 different pair charts, all on the same MT4 platform...' giving 5 separate (?) charts with that EA on them. At this stage I don't want or need to check Magic Numbers, do I ?

That this mean that for all those Symbols the EA is on you can't trade anything else doesn't matter you

So if this EA Builder was for sell would you sell it to others with the garantee that it is safe to make EA's with it trading forex ??

Telling all you know now this EA does ???

Do I have to spend my time today with all I can find in your program to explain and tell you why that EA Builder yours is crap....

For me a short look at the programlines was enough to get my opinion.

It is my opinion about that program and if you still think that I'm wrong with having that opinion then it is also my opinion that you're very foolish....

 
RaptorUK:

You ran it for less than one minute and you expect to see any errors in that time ? so with those 3 trades you can tell that your code is working as it should ?

OK, now do the same on a live chart but watch the Experts tab this time . . .

Ouch, think unclebigpete gonna frustrated again. think I said that unclebigpete have to wait for so long coz it's on 4 hrs chart :(

.... The problem is that it doesn't work when placed on several live charts. Because it uses a 4-hr test, it's a long time to see if my corrections fix it, and I'm getting frustrated.

And I said again, which part of it that you've tweaked ? Now you asked ask us to find the err and fix it.

Yay !

 
RaptorUK:

You ran it for less than one minute and you expect to see any errors in that time ? so with those 3 trades you can tell that your code is working as it should ?

OK, now do the same on a live chart but watch the Experts tab this time . . .


1 minute is how long the tester took to run it - it was on a 4hr chart, from May 17th to May 22
 
unclebigpete:

1 minute is how long the tester took to run it - it was on a 4hr chart, from May 17th to May 22

5 days 4hour chart 30 candels.... What a test
 
unclebigpete:

1 minute is how long the tester took to run it - it was on a 4hr chart, from May 17th to May 22

Yes I know . . . but 3 trades that take less than a minute is hardly any testing at all . . . why not run it again for 12 months of data while you are waiting for the Demo stuff to find a trade . . .

I suspect that you have an ECN Broker . . . if you do you will need to add a OrderModify after your OrderSends . . . plenty to read here: ECN

 
RaptorUK:

OK, now do the same on a live chart but watch the Experts tab this time . . .


I have had this EA 'running' on a live chart for several days - here are the (latest) entries in the EXPERTS tab. Obviously something is incorrectly coded, and the program resets again, but by then it has missed the 4hr bar where a signal may have been.

2012.05.22 19:00:31 TCCI AUDNZD,M15: initialized
2012.05.22 19:00:31 c_QQEA AUDNZD,M15: initialized
2012.05.22 19:00:31 c_QQEA AUDNZD,M15: initialized
2012.05.22 19:00:31 QQE-4hr_15min-audnzd-2205 AUDNZD,M15: initialized
2012.05.22 19:00:32 c_QQEA AUDNZD,H4: loaded successfully
2012.05.22 19:00:32 c_QQEA AUDNZD,H4: initialized
2012.05.22 19:00:32 c_QQEA AUDNZD,M15: loaded successfully
2012.05.22 19:00:32 c_QQEA AUDNZD,M15: initialized
2012.05.22 21:07:54 QQE-4hr_15min-audnzd-2205 AUDNZD,M15: deinitialized
2012.05.22 21:07:54 QQE-4hr_15min-audnzd-2205 AUDNZD,M15: uninit reason 3
2012.05.22 21:07:54 c_QQEA AUDNZD,M15: uninit reason 1
2012.05.22 21:07:54 c_QQEA AUDNZD,M15: removed
2012.05.22 21:07:54 c_QQEA AUDNZD,H4: uninit reason 1
2012.05.22 21:07:54 c_QQEA AUDNZD,H4: removed
2012.05.22 21:07:54 TCCI AUDNZD,M15: uninit reason 3
2012.05.22 21:07:54 c_QQEA AUDNZD,M15: uninit reason 3
2012.05.22 21:07:54 TCCI AUDNZD,H4: initialized
2012.05.22 21:07:54 c_QQEA AUDNZD,H4: initialized
2012.05.22 21:07:54 c_QQEA AUDNZD,H4: initialized
2012.05.22 21:07:54 QQE-4hr_15min-audnzd-2205 AUDNZD,H4: initialized
2012.05.22 21:08:00 c_QQEA AUDNZD,H4: loaded successfully
2012.05.22 21:08:00 c_QQEA AUDNZD,H4: initialized
2012.05.22 21:08:00 c_QQEA AUDNZD,M15: loaded successfully
2012.05.22 21:08:00 c_QQEA AUDNZD,M15: initialized
2012.05.22 21:08:02 QQE-4hr_15min-audnzd-2205 AUDNZD,H4: deinitialized
2012.05.22 21:08:02 QQE-4hr_15min-audnzd-2205 AUDNZD,H4: uninit reason 3
2012.05.22 21:08:02 c_QQEA AUDNZD,M15: uninit reason 1
2012.05.22 21:08:02 c_QQEA AUDNZD,M15: removed
2012.05.22 21:08:02 c_QQEA AUDNZD,H4: uninit reason 1
2012.05.22 21:08:02 c_QQEA AUDNZD,H4: removed
2012.05.22 21:08:02 TCCI AUDNZD,H4: uninit reason 3
2012.05.22 21:08:02 c_QQEA AUDNZD,H4: uninit reason 3
2012.05.22 21:08:02 c_QQEA AUDNZD,H4: uninit reason 3
2012.05.22 21:08:02 TCCI AUDNZD,M15: initialized
2012.05.22 21:08:02 c_QQEA AUDNZD,M15: initialized
2012.05.22 21:08:02 c_QQEA AUDNZD,M15: initialized
2012.05.22 21:08:02 QQE-4hr_15min-audnzd-2205 AUDNZD,M15: initialized
2012.05.22 21:08:03 c_QQEA AUDNZD,H4: loaded successfully

2012.05.22 21:08:03 c_QQEA AUDNZD,H4: initialized

- now obviously I need to incorporate the changes suggested by contributors above, and find out what reason 1 and reason 3 mean. Thanks again to all those who've helped.


 

Here's another to lol at uncleEABuilder, the SL for Buy should be calculated base on Bid not Ask and vice versa for SELL. I know that coz the other day I wrote this MQL5 code for phenix and asked to Rosh why he calculated TP and SL that way. He (on page 2) quickly pointed that it was my code. LOL (click here).

I have suspicious on variables 'EachTickMode' and 'TickCheck', but I have no idea how this works, so how could I explain my suspicious ?

Uninitialize Reason() code 3 : Symbol or timeframe change on chart. MetaEditor > Navigator window (Ctrl +D) > dictionary tab > Standard Constants > UninitializeReason().

 
unclebigpete:

I have had this EA 'running' on a live chart for several days - here are the (latest) entries in the EXPERTS tab. Obviously something is incorrectly coded, and the program resets again, but by then it has missed the 4hr bar where a signal may have been.

Did you allow live trading ? do you have a smiley face in the top right hand corner of your chart ?

you need to click the Expert Advisors button so that here is a green >

 

One more thing unclebigpete, you probably don't have enough data for backtesting. So what you should do is, click Tools > Option (or just press Ctrl + O) > Charts tab. In Max Bars in History, change the value to 9999999999999 (just type and hold 9). MT4 will later changed this value to 2147483647 which mean unlimited. Close the Option window and restart your MT. Other forumers may correct me here so you just keep checking :)

Reason: