Time Question When Building Bars  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
FistPeso
Posts: 16
Joined: 01 Sep 2013
Has thanked: 3 times
Been thanked: 8 times

Time Question When Building Bars

Postby FistPeso » 12 Sep 2013

I have noticed this behavior with several different instruments. I am using the current MC.NET 64 bit version and IQFeed as my data provider.

Use Case:
1) Create a new chart.
2) Add future instrument "+GC#" as the first dataseries, use 1 month resolution, specify local time.
3) Add index instrument "INDU.X" as the second dataseries, use 1 month resolution, specify local time.
4) Add study Spread_Ratio.

Notice that the study is calculating the ratio on the previous month INDU.X bar instead of the current month bar. It appears that the bars are built inappropriately based on the TimeStamp instead of the date. The +GC# future has a monthly timestamp of 16:15 and the INDUX.X bar has a timestamp of 23:59.

I created my own function to get around this behavior, but I ran into another issue when referencing the FullSymbolData and using a -1 index on the last bar when Update on Every Tick is checked.

Please advise on a workaround or a fix? Support indicated that I should switch the instruments around, but that is not a fix to this problem and it changes the ratio.

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Time Bug When Building Bars  [SOLVED]

Postby Andrew MultiCharts » 12 Sep 2013

If the closing time of bars is different, you will face the described situation. It is expected behavior.

The solution would be to use the following session settings on chart:  
 
1) GC: 
Sunday 18:00 Monday 17:15 
Monday 18:00 Tuesday 17:15 
Tuesday 18:00 Wednesday 17:15 
Wednesday 18:00 Thursday 17:15 
Thursday  18:00 Friday 17:15 
 
2) INDU.X: 
Monday 9:30 Monday 17:15 
Tuesday 9:30 Tuesday 17:15 
Wednesday 9:30 Wednesday 17:15 
Thursday 9:30 Thursday 17:15 
Friday 9:30 Friday 17:15 
 
I would recommend to create such session templates and use them either in QM or in MC on charts. To learn more about how sessions are used in MC and where it is better to use them, please read this article.

FistPeso
Posts: 16
Joined: 01 Sep 2013
Has thanked: 3 times
Been thanked: 8 times

Re: Time Bug When Building Bars

Postby FistPeso » 16 Sep 2013

Thanks, Session Templates where the solution.


Return to “MultiCharts .NET”