Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
Deeplearning Script
by wolfi. 02/26/24 12:46
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/22/24 16:22
AssetAdd() vs. modern asset list?
by jcl. 02/21/24 15:01
How many still using A8
by Aku_Aku. 02/20/24 12:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (degenerate_762, TedMar), 519 guests, and 12 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Ticker symbols with '.' or other characters #482889
04/13/21 13:48
04/13/21 13:48
Joined: Apr 2021
Posts: 14
V
VizTra Offline OP
Newbie
VizTra  Offline OP
Newbie
V

Joined: Apr 2021
Posts: 14
Hello,

I'd like to know if there is a workaround for working with tickers that contain special characters. I got a lot of .csv files with equities, futures, market statistics etc. and some of them start with a #, $, % or contain a . or - (Equities, A/B) shares.

I was able to successfully write a script that converts all my .csv files to .t6 files and create an assetlist but now I face the problem that adding assets via asset() does not work for assets containing a . or a # from my testing so far. I got the option to write a small script to replace all these characters, but I wanted to know first if there is another option. (Also because removing these characters could lead to duplicates.)

This is roughly what I do so far:


assetList("C:\\***\\Assets.csv",0);
History = "C:\\***\\*.t6";

string ticker = "BF.B";

asset(ticker);


Doing this with a ticker that is in my asset list and also in the specified history folder leads to the "Error 055: no bars generated".

Other symbols without a dot work flawlessly. I hope somebody got a solution.

Kind regards,

Last edited by VizTra; 04/13/21 13:49.
Re: Ticker symbols with '.' or other characters [Re: VizTra] #482890
04/13/21 13:50
04/13/21 13:50
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Use the Symbol column in your Asset List. This frees you from file name constraints.

Re: Ticker symbols with '.' or other characters [Re: VizTra] #482891
04/13/21 13:54
04/13/21 13:54
Joined: Apr 2021
Posts: 14
V
VizTra Offline OP
Newbie
VizTra  Offline OP
Newbie
V

Joined: Apr 2021
Posts: 14
Hmm, I don't follow exactly. My Asset List already contains both the name and the symbol as "BF.B", ex:

BF.B,50,0.01,0,0,0.01,0.01,0,2,1,0.01,BF.B

I thought the problem would be in the asset() function not accepting something with a dot. How does the symbol column help?

Re: Ticker symbols with '.' or other characters [Re: VizTra] #482892
04/13/21 14:27
04/13/21 14:27
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Eliminate the dot from the asset column.

Re: Ticker symbols with '.' or other characters [Re: VizTra] #482894
04/13/21 16:32
04/13/21 16:32
Joined: Apr 2021
Posts: 14
V
VizTra Offline OP
Newbie
VizTra  Offline OP
Newbie
V

Joined: Apr 2021
Posts: 14
Thank you, but that sadly didn't totally solve my problem.

If I change my assetList to BFB,50,0.01,0,0,0.01,0.01,0,2,1,0.01,BF.B it doesn't change anything and I still get error 055.



So i continued to try some things and realized, that maybe the assetList() isn't really used like it should, since I also specify my history folder?

I tried another entry in my assetList:

BR,50,0.01,0,0,0.01,0.01,0,2,1,0.01,BR

This one of course works. I changed the Name to ABR:

ABR,50,0.01,0,0,0.01,0.01,0,2,1,0.01,BR

There is no other mention of ABR in my assetList (BUT there is an ABR.t6 file in my history folder which I specified).

Now run the script again with asset("ABR"), instead of looking in the assetList for ABR and then looking for the BR.t6 symbol the script is just taking a ABR.t6 file in my history folder (where one exists). Which I can recognize because the prices of ABR and BR are completely different.

So it seems like Zorro is happy about ABR with the Symbol BR being in the assetList, it still takes the ABR.t6 file in the history folder, although from my understanding now it should take the BR.t6 file.

Last edited by VizTra; 04/13/21 16:33.
Re: Ticker symbols with '.' or other characters [Re: VizTra] #482895
04/13/21 16:42
04/13/21 16:42
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
When you change your asset list, close and restart Zorro.

The Symbol column strictly affects how Zorro interacts with your broker - it affects nothing else, including filenames and asset names. That's why you can put a period in the Symbol column and not in the Name column.

For example, if Name is "FOO" and symbol is "FOO.1", it will use "FOO.t6" or "FOO_2021.t6" in [Test] and [Train] mode. But in [Trade] mode, Zorro will speak to your broker in terms of the symbol "FOO.1".

Further reading:
https://manual.zorro-project.com/account.htm
https://zorro-project.com/manual/en/symbol.htm
https://zorro-project.com/manual/en/asset.htm
https://zorro-project.com/manual/en/script.htm (see the History variable)

Re: Ticker symbols with '.' or other characters [Re: VizTra] #482896
04/13/21 16:51
04/13/21 16:51
Joined: Apr 2021
Posts: 14
V
VizTra Offline OP
Newbie
VizTra  Offline OP
Newbie
V

Joined: Apr 2021
Posts: 14
Okay, so the symbol column is actually not able to help me with my problem? I`m not currently connecting to any broker, just backtesting and using data in the form of .csv converted to .t6. So if the symbol column is not responsible for which file is used, is there another way to use asset("BFB") and have Zorro look for the BF.B.t6 file or is that not possible?

Re: Ticker symbols with '.' or other characters [Re: VizTra] #482897
04/13/21 17:20
04/13/21 17:20
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Emphasis mine:
Quote
Name - Name of the asset, f.i. "EUR/USD". Up to 15 characters, case sensitive, with no blanks and no special characters except for slash '/' and underline '_'. This name is used in the script and in the Asset scrollbox; it can be different to the symbol used by the broker. The asset is ignored when the name begins with a hash character "#".
If the t6 filename does not match your asset Name, it is not valid. Thus, it must meet the above criteria.

If your broker requires a dot, it is supported, so you put it in the symbol column. That's the problem being solved.

Re: Ticker symbols with '.' or other characters [Re: VizTra] #482898
04/13/21 17:38
04/13/21 17:38
Joined: Apr 2021
Posts: 14
V
VizTra Offline OP
Newbie
VizTra  Offline OP
Newbie
V

Joined: Apr 2021
Posts: 14
Okay, then I'll write a script to rename all my .csv files. Nonetheless thank you very much for your help, I appreciate it!

(By the way its not a broker, its an EOD data provider called norgatedata, which exports csvs daily.)


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1