Skip to content

Commit acf262c

Browse files
committed
Resolve review comments
1 parent 74fa733 commit acf262c

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

Common/Securities/Security.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,12 @@ public SecurityExchange Exchange
208208
_exchange = value;
209209
if (_localTimeKeeper != null && !_exchange.HasTimeProvider)
210210
{
211-
_exchange.SetLocalDateTimeFrontierProvider(_localTimeKeeper);
211+
var hasDifferentTimeZones = _localTimeKeeper.TimeZone != _exchange.TimeZone;
212+
var newLocalTimeKeeper = hasDifferentTimeZones
213+
? new LocalTimeKeeper(_localTimeKeeper.LocalTime.ConvertToUtc(_exchange.TimeZone), _exchange.TimeZone)
214+
: _localTimeKeeper;
215+
216+
_exchange.SetLocalDateTimeFrontierProvider(newLocalTimeKeeper);
212217
}
213218
}
214219
}

Common/Securities/SecurityExchange.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ public class SecurityExchange
5757
/// <summary>
5858
/// Boolean property for quickly testing if the exchange is 10 minutes away from closing.
5959
/// </summary>
60-
public bool ClosingSoon => IsClosingSoon(minutesToClose:10);
60+
public bool ClosingSoon => IsClosingSoon(minutesToClose: 10);
6161

6262
/// <summary>
6363
/// Indicates whether a time provider has been set for this exchange.
6464
/// </summary>
65-
public bool HasTimeProvider => _timeProvider != null;
65+
internal bool HasTimeProvider => _timeProvider != null;
6666

6767
/// <summary>
6868
/// Initializes a new instance of the <see cref="SecurityExchange"/> class using the specified

0 commit comments

Comments
 (0)