Topic: Bug EA

Hi Mr. Popov
I found a bug that occurs in the trailing stop when you export as expert: assuming that I open a long position, it happens that with a candle down the trailing stop going down, this should not happen.
I realized this by opening two exact position, using a FSB bridge and exporting it as an expert, the first behaved properly, in the second I verified this bug.

Re: Bug EA

I'll check it immediately.

Thank you.

Re: Bug EA

But this does not always happen, I do not know why, it happened to me with EURAUD 1M.
Goodbye.

Re: Bug EA

I cannot confirm that. I opened 4 experts and it works properly:

http://s28.postimg.org/xm572mxll/screenshot_798.jpg

Can you send me log files or screenshots?

Is it happened on adding / reducing of  the position?

Re: Bug EA

Now I do I play and I will send

Re: Bug EA

559778: EA
559779: FSB Bridge

Post's attachments

Cattura.JPG 128.41 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Bug EA

559779 remains stationary, 559778 goes down

Re: Bug EA

Do you have different magic numbers for the expert and the bridge?

Can you make a screenshot of the "Experts" tab?

Re: Bug EA

Yes, of course, the magic numbers are different

Post's attachments

Cattura.JPG 94.33 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Bug EA

I'm 99% sure that the issue is due to a bug in MetaTrader. From what I see it must happen only when a user trade with an expert and with a bridge on same market.

When an expert (every expert) works with orders, it first executes the OrderSelect(...) command. It sets some internal state of MT and marks an order as selected. Later an expert executes different commands on that order.

If a user trades with several experts, MT executes the commands synchronously - one expert first, after that another, and so on.... However, when a user trades with an expert and with our bridge, it also tries to do that synchronously, but FSB Pro Trader works in another process and that breaks the synchronous execution.

As a result, the expert can select order from the bridge and vice versa.

I'll dig deeper to the issue, but that is a cumbersome process. 50% of the code of FSB Pro and the expert is to fight against MT bugs and brokers pitfalls.

I really cannot imagine how a trader can download a 500 lines of code expert from the MT codebase and will trade for a profit.

11 (edited by Morningbull 2015-03-02 18:46:50)

Re: Bug EA

I think I understand in part what you want to say, but it seems you're saying that an expert along with the bridge creates a conflict.
As for the 500 lines of code, mine was just a test to test the trailing stop with an expert, are not as least experienced as you think

Re: Bug EA

I'm not able to reproduce this issue again.

I added the expert magic number to the Trailing Stop log records because it's possible to have other reason for the problem. Tracing the exact magic number of the requests will help to debug the problem.

I'll continue testing this issue. If it happens again, I'll try to find a workaround.