and for market hours as well.
This commit is contained in:
parent
98d3996b47
commit
dfd8a00283
1 changed files with 5 additions and 0 deletions
|
@ -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 a new issue