Skip to content

Commit

Permalink
Sorted TimeSeries types.
Browse files Browse the repository at this point in the history
  • Loading branch information
bre1470 committed Sep 3, 2024
1 parent 39930ce commit 30d9d9b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 21 deletions.
8 changes: 4 additions & 4 deletions src/TimeSeries/Converters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';


/* *
Expand All @@ -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';


/* *
Expand All @@ -56,7 +56,7 @@ export default {
CumulativeReturnSeriesConverter,
DividendSeriesConverter,
GrowthSeriesConverter,
OHLCVSeriesConverter,
PriceSeriesConverter,
RatingSeriesConverter,
OHLCVSeriesConverter
RatingSeriesConverter
};
25 changes: 9 additions & 16 deletions src/TimeSeries/TimeSeriesConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';


/* *
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/TimeSeries/TimeSeriesOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.**
*/
Expand Down

0 comments on commit 30d9d9b

Please sign in to comment.