diff --git a/src/TimeSeries/Converters/index.ts b/src/TimeSeries/Converters/index.ts index 9396124..aded649 100644 --- a/src/TimeSeries/Converters/index.ts +++ b/src/TimeSeries/Converters/index.ts @@ -25,9 +25,9 @@ import CumulativeReturnSeriesConverter from './CumulativeReturnSeriesConverter'; import DividendSeriesConverter from './DividendSeriesConverter'; import GrowthSeriesConverter from './GrowthSeriesConverter'; +import OHLCVSeriesConverter from './OHLCVSeriesConverter'; import PriceSeriesConverter from './PriceSeriesConverter'; import RatingSeriesConverter from './RatingSeriesConverter'; -import OHLCVSeriesConverter from './OHLCVSeriesConverter'; /* * @@ -40,9 +40,9 @@ import OHLCVSeriesConverter from './OHLCVSeriesConverter'; export * from './CumulativeReturnSeriesConverter'; export * from './DividendSeriesConverter'; export * from './GrowthSeriesConverter'; +export * from './OHLCVSeriesConverter'; export * from './PriceSeriesConverter'; export * from './RatingSeriesConverter'; -export * from './OHLCVSeriesConverter'; /* * @@ -56,7 +56,7 @@ export default { CumulativeReturnSeriesConverter, DividendSeriesConverter, GrowthSeriesConverter, + OHLCVSeriesConverter, PriceSeriesConverter, - RatingSeriesConverter, - OHLCVSeriesConverter + RatingSeriesConverter }; diff --git a/src/TimeSeries/TimeSeriesConnector.ts b/src/TimeSeries/TimeSeriesConnector.ts index 0c49f7b..512db11 100644 --- a/src/TimeSeries/TimeSeriesConnector.ts +++ b/src/TimeSeries/TimeSeriesConnector.ts @@ -22,18 +22,13 @@ * */ +import Converters from './Converters'; import External from '../Shared/External'; -import GrowthSeriesConverter from './Converters/GrowthSeriesConverter'; import MorningstarAPI from '../Shared/MorningstarAPI'; import MorningstarConnector from '../Shared/MorningstarConnector'; import MorningstarURL from '../Shared/MorningstarURL'; -import CumulativeReturnSeriesConverter from './Converters/CumulativeReturnSeriesConverter'; -import DividendSeriesConverter from './Converters/DividendSeriesConverter'; -import TimeSeriesOptions, { OHLCVSeriesOptions } from './TimeSeriesOptions'; -import TimeSeriesRatingConverter from './Converters/RatingSeriesConverter'; -import PriceSeriesConverter from './Converters/PriceSeriesConverter'; import TimeSeriesConverter from './TimeSeriesConverter'; -import { OHLCVSeriesConverter } from './Converters'; +import TimeSeriesOptions from './TimeSeriesOptions'; /* * @@ -61,47 +56,45 @@ export class TimeSeriesConnector extends MorningstarConnector { switch (options.series?.type) { case 'CumulativeReturn': - this.converter = new CumulativeReturnSeriesConverter({ + this.converter = new Converters.CumulativeReturnSeriesConverter({ ...options.converter, ...options.series }); break; case 'Dividend': - this.converter = new DividendSeriesConverter({ + this.converter = new Converters.DividendSeriesConverter({ ...options.converter, ...options.series }); break; case 'Growth': - this.converter = new GrowthSeriesConverter({ + this.converter = new Converters.GrowthSeriesConverter({ ...options.converter, ...options.series }); break; case 'Rating': - this.converter = new TimeSeriesRatingConverter({ + this.converter = new Converters.RatingSeriesConverter({ ...options.converter, ...options.series }); break; case 'Price': - this.converter = new PriceSeriesConverter({ + this.converter = new Converters.PriceSeriesConverter({ ...options.converter, ...options.series }); break; case 'OHLCV': - this.converter = new OHLCVSeriesConverter({ + this.converter = new Converters.OHLCVSeriesConverter({ ...options.converter, ...options.series, - securities: options.securities, - replaceZeroWithCloseValue: (options as OHLCVSeriesOptions) - .replaceZeroWithCloseValue + securities: options.securities }); break; diff --git a/src/TimeSeries/TimeSeriesOptions.ts b/src/TimeSeries/TimeSeriesOptions.ts index 380aedf..be64d98 100644 --- a/src/TimeSeries/TimeSeriesOptions.ts +++ b/src/TimeSeries/TimeSeriesOptions.ts @@ -175,7 +175,7 @@ export interface TimeSeriesOptions extends MorningstarOptions { localization?: LocalizationOptions; /** - * Security to retrieve. + * Securities to retrieve. * * **NOTE: When series type is `OHLCV`, only one security is supported.** */