Download MetaTrader 5

If I trade manually, what magic number does MT4 use?

To add comments, please log in or register
Chi
125
Chi  

EA can use a magic number to distinguish its own trades from others. What if I manually open a trade, which magic number does MT4 platform use?

The reason I'm asking is, I'd like to hide my EA generated trades from brokers, so they cannot tell if it's a manual trade or automated trade.

I know I have to leave trade comment to be blank. How about magic number?

Thanks.

Jon
173
Jon  

The magic number is 0 by default. I haven't tested it but I'm guessing manual trading will also be 0 by default. You can easily test by placing an order manually then get your EA to list the magic numbers of opened trades in your init() function. I'm betting it will be 0 when you attach it to the chart.

Having any magic number won't hide your EA generated trades by any means though. Imagine that a broker did something malicious with a magic number just because it's megadroid's magic number for example.. it will affect countless non-megadroid users. The reality of it all is that if brokers partnered up with mt4 to get your EA's code.. there is nothing you can do against it. If I were you, I'd stop worrying about something you can't control and will never have any means of proving even if you suspect it.

Jon

Chi
125
Chi  
Archael wrote >>

The magic number is 0 by default. I haven't tested it but I'm guessing manual trading will also be 0 by default. You can easily test by placing an order manually then get your EA to list the magic numbers of opened trades in your init() function. I'm betting it will be 0 when you attach it to the chart.

Having any magic number won't hide your EA generated trades by any means though. Imagine that a broker did something malicious with a magic number just because it's megadroid's magic number for example.. it will affect countless non-megadroid users. The reality of it all is that if brokers partnered up with mt4 to get your EA's code.. there is nothing you can do against it. If I were you, I'd stop worrying about something you can't control and will never have any means of proving even if you suspect it.

Jon

Thanks.

If my EA open trades with magic number set to 0 and without any trade comment, wouldn't my broker have no idea if it is a manual trade or automated trade? Therefore, they cannot play particular tricks against EA.

Ray
2649
Ray  

Dealers have the option to permit/deny your use of Automated Trading. So, there must be a difference in what is sent to the server by your client in manual and scripted trades.

Chi
125
Chi  
phy wrote >>

Dealers have the option to permit/deny your use of Automated Trading. So, there must be a difference in what is sent to the server by your client in manual and scripted trades.

So what's the difference, do you know? I can only think of magic number and trade comment.

cloudbreaker
1577
cloudbreaker  
Chi:

So what's the difference, do you know? I can only think of magic number and trade comment.

It will be a field within the MT4 client server protocol which is not exposed via the MQL functions or the MT4 client user interface.

Unlike the magic number field which is exposed to the MQL interface only and the comment field which is exposed to both the MQL and client user interfaces.


CB

Chi
125
Chi  
cloudbreaker wrote >>

It will be a field within the MT4 client server protocol which is not exposed via the MQL functions or the MT4 client user interface.

Unlike the magic number field which is exposed to the MQL interface only and the comment field which is exposed to both the MQL and client user interfaces.

CB

Hi CloudBreaker,

If I read it correctly, you meant there is nothing my EA can do to hide itself?

Ray
2649
Ray  
Chi wrote >>

So what's the difference, do you know? I can only think of magic number and trade comment.

We don't know what is sent beween the server and the client because all the data is encrypted.

Anyone have a way to get around that?

cloudbreaker
1577
cloudbreaker  
Chi:

Hi CloudBreaker,

If I read it correctly, you meant there is nothing my EA can do to hide itself?

If your question is "Can I make my EA look to the broker as if its a manual trader?" then I believe that the answer is no.


CB

Chi
125
Chi  

I chatted online with one broker who welcomes Forex robots - www.fxcbs.com.

Interesting enough, operator said they can still tell if it is an automated trade or manual trade even an EA uses blank trade comment and zero magic number. That is their claim.

I think it's unfair treatment. Does anyone know MQL4 developers? I want to suggest them making EA completely anonymous.

cloudbreaker
1577
cloudbreaker  

Why are you surprised?

This is what we told you.

And why are you getting yourself so hot under the collar about it?

Relax.

Build your EA.


CB

123
To add comments, please log in or register