Click here to Login




Technical Analysis Using Multiple Timeframes

Updated on 2010-03-09





With historical data, the daily, weekly and monthly are the most used timeframes in technical analysis. A daily chart displays quotes where each bar represents a daily session. In a weekly chart, each bar summarizes the trading data that occurred, for a particular security, during a week. The bar open price is the security open price on Monday and the bar close price is the security close price on Friday.
In a chart and at any moment you can choose the timeframe to work with by clicking on the "bottom-left" button.

technical analysis

You can choose whether to display daily, weekly, monthly, yearly or custom timeframe. Custom timeframe option let you define a number of days to use as a timeframe.
You can also change the chart timeframe by right clicking on a chart and then selecting the "Chart Timeframe" option in the menu.

We will now present some timeframe-related functions in the QuantShare language that allow you to use different timeframes in the same formula. In a daily chart, you can for example calculate the Moving Average Convergence/Divergence, MACD, using a weekly timeframe and compare the result with the MACD of a daily or monthly timeframe.
These functions can be used in charting as well as with other plug-ins like the screener, backtester, neural network... They can be used in technical analysis, fundamental analysis ...

In the indicators list, you can see these functions and their descriptions by selecting the "Time-Frame" category; or you can just type "timeframe" in the "Search" field.

technical analysis

There are 7 time frame functions, but before we dig deeper into these functions, let us first explain the notion of "compressed" time-series.
In a daily time frame, all functions are calculated using daily data. If you have two years worth of data for a particular stock, you will get approximately 500 bars. If you calculate the RSI of that stock, then the RSI will return a time-series with 500 bars. However, the RSI of the same stock and for a different timeframe will return fewer bars. Using a weekly chart, it will return 104 bars (52 weeks in a year multiplied by 2 years). Thus, we call this vector, a compressed time-series, because it has only 104 bars in a chart that displays 500. The missing bars will be filled with a NAN value (Not a Number).
Here is how the weekly RSI looks like:

technical analysis

The Blue line is the weekly RSI. If you click on a bar, you will get the weekly RSI value for that bar and also the bar's date. This date corresponds to the bar's index in the daily chart and it does not correspond to the weekly RSI value.
In the last bar, we have a value of 40.612 and a date of 26-02-2010. In reality, the value 40.612 corresponds to a bar that starts on 22-02-2010.

To draw a daily RSI and a weekly RSI on the same chart, you can use the following formula:
technical analysis

The first line creates the RSI vector, which is a daily vector because we are working with a daily chart. The second line is the first function we will introduce in this article.
"TimeframeSet" is a function that tells the trading software to switch to another timeframe. A weekly timeframe has a value of 7. This is normal since there are 7 days in a week. 31 is the value you should use to define a monthly timeframe and 365 to define a yearly timeframe. Any other value can be used and it will be referred to as a custom timeframe.

There are still 6 timeframe-related functions you need to know about. They will be presented and explained in the next post.











no comments (Log in)

QuantShare Blog
QuantShare
Search Posts




QuantShare
Recent Posts

Create Graphs using the Grid Tool
Posted 1480 days ago

Profile Graphs
Posted 1585 days ago

QuantShare
Previous Posts

Short Index - Part 2
Posted 5409 days ago

Short Index - Part 1
Posted 5416 days ago

Historical Market Data
Posted 5437 days ago

Historical volatility estimators
Posted 5450 days ago

Short Selling Stocks
Posted 5458 days ago

Stock split & dividend
Posted 5464 days ago

Survivorship bias
Posted 5471 days ago

Transaction Costs
Posted 5479 days ago


More Posts

Back







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.