Asset Names and Z strategies

Posted By: Thirstywolf

Asset Names and Z strategies - 04/14/14 16:26

Quick question. When our broker uses their own names for certain assets, how do we get Zorro to recognise them, when using the Z strategies? As we can't amend the script, is there another way?

Thanks.

Thirstywolf
Posted By: DdlV

Re: Asset Names and Z strategies - 04/14/14 19:57

Hi Thirstywolf. I assume you're using MT4? See this manual page: http://zorro-trader.com/manual/en/mt4plugin.htm.

HTH.
Posted By: Thirstywolf

Re: Asset Names and Z strategies - 04/15/14 03:33

Thanks Ddlv.

I guess the problem I have is that I find these instructions a bit vague.

"For this edit the assetFix function in the Zorro.mq4 EA and add the names to the list for converting them to the special asset names of your broker's MT4 version."

How do we edit the assetFix function in the Zorro.mq4?

Thanks

Thirstywolf
Posted By: Thirstywolf

Re: Asset Names and Z strategies - 04/15/14 10:43

OK. I have figured it out. My issue was that I could not find the Zorro.mq4 file. My bad. I must have searched for the wrong file name, as I could not find it previously.

Might I suggest that the manual remarks be updated to reflect "For this edit the assetFix function in the Zorro.mq4 EA located in the source folder" or something to this effect, just to cater for some slower members of the team such as myself.

Thanks for your help Ddlv.

THirstywolf
Posted By: Thirstywolf

Re: Asset Names and Z strategies - 04/16/14 01:41

OK. So I have amended the zorro.mq4 file, but zorro seems to be ignoring it. Code as follows:

string assetFix(string Asset)
{
if(Asset == "XAGUSD") return(".SILVER");
if(Asset == "XAUUSD") return(".GOLD");
if(Asset == "GER30") return("DE30");
if(Asset == "NAS100") return("US500");
if(Asset == "SPX500") return("USTEC");
if(Asset == "USOil") return("WTI");
// replace asset name directly (example)
// if(Asset =="XAGUSD") return("SILVER");
// if(Asset == "XAUUSD") return("GOLD");

// no direct replacement -> add suffix automatically
string s = Symbol();
if(StringLen(s) > 6 && StringLen(Asset) <= 6) {
s = StringSubstr(s,6,StringLen(s)-6);
Asset = StringConcatenate(Asset,s);
static bool once = true;
if(once) {
Print("Adding ",s," to asset names");
once = false;
}
}
return(Asset);
}

Even with this file saved in the source folder, Zorro cannot find these symbols. Any suggestions?
Posted By: Thirstywolf

Re: Asset Names and Z strategies - 04/16/14 03:34

Does the Zorro.mq4 file need to be put into a different folder or something? I can't see that any of the changes that I make in this file affect the way Zorro runs.
Posted By: jcl

Re: Asset Names and Z strategies - 04/16/14 08:05

Zorro.mq4 is a MT4 expert advisor. It must be in the MT4 "Experts" folder as described in the manual.
Posted By: Thirstywolf

Re: Asset Names and Z strategies - 04/16/14 09:39

Hi JCL. Thanks for the advice. Only issue is that I am using MT4 version 600, which I just realised is why I do not have Zorro.mq4 in the experts folder, as I have .ex4 instead. Is .ex4 an editable file?

Thanks

Thirstywolf
Posted By: jcl

Re: Asset Names and Z strategies - 04/16/14 10:07

No, .ex4 is the compiled version. V600 can not run the Zorro.mq4 from earlier Zorros. Download the new Zorro 1.22 from the "Starting" forum - it contains a different MT4 bridge for V600.
Posted By: swingtraderkk

Re: Asset Names and Z strategies - 04/16/14 12:16

also beware your error in assets:

if(Asset == "NAS100") return("US500"); should be USTEC

if(Asset == "SPX500") return("USTEC"); should be US500
© 2024 lite-C Forums