Click here to Login





How to run a screen or a watchlist from a script

Updated on 2012-04-16 04:53:49

Share |

The script editor has now two additional variables that allow you to start, run and get signals from a screen or watchlist programmatically.

Steps

- Select "Tools" then "Script Editor"
- Select "File -> New" then type the name of your script
- Type the following code then click on "Execute" (menu)

Screener.Open("Basic"); // Open and run a screen

This will open the screener tool and run a screen called "Basic". (Change "Basic" with your screen name).

Another example:

ScreenTask task = Screener.Run("Basic");
while(!task.IsCompleted)
{
App.Main.Sleep(500);
}

for(int i=0; i< task.ScreenResults.Length;i++)
{
string symbol = task.ScreenResults[i].Symbol;
}



The above example allows you to get a list of symbols that meet the screen criteria. The second instruction ("while") is used to wait until the screen work is completed. Once the work is done, we loop thought screen results and extract the symbol name from each result.




You can also get symbols from a watchlist by executing the following code:

string[] symbols = Watchlist.GetSymbols("Basic");

Assuming the watchlist name is "Basic".








2 reviews (Log in)







Other how-to articles




How to get trading orders from a portfolio programmatically





How to create a screen





How to generate buy/sell signals from a trading system





How to speed up watchlist and screener plug-ins when working with intraday data





How to execute a script at regular intervals





How to run QuantShare offline





How to drag & drop a stock to a static watchlist





How to hide a trading indicator from a particular time frame





How to create a watchlist







QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright 2017 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.