2 registered members (degenerate_762, TedMar),
519
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Ticker symbols with '.' or other characters
#482889
04/13/21 13:48
04/13/21 13:48
|
Joined: Apr 2021
Posts: 14
VizTra
OP
Newbie
|
OP
Newbie
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]
#482891
04/13/21 13:54
04/13/21 13:54
|
Joined: Apr 2021
Posts: 14
VizTra
OP
Newbie
|
OP
Newbie
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]
#482894
04/13/21 16:32
04/13/21 16:32
|
Joined: Apr 2021
Posts: 14
VizTra
OP
Newbie
|
OP
Newbie
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]
#482897
04/13/21 17:20
04/13/21 17:20
|
Joined: Feb 2017
Posts: 1,718 Chicago
AndrewAMD
Serious User
|
Serious User
Joined: Feb 2017
Posts: 1,718
Chicago
|
Emphasis mine: 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.
|
|
|
|