In terms of data-source time-frame, what I understand is:
1. Intra-day and daily data should be in different files.
2. When the intra-day data is plotted, it cannot be compressed into daily (except by referring to 86399 seconds to denote day). Switching the chart from 1h to daily will not work.
3. In order to refer to a daily series/calculation while being in an intra-day time-frame, TimeframeSet(-1)/TimeframeRestore()/timeframedecompress functions are used.
When we use TimeframeSet(-1), how does it work? If I am working with hourly data and apply TimeframeSet(-1), does it compress the same hourly data into daily or does it look for another file where the daily data is present? If so, how does it relate to it? Is it that "Name" field should be same or matches the "Name" of the hourly data with either of the Name, Name1,Name2 in the daily data? I see that we cannot have the same "Name" for two symbols irrespective of their time-frame.
Now, my situation. I am using metastock data and has separate hourly and daily folders for the same security. The symbol names for hourly and daily are different. How do I use TimeframeSet(-1) here?
Also, is there a way in charting, when I change time-frame to daily from 1h, it goes to the daily file and plots it if I give a common name under Name1 or Name2 for both 1h and dailly?
Sorry for being too wordy about it. Many thanks as usual.
Your understanding is correct. EOD and Intraday data are saved into different databases.
When you use "TimeframeSet(-1)", data from the EOD database is used and synchronized with the intraday data. Of course the EOD data for the same ticker symbol is used by default but you can get data for any other symbol.
If you want to get EOD data for another symbol, you should create a custom function (Tools -> Create Functions) and use the "cFunctions.GetCustomDatabaseData" function.
You can also get daily data from intraday data using "HistoPrice" function.
I think I missed one important aspect. That symbol info will have only one entry for both the daily and intra-day data. I mean, if I load an intra-day data with symbol name "XYZ" and then a daily data with the same symbol name "XYZ", "manage symbols" will show only one "XYZ" (one row) rather than "XYZ" twice for intra-day as well daily. My confusion rose from this. Many thanks.
Now, if the symbol name for intra-day data is "ABC" but the symbol name for daily data (quotes) is "DEF", what is the best way to relate them in charting and other calculations?
"If you want to get EOD data for another symbol, you should create a custom function (Tools -> Create Functions) and use the "cFunctions.GetCustomDatabaseData" function" - is it for a situation when I am looking for fields from a custom database?
Also, how can I rename symbol names (Symbol Info - Name)?
How about the situation when I use external metastock database which has different symbols for hourly and daily data? The above function, as I understand it, refers time-frame data of a "particular" symbol. I am trying to think whether there can be a solution by giving a common Name1 to both the hourly and daily symbols. Though not able to think clearly how to achieve my purpose with it!
The solution would be to update the symbols for hourly data and set their "Name1" to the symbols of daily data.
When creating functions, you can reference the "Name1" field using:
cFunctions.SymbolInfo.Name1
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.