Click here to Login

Trading Software Trading objects Features How-to Blog Search


                                                   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...
High to low stock pattern for the close price
Low Priced Stocks After Jump UP
% bars in last N trading days where stock close price increased

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 download earnings calendar data for various stocks

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 use the intraday downloader

Blog Posts
How to create the advance/decline market breadth indicator
Step by step on how to get free realtime/delayed data for stocks,...
How to download the history of dividend payments for stocks in th...
Buy the best/top rated stocks or how to create powerful rank base...
How to turn any ordinary trading strategy into a very profitable ...









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 © 2012 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items