|
Joshua Laferriere
2020-03-15 12:11:16
|
|
I'm not sure if this is under the category of "creating a downloader"
I've had this software for over a year and I'm slowly learning it. I just realized how to add symbols to the left hand pane.
Anyways... I'm trying to automate everything, so rather than manually use quantshare's import symbols from file.
I would like to somehow initiate this symbol importer via startup script loading this mutual funds symbol list from ftp (or at least a way to initiate it from a file I parse from this ftp) as the list is updated daily, then update Quantshare's symbol list (i.e. delist), then download historical data for those symbols
ftp://ftp.nasdaqtrader.com/SymbolDirectory/mfundslist.txt
Pointing me in the right direction is more than fine. Forgive me for my newbness
|
|
|
|
QuantShare
2020-03-18 11:03:03
1
|
|
Hi Joshua,
In order to automate this. Download the file, add symbols, remove old ones, you would need to create a custom script in C# using "Tools -> Script Editor"
Here is an example of such script: (This one will add symbols)
string data = App.Net.DownloadString("ftp://ftp.nasdaqtrader.com/SymbolDirectory/mfundslist.txt");
string[] lines = data.Split('\ n'); // Remove extra space between \ and n
for(int i=1;i < lines.Length;i++)
{
string symbol = lines[i].Split('|')[0];
Symbols.AddSymbol(symbol);
}
|
|
|
|
Joshua Laferriere
2020-03-18 14:40:14
0
|
|
I slightly modified the code to crop the last 2 lines from the file in the for loop. I tested (//) by writing to the left hand output pane. It never completes adding symbols, but it will print them just fine.
string data = App.Net.DownloadString("ftp://ftp.nasdaqtrader.com/SymbolDirectory/mfundslist.txt");
string[] lines = data.Split('
'); // Remove extra space between \ and n
//skip last two lines
for(int i=1;i < (lines.Length-2);i++)
{
string symbol = lines[i].Split('|')[0];
Symbols.AddSymbol(symbol);
//Global.Trace1(symbol+"
");
}
|
|
|
|
Joshua Laferriere
2020-03-19 11:58:35
0
|
|
Best Answer
I've been letting that script run for about 4 hours now and it's not working.
|
|
|
|
QuantShare
2020-03-25 15:31:57
0
|
|
Since you used Global.Trace, what do you see in the trace (View -> Output)? Do you see the symbol names there?
Maybe the script completed. You will see the button switch from "Cancel" to "Execute".
|
|
|
|
Joshua Laferriere
2020-03-25 16:15:09
0
|
|
If I uncomment Global.Trace and takeout Symbols.AddSymbol , it will output to the window in about 5 to 30 seconds (I forget tbh, but if I comment Global.Trace1 out and leave in Symbols.AddSymbol, it never finishes executing.
|
|
|
|
QuantShare
2020-03-31 15:20:19
0
|
|
We just run the script again and we can see new symbols added to the database (Symbols list).
When using:
Global.Trace1(symbol);
It should output all the symbols that are being added to the database. You can see there the progress.
|
|
|
|