Hi Eugene,
Is there a possibility to change the Symbol name and store it with the symbol with the Wealthscript ?
Size:
Color:
Hi,
The
Data Tool should help you. Choose "Change symbol" from its right click menu.
Size:
Color:
Thanks again. But in the Data Tool, the change is only for the symbol code. I would like to change the symbol name.
Is there a way to do it ?
Size:
Color:
I must have missed the gist of your question Alexandre. In theory it should be possible to do if you assign a custom string to the Bars.SecurityName property, save the resulting Bars object to a disk file with Bars.SaveToFile and then overwrite the original .WL file with the one you produced. With some providers your change to the SecurityName property may persist until you refresh the data. Others will most likely replace it with the original string - and some may even do it on a daily update.
P.S. Those that don't support the BarDataStore (like ASCII, MetaStock, Database, MetaTrader etc.) are not considered: they might have own means to change the symbol name.
Size:
Color:
Thanks a lot. I will try it. Can you give me how I can find the current directory on the symbol processed to be able to overwrite it in the wealthscript ?
Size:
Color:
Why do you think this is required?
Size:
Color:
Right :-). Thanks again !
Size:
Color:
CODE:
Please log in to see this code.
I mean, certainly it's possible to find the currently processed symbol's directory in WealthScript. All it takes some Reflection usage to determine the current data provider. Code above is incomplete but examples can be found on the forum. I just don't understand why you're looking to overwrite it in WealthScript?
Size:
Color:
I need this because my data provider doesn't have the security name in standard.
Thanks for your help.
PS : I tested SaveToFile. It doesn't save by default in the current data directory. You need to force the path.
Size:
Color:
Perhaps an easier solution could be to have a plain text file with symbol and security name pairs and look it up in your script.
Anyway, here's a quick solution for you that finds processed symbol's file name and path:
CODE:
Please log in to see this code.
It uses undocumented features so you're on your own with it.
Size:
Color:
Great ! More simple for me like this. Thanks again for your help.
Size:
Color:
Don't mention it.
Size:
Color: