Click here to Login





                                                   How to close downloader programaticaly after run

  0

0
chaz
2011-11-13 18:14:51


Hi QS team,
I want to run downloader few times a day.
the script for the task manager starts it O.K.
However, when downloader finishes download it stays open & next run is blocked.
App.Main.Quit() is not available to be used in downloader prescript.

Is there any other function that can be used in downloader to close/exit it once it completes the run?

Let me know,

Thx,
Chaz



QuantShare
2011-11-14 05:32:25

  0

What do you mean by "next run is blocked" ?


chaz
2011-11-14 07:32:01

  0


Here is my script that is used to start downloader by QS Task mgr.

var SleepInterval : int = 60000; //in milisec
var NoOfScans : int = 5; // to cover 9.30 -16.00 = 390min
for (var i : int = 1; i < NoOfScans; i++ )
{
Downloader.StartDownloader("fDaily");
App.Main.Sleep(SleepInterval);
}

First loop goes fine, but Download Manager window is popped up, opens "fDaily" status window and waits for user to close.

after 1min sleep FOR loop is attemptingg to run "fDaily" again but notification pops out:
" You have to check at lease one raw"
and wailts for manual input in Downloader Manager "fDaily" status window.

If I do not check one item or close the previous run status window it will not execute subsequent runs.




to select the



QuantShare
2011-11-14 09:42:16

  0

Best Answer
Try the following line:

Downloader.DownloadData("", "fDaily", true, null, null);

instead of "Downloader.StartDownloader"



chaz
2011-11-14 19:27:58

  0

I tried it. I was working but still opening Downloader Mgr & prompting for input.
When I changed 3rd parameter to 'false' - Downloader.DownloadData("", "fDaily", false, null, null);
and restared QS main it is working fine & not prompting for input.

Many thanks,
Chaz



QuantShare
2011-11-15 02:29:37

  0

If you set the 3rd parameter to 'true' then the dialog box (downloading data...) will not be displayed.


chaz
2011-11-15 14:26:49

  0

Yes, after the restart of the QS main it works quitely when using:
Downloader.DownloadData("", "fDaily", false, null, null);
It solved my previous problems.

Many thanks again,

Chaz



Obuli Govindaraju
2011-11-30 11:43:48

  0

Downloader.DownloadData("", "Daily Stock Quotes", true, null, null);

When I run the above on the 2.5.3 I get an error popup that says

Script:<script name>
Value cannot be null
Parameter name: collection



chaz
2011-11-30 18:18:23

  0

Obuli,
I had the same problem in 2.5.2 .
It looks that that call works in some situations (ie when I wasn't making http calls & was using symbol list from external file it was O.K.).

I wanted to run it in the background from a scheduled script.
Hence, to overcome it in the script written using JScript I created a String[] array containing list of symbols to download and pass it to the call
ex.:
var slist1 : String[] = [
"A","ADBE","APA","APC","AXP","ATVI","AKAM","AMGN","ALXN","APOL","BIDU","BBBY","BIIB","BRCM","BTU","BA","BGZ","BGU","BMC","CAT","CELG","CHKP","CHK","CMCSA","COST","CPL","CTRP","CTSH","CTXS","CVX"]


Downloader.DownloadData("","downloader_name", true, slist, null);

That I run as ascheduled task & it works quitely in the background once scheduler of Task Manager 'kicks" it in.

Regards,
Chaz






QuantShare
2011-12-01 10:13:25

  0

To run this downloader for all symbols:

Symbol[] symbols1 = Symbols.GetSymbols();
string[] symbols = new string[symbols1.Length];
for(int i=0;i < symbols1.Length;i++)
{
symbols[i] = symbols1[i].Name;
}
Downloader.DownloadData("", "Daily Stock Quotes", true, symbols, null);



No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
How far are the close prices from the support line
Market Rule based on the Crossover Between Stock Close prices and...
Historical EOD data Downloader for Delisted/Bankrupt Stocks
Quandl.com Universal Downloader
Survivorship bias-free S&P 500 database downloader

How-to Lessons
How to debug a downloader
How to run QuantShare offline
How to run a screen or a watchlist from a script
How to automatically start a downloader every few minutes?
How to automate the data downloading process

Related Forum Threads
How do I find the close price for an entry matching a custom DB
How do I refer to the close price of another symbol in a formula?
How can I rename a downloader
How to Create News Downloader from Google for Indian Stocks.
How to force simulator to close open positions when data ends?

Blog Posts
How to Run QuantShare without UAC Prompts?
Sentiment Analysis: How to measure the sentiment score of your st...
Step by step on how to get free realtime/delayed data for stocks,...
Let me Show You How to Create Hundreds of Profitable Trading Syst...
How to Optimize a Trading System with Thousands of Billions of Co...









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 © 2024 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.