Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I have been working with MultiCharts.Net/VB.Net for a few weeks now. Slowly, I am getting familiar with the workflows and technical details of the software. One important topic is accessing a higher timeframe from a lower timeframe. I have prepared an analysis on this and would appreciate friendly comments on the content.
The question is which period of a smaller timeframe corresponds to the respective period of the higher timeframe. The chart setup consists of Instrument(1) = Datanumber1 - 15 minutes, and Instrument(2) = Datanumber2 - 1 hour. This configuration is used in trading systems that operate on the smaller timeframe but incorporate information from the higher timeframe into the trading logic.
On Instrument(1), the lower timeframe, an indicator runs that generates text output in the output window. The indicator has the CalcEveryTick(False) attribute, which ensures that the evaluation occurs only once, at the closing tick of the period.
Access to the timestamps of the instruments is done using index 0 on the Time() property. Index 0 reads the current timestamp of the data series, while index 1 would read the timestamp of the previous period, as the series properties of the instrument are sorted in reverse order. Additionally, along with the timestamp, the period’s closing price Close(0) is also read and included in the text output.
CalcBar is called once per 15-minute period at the closing tick. In htfInstrument, the hourly instrument is read. The text output includes the timestamp of the current 15-minute period, the timestamp of the corresponding hourly period, and the closing prices of both periods.
I interpret the output to mean that the currently running smaller period is automatically assigned the most recently closed higher period. The 22:00 15-minute period is the last period within the 22:00 hourly period. Therefore, the 22:00 hourly period is assigned to the 22:00 15-minute period. During the following periods at 08:15, 08:30, and 08:45, the 22:00 hourly period is still considered the current hourly period. From 09:00 in the 15-minute timeframe, the 09:00 hourly period is assigned.
The question of whether I can access the period BarsOfData(2).Time(0) at the closing tick of the period Bars.Time(0) without my trading system accidentally evaluating future data can be answered with yes.