magic number

Sezione dedicata a metatrader (ed altre piattaforme) ed al suo linguaggio di programmazione per il trading automatico
giogio81
Messaggi: 6
Iscritto il: 01/12/2016, 21:50

magic number

Messaggio da giogio81 » 17/04/2018, 21:34

hi guys ... I found an ea in mql4 and I would like to know if possible how to insert the magic number to make it manage with another expert? which code can I insert in the metaeditor? thank you so much

Avatar utente
Dainesi
Messaggi: 353
Iscritto il: 12/05/2014, 12:10
Località: Castellanza (VA)

Re: magic number

Messaggio da Dainesi » 21/04/2018, 18:27

Usually every EA inserts a magic number in his orders, if it does not and you have a code (mq4 file), it is possible to add a few lines of code that does this for you.
First of all find out where is the command OrderSend, thus put a MagicNumber value into the his place (see Knowledge base for additional info).

giogio81
Messaggi: 6
Iscritto il: 01/12/2016, 21:50

Re: magic number

Messaggio da giogio81 » 09/06/2018, 11:40

Thanks Dainesi ... I try to post it here to share it with you and if you can insert the magic number would be great.

from what I understand, has an internal magic number for the recognition of the various changes
Non hai i permessi necessari per visualizzare i file allegati in questo messaggio.

Avatar utente
Dainesi
Messaggi: 353
Iscritto il: 12/05/2014, 12:10
Località: Castellanza (VA)

Re: magic number

Messaggio da Dainesi » 10/06/2018, 15:18

The code just now manages the MagicNumber, it is the parameter named nMagic.
Every long order will have as magic number nMagic + 1 and every short orders will have nMagic+2.

P.S. Who wrote the code I suppose not very experienced in mql because I found the code very ... elementary

Chi c’è in linea

Visitano il forum: CC [Bot] e 0 ospiti