Im still trying to get everything done to an EA right now i am trying to make each pair have its own magic number. I know this will only work if there is only 1 order open for that pair but i dont code and this is what i think would work for now. Can someone please tell me if it would work.
//+----------------------------------------------------------------------------+
//| Get Magic Number For Pair |
//+----------------------------------------------------------------------------+
int GetMagicNumber() {
// What number to use for what pair
if (Symbol()=="EURUSD") return(001);
if (Symbol()=="GBPUSD") return(002);
if (Symbol()=="AUDUSD") return(003);
if (Symbol()=="NZDUSD") return(004);
if (Symbol()=="USDCHF") return(005);
if (Symbol()=="USDJPY") return(006);
if (Symbol()=="USDCAD") return(007);
if (Symbol()=="XAUUSD") return(008);
if (Symbol()=="XAGUSD") return(009);
return;
}
I added it to the code and it compiled with no errors, so i know its wrote right i guess but i dont know how to check to see besides letting the EA make a trade then checking the comments when it closes. But i dont even think then it shows the magic number.
Thanks
Dredding82
//+----------------------------------------------------------------------------+
//| Get Magic Number For Pair |
//+----------------------------------------------------------------------------+
int GetMagicNumber() {
// What number to use for what pair
if (Symbol()=="EURUSD") return(001);
if (Symbol()=="GBPUSD") return(002);
if (Symbol()=="AUDUSD") return(003);
if (Symbol()=="NZDUSD") return(004);
if (Symbol()=="USDCHF") return(005);
if (Symbol()=="USDJPY") return(006);
if (Symbol()=="USDCAD") return(007);
if (Symbol()=="XAUUSD") return(008);
if (Symbol()=="XAGUSD") return(009);
return;
}
I added it to the code and it compiled with no errors, so i know its wrote right i guess but i dont know how to check to see besides letting the EA make a trade then checking the comments when it closes. But i dont even think then it shows the magic number.
Thanks
Dredding82