MarketSeries.OpenTime Bug
Created at 31 Jan 2018, 23:10
MarketSeries.OpenTime Bug
31 Jan 2018, 23:10
Maybe I am bugging, but suspect something is wrong here, the MarketSeries.OpenTime does never seem to be a Friday. Please advise if this is expected or if I made an incorrect assumption about the OpenTime value?
Code:
On the Dax it gives the following output
Thanks.
Complete code:
using System; using System.Linq; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; namespace cAlgo { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class BugDemo : Robot { private bool didWeEverHaveFriday = false; protected override void OnBar() { //Print(MarketSeries.OpenTime.LastValue.Date.DayOfWeek + " " + MarketSeries.OpenTime.LastValue.Date.ToShortDateString()); if (MarketSeries.OpenTime.LastValue.DayOfWeek == DayOfWeek.Sunday) { Print("Trading Sunday"); } if (MarketSeries.OpenTime.LastValue.DayOfWeek == DayOfWeek.Friday) { didWeEverHaveFriday = true; } } protected override void OnStop() { if (!didWeEverHaveFriday) { Print("Is Market Closed on every Friday"); } } } }
Replies
PanagiotisCharalampous
01 Feb 2018, 12:08
Hi m.bister,
If you use the Daily chart then the result is correct. There is no opening time on Friday. The daily bar opens at 22:00 on Thursday, UTC time. The next opening time is at 22:00 on Sunday.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Feb 2018, 09:53
Hi m.bister,
Thanks for posting in our forum. What timeframe do you use for your backtesting?
Best Regards,
Panagiotis
@PanagiotisCharalampous