Click here to Login





                                                   Please help with downloader

  0

0
Chaim6
2014-12-04 00:00:11


The following code in a downloader Pre-Script does not seem to add a new row of 'Content'. Any idea why?

string[] t = {"Working Capital Currency", "JPY", "JPY", "JPY", "JPY", "JPY", "JPY", "JPY", "JPY", "JPY", "JPY", "JPY"};
Content.AddRow(t);
// The following returns the last pre-existing row.
Global.Trace(String.Join(", ", Content.Rows[Content.Rows.Length - 1].Data));

Thanks.



QuantShare
2014-12-04 01:09:05

  0

You must match exactly what is been parsed with the array you add to Content.AddRow.

If in your parser settings, the "Columns" looks like this:
Quotes -> Date
Quotes -> Close
Quotes -> Volume

Then you should add for example

Content.AddRow("2014-10-10", "12.5", "100");



Chaim6
2014-12-04 12:47:18

  0

I am working on an improved Morningstar downloader. This code was part of a pre-parsing that was done. Let me explain:

Morningstar has the data organized with dates at the top as row headings, not column headings like QS likes. Therefore one of the jobs of the downloader is to transpose the rows and columns. One way to do this is by setting the IsIgnoreLine flag to true for the pre-existing rows and adding the new transposed lines with Content.AddRow(). This is how it was done in the original Morningstar downloader and it makes sense.

The code that I wrote in the prior post was for before the transposition. My plan was to add a few rows of data before the Content was transposed and copy it in a later step. This way was easier.

Is it true that after adding a row using Content.AddRow() the code cannot access it? In other words the content object will still appear to be the same to the pre-script code?

Thanks.



QuantShare
2014-12-05 02:46:47

  0

Yes, that is true. If you want to make further updates to the data later, you can use the "Post-script" (which will contain all parsed data including those added with AddRow)


Chaim6
2014-12-05 09:48:48

  0

Thanks. I hope to have this thing finished by the end of next week. There are a number of improvements in this downloader to make the backtests much more accurate. I hope to upload it when done.

Question: What's the best way to deal with dividends and splits? Backtesting fundamentals with adjusted price data and comparing it to unadjusted fundamentals doesn't work.

Option 1:
Switch to using unadjusted price data. The downside is that backtests need to have dividends explicitly added. In simulations this can be done with the AMM. But when testing ranking systems I think that the buckets will reflect the prices as is without adjusting for dividends. Is this correct?

Option 2:
Continue using unadjusted price data but create a function to unadjust it for fundamental comparison purposes. Is this possible? This method would mean that I will not have to change all my downloaders to get unadjusted prices and I will not have to add AMM.

Thanks.



QuantShare
2014-12-06 01:38:54

  0

You are going to compare fundamental data with values and other metrics, you are not going to compare it with stock prices.
Not sure I understand what you mean here by "unadjusted fundamentals".



Chaim6
2014-12-06 21:39:44

  0

My plan is to calculate Earnings/Price ratios, price/book, price/sales etc. and backtest systems using them in a way that is similar to Portfolio123.com but on int'l stocks.

Example:
EarningsYield = GetData("mstar", "eps ttm") / close;
This QS code should be getting the EarningsYield ratio which is the inverse of the PE ratio (because some companies have negative PE).
For a live system this should work as long as the downloaders get price and fundamental data. But for a backtest there will be an issue if there were dividends or stock splits. Dividends make the stock appear cheaper in the past than it really was. Stock splits do the same. How do we adjust for this, option 1 or option 2?



QuantShare
2014-12-08 01:41:48

  0

Best Answer
In this case, you must use unadjusted close price. You can use these unadjusted prices only for fundamental calculation.

Adjusted & Unadjusted stock prices






Adjusted & Unadjusted stock prices (by QuantShare, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads Notes Report an item

Chaim6
2014-12-08 17:20:18

  0

Thank you, that should work!


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
Long Term Up Trend with Short term re-entery Signals
Tiingo IEX Intraday Downloader
Historical Stock Market Data with Split-Dividend Adjustment Ratio
Metatrader Historical Data Downloader
Quandl.com Universal Downloader

How-to Lessons
How to automatically start a downloader every few minutes?
How to debug a downloader
How to associate an index with a list of stocks
How to screen for stocks having a high correlation with the Dow J...
How to use QuantShare with Metastock data

Related Forum Threads
Help With Daily Data Import Script
Problem with the "Individual stocks put and call volume" download...
Need help with a MM Script
Help with Quantshare Language
Help with Survivorship Bias Free DB

Blog Posts
How to deal with StockTwits data
Working with the formula editor
How to Optimize a Trading System with Thousands of Billions of Co...
Industry Analysis - How to Compare Stocks with their Industries
Trading Forex with the commitments of traders report









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.