and for market hours as well.
This commit is contained in:
parent
98d3996b47
commit
dfd8a00283
|
@ -183,5 +183,10 @@ func (mhr MarketHoursRange) Translate(value float64) int {
|
|||
totalSeconds := Date.CalculateMarketSecondsBetween(mhr.Min, mhr.GetEffectiveMax(), mhr.GetMarketOpen(), mhr.GetMarketClose(), mhr.HolidayProvider)
|
||||
valueDelta := Date.CalculateMarketSecondsBetween(mhr.Min, valueTimeEastern, mhr.GetMarketOpen(), mhr.GetMarketClose(), mhr.HolidayProvider)
|
||||
translated := int((float64(valueDelta) / float64(totalSeconds)) * float64(mhr.Domain))
|
||||
|
||||
if r.IsDescending() {
|
||||
return r.Domain - translated
|
||||
}
|
||||
|
||||
return translated
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user