Click here to Login





                                                   How do you lag fundamental data?

  0

0
Chaim6
2014-01-27 09:09:39


I am new to QS and was wondering how you go about lagging fundamental data so that it approximates when it was actually released?
I have tried the http://www.quantshare.com/item-1181-morningstar-historical-fundamentals downloader but it does not lag the dates are not lagged.
Am I missing something? Is there a way to artificially lag the dates by 45 days to 2 months when backtesting or should the adjustment take place by the downloader?

Thanks





Morningstar Historical Fundamentals (by Stefan Kroscen, 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

QuantShare
2014-01-27 13:09:29

  0

The adjustment should take place in QS language.

If the fundamental data is stored in variable "a" then simply type:

a = ref(a, 45); // To lag it by 45 bars





Chaim6
2014-01-27 18:14:32

  0

Sorry for my newbie question, but do you put "a = ref(a, 45);" into a download script or into the backtesting script?

Thanks



QuantShare
2014-01-27 21:53:20

  0

Best Answer
In the backtesting script.
Example to get the close price lagged by 10 bars:

a = ref(close, 10);




Chaim6
2014-01-28 03:15:07

  0

Thank you!


Seeker
2014-01-28 08:45:25

  0

Is a=ref(close,10) and a= close[10] same? Are they always identical in usage? I have seen that in certain cases, the latter is not accepted.




QuantShare
2014-01-28 11:27:13

  0

Yes it is the same. You can use [] only with variables (not with functions).


Seeker
2014-01-28 12:54:35

  0

just to clarify further, for new high we say:
a = high>ref(hhv(high,10),1);

or:
a = hhv(high,20);
b = high>a[1];

but not:
a =high>hhv(high,20)[1];

Just trying to confirm whether I was following it correctly all this while...



QuantShare
2014-01-28 13:46:18

  0

Yes, you can plot these variables on a chart to get a confirmation or to check whether something is correct or not.
New high can also be detected by:
a = high == hhv(high, 10);



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
Fundamental Valuation Ratios for US Stocks
Stock Grade - Fundamental Analysis
Extensive Fundamental Data for U.S. Stocks
Financial fundamental data for US companies
ASX Fundamental data

How-to Lessons
How to get fundamental data for U.S. Stocks
How to generate buy/sell signals from a trading system
How to download new quotes when selecting a chart
How to create a log scale chart
How to plot the number of stock tweets per day

Related Forum Threads
I do not get it, how do you get the data?
How do you retrieve the entry and exit price for a position?
how do you check if the price data is up to date?
how do you restore it to default settings
How do you go to cash in a simulation?

Blog Posts
Fundamental analysis: How to track economic indicators in the For...
Let me Show You How to Create Hundreds of Profitable Trading Syst...
How to Download and Use Fundamental Data
How to Quickly Create Fundamental Scans
How to Detect Potential Issues/Errors in Your Historical Data?









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.