Click here to Login

                                                   How to adjust for splits in QS


Dave Walton
2013-07-08 02:58:55

Although it appears that QS recommends using market data that is pre-adjusted for splits, dividends, and corporate actions, I have to disagree about adjusting for dividends. Adjusting for dividends often results in a non-linear distortion of the price series backwards in time and thus one may arrive at wrong conclusions when using technical analysis and trying to identify chart patterns . The two problems are: 1) what you see in backtesting will not match what you would have seen trading at the time, and 2) dividends in the future will change decisions that would have been made in the past and thus invalidates backtesting.

So, I would like to download unadjusted market data and adjust only for splits myself. It is easy to modify the yahoo downloader to get the unadjusted data, but how do I make the adjustment for splits? I already have a custom database with the split information by symbol but can I access that within the downloader or will I need to run a custom script via the script editor?

2013-07-09 06:10:37


You should run a script via the script editor. You can implement your own split logic or you can wait next release so that we implement a "Split" function that takes a split ratio and automatically adjusts your data.

Dave Walton
2013-07-09 06:41:56


Excellent news! Is there an ETA on the next release?

2013-07-09 10:54:13


around 30-40 days (The next update will take longer than usual)

Dave Walton
2013-07-09 11:12:44


OK, thanks. Would you be willing to send me an advance copy of the split function? I would send back beta test feedback.

2013-07-09 19:37:40


QS 3.0 is comming ? :)

2013-07-09 21:46:28


Ok, I will send you an advance copy when it is ready.

Clonex: Yes, QS 3.0 is almost here

2013-10-17 00:58:59


Does the latest version 3.0 have this function which takes a split ratio and automatically adjust the data?

2013-10-17 11:41:42


Yes, in the script editor (Tools -> Script Editor), use the following functions:


Quotes.AdjustForSplit("A", new DateTime(2013, 5, 25), "2:1");

2013-10-17 13:03:35


OK. Thats great. i was wondering if there is something where QS can pick split/dividends, etc date and details from an excel file/custom database and adjust an entire price database historically for all the symbols.

2013-10-17 15:13:44


You can get splits data from a downloader such as Splits Calendar - Historical data for U.S. Stocks.

After that you will have to write a script to read data from the custom database and apply each split.

Splits Calendar - Historical data for U.S. Stocks (by Patrick Fonce, 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

2015-05-10 22:01:33


When I enter this code for split as follows, noting happens though it says "no errors".

Quotes.AdjustForSplit("70000011", new DateTime(2007, 8, 16), "2:1");

Is it that this line alone would not suffice?

2015-05-11 03:27:02


Make sure symbol is correct and that you select the symbol again in the chart (to reload the data)

No more messages


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"


Trading Items
Splits Calendar - Historical data for U.S. Stocks
History of dividend payment for stocks in the US stock market
Announced Stock Splits
Detect and Display Potential Splits on a Chart
Number of Potential Splits per Trading Day

How-to Lessons
How to adjust a stock for splits
How to download earnings calendar data for various stocks
How to display the number of stocks per day for different RSI gro...
How to download EOD quotes for active and valid stocks only
How to get stocks for a particular index using the global script

Related Forum Threads
how to creat support & resistance level for n days?
How do you retrieve the entry and exit price for a position?
How do I find the close price for an entry matching a custom DB
How to download data for selected symbols ?
how to download Intraday data for NSE Nifty - S&P CNX Nifty

Blog Posts
How to get buy and sell orders for a portfolio based on a trading...
How to Scan for Parallel Resistance and Support Lines
How to Download Trading Data for Certain Securities Only
How to download the history of dividend payments for stocks in th...
Step by step on how to get free realtime/delayed data for stocks,...

Create an account
Affiliate Program
Contact Us
Trading Forum
How-to Lessons
About Us
Terms of Use

Copyright 2021
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
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.