Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,135 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Broker-specific symbols #440516
04/27/14 12:04
04/27/14 12:04
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline OP
Senior Member
boatman  Offline OP
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
Hi everyone

Just wanted to share an experience about broker-specific asset symbols while setting up a simulated broker account.

My broker (Think Forex) uses a suffix for its currency instruments based on the type of account you have with them. For my account, the suffix 'pro' is added. So the EUR/USD instrument becomes EURUSDpro.

In order to use the correct price history, I altered Zorro's EA to capture the correct asset names as suggested in the manual:

string assetFix(string Asset)
{

if(Asset == "AUD/USD") return("AUDUSDpro");
if(Asset == "EUR/USD") return("EURUSDpro");

etc

Unlike the currencies, the broker's indices match the indices used in the strategy. However, when I try to trade the strategy, Zorro doesn't seem to recognise the indices. I added the indices to the list of assets in the EA's code, even though they matched:

if(Asset == "NAS100") return("NAS100");
if(Asset == "SPX500") return("SPX500");

...and then the strategy worked fine.

Anyone else find something similar? Am I missing something here?

Either way, this might be a workaround if anyone else finds a similar problem.

Re: Broker-specific symbols [Re: boatman] #440635
04/29/14 07:55
04/29/14 07:55
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline OP
Senior Member
boatman  Offline OP
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
Now I've run into some problems with Zorro's EA recognising the metals. This is my asset list, copied directly from the Zorro EA:

/ convert a real asset name (f.i. "EURUSD") to a MT4 specific name (f.i. "EURUSDi")
string assetFix(string Asset)
{
// replace asset names directly (example)
// if(Asset == "XAGUSD") return("SILVER"); // "XAG/USD" in strategy => "SILVER" in MT4
// if(Asset == "XAUUSD") return("GOLD");
if(Asset == "AUD/USD") return("AUDUSDpro");
if(Asset == "EUR/USD") return("EURUSDpro");
if(Asset == "GBP/USD") return("GBPUSDpro");
if(Asset == "USD/CAD") return("USDCADpro");
if(Asset == "USD/CHF") return("USDCHFpro");
if(Asset == "USD/JPY") return("USDJPYpro");
if(Asset == "EUR/CHF") return("EURCHFpro");
if(Asset == "NAS100") return("NAS100");
if(Asset == "SPX500") return("SPX500");
if(Asset == "US30") return("US30");
if(Asset == "GER30") return("GER30");
if(Asset == "XAU/USD") return("XAUUSD");
if(Asset == "XAG/USD") return("XAGUSD");

// no direct replacement -> detect and 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);
}

All of the currency and index assets are recognised, but silver (XAG/USD) returns error #053 (XAG/USD unavailable!).

Any idea what could be causing this?

Thanks in advance.

Re: Broker-specific symbols [Re: boatman] #440640
04/29/14 09:59
04/29/14 09:59
Joined: Jul 2013
Posts: 522
D
dusktrader Offline
User
dusktrader  Offline
User
D

Joined: Jul 2013
Posts: 522
Slashes are different, in my experience. I believe Zorro does expect XAU/USD the same way your platform is presenting it.

Therefore, try taking out that line altogether and see if it works.

Last edited by dusktrader; 04/29/14 10:04.
Re: Broker-specific symbols [Re: dusktrader] #440661
04/29/14 16:16
04/29/14 16:16
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Assets have no slashes in the MT4 script, so give the original names without the slash in the assetFix function.

The suffix "pro" however is normally added automatically, so you don't need the function for this.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1