|
Salvatore Gaziano
2017-11-23 05:17:32
|
|
Hi,
is there an option to create or modify Watchlist thorugh Script Editor?
Thank you
|
|
|
|
QuantShare
2017-11-24 05:01:31
1
|
|
Best Answer
Hi,
It is only possible to open (Watchlist.Open) and get watchlist results (Watchlist.GetSymbols) from the script editor.
|
|
|
|
Salvatore Gaziano
2017-11-24 05:55:06
0
|
|
Hi, thank for your reply. Do you'll plan to insert set methods for Watchlist in the next version of Quantshare?
I think that it is helpful to make or modify dynamically the watchlist sets.
|
|
|
|
QuantShare
2017-11-25 02:36:53
0
|
|
We do not think we will implement this because you can already create formulas and screen for symbols directly using the Script editor without the watchlist or the screener tool.
|
|
|
|
SystemTrade
2017-11-27 12:51:17
1
|
|
Hi Enrico,
I don't know why you need watchlist modification but I had a similar need when I thought about portfolio optimization. My question was whether I can increase the fitness of a given portfolio by eliminating one or more symbols from a given portfolio and I wanted to have an automated solution.
Here is my approach:
1. My watchlist contains all the symbols of my portfolio and will not/cannot change during the whole process.
2. This (initial) list of symbols gets copied into a global variable (or flat text file). This will represent the modified list of symbols.
3. I will have a custom function then to check whether a certain symbol still is in my list, let me call it IsInList(parameter1), it will just check if the parameter1 is included in my modified list of symbols and then returns 1 or if not, returns 0.
4. My buy statement will look like buy = [my buy rules] & IsInList(name()); this will allow only symbols from the modified list to get bought.
5. By means of another custom function ModifyList(parameter1), I will update the list of symbols through the strategy and/or AMM.
Please be aware that you should not operate this in multithreading mode nor should you use AI.
I hope this is of some help for you, please let me know if you need further details.
|
|
|
|
Salvatore Gaziano
2017-11-28 03:24:32
0
|
|
Hi SystemTra.de,
thank you for this solution!
My problem is a bit complicated: i've a web app that i use to manage my customer and their portfolio. I can access at this data thorugh REST web services, then my intention is to create watchlists through Script Editor and set the symbols from the result returned by my web service.
The benefit is that i've a watchlist updated that i can use in the Screener to monitor my open positions (and i don't update manually the watchlist every time that i sell/buy a position).
|
|
|
|
QuantShare
2017-11-28 06:44:48
1
|
|
Here is what you can do.
1/ Create a watchlist then set the symbols filter to "Symbol Info -> Name3 = ST1" (example)
2/ Get your list of symbols from the REST service, update the Name3 field of each symbol to ST1
3/ Open or refresh watchlist using "Watchlist.Open"
|
|
|
|