Ticker symbols with '.' or other characters

Posted By: VizTra

Ticker symbols with '.' or other characters - 04/13/21 13:48

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,
Posted By: AndrewAMD

Re: Ticker symbols with '.' or other characters - 04/13/21 13:50

Use the Symbol column in your Asset List. This frees you from file name constraints.
Posted By: VizTra

Re: Ticker symbols with '.' or other characters - 04/13/21 13:54

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?
Posted By: AndrewAMD

Re: Ticker symbols with '.' or other characters - 04/13/21 14:27

Eliminate the dot from the asset column.
Posted By: VizTra

Re: Ticker symbols with '.' or other characters - 04/13/21 16:32

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.
Posted By: AndrewAMD

Re: Ticker symbols with '.' or other characters - 04/13/21 16:42

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)
Posted By: VizTra

Re: Ticker symbols with '.' or other characters - 04/13/21 16:51

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?
Posted By: AndrewAMD

Re: Ticker symbols with '.' or other characters - 04/13/21 17:20

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.
Posted By: VizTra

Re: Ticker symbols with '.' or other characters - 04/13/21 17:38

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.)
© 2024 lite-C Forums