reportify-sdk 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/index.d.mts +19 -19
- package/dist/index.d.ts +19 -19
- package/dist/index.js +19 -19
- package/dist/index.mjs +19 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -98,19 +98,19 @@ const result = await client.docs.uploadDocs([
|
|
|
98
98
|
|
|
99
99
|
```typescript
|
|
100
100
|
// Compute technical indicators
|
|
101
|
-
const rsi = await client.quant.
|
|
101
|
+
const rsi = await client.quant.indicatorsCompute({
|
|
102
102
|
symbols: ['000001'],
|
|
103
103
|
formula: 'RSI(14)'
|
|
104
104
|
});
|
|
105
105
|
|
|
106
|
-
const macd = await client.quant.
|
|
106
|
+
const macd = await client.quant.indicatorsCompute({
|
|
107
107
|
symbols: ['000001'],
|
|
108
108
|
formula: 'MACD()'
|
|
109
109
|
});
|
|
110
110
|
|
|
111
111
|
// Screen stocks by formula
|
|
112
|
-
const oversold = await client.quant.
|
|
113
|
-
const goldenCross = await client.quant.
|
|
112
|
+
const oversold = await client.quant.factorsScreen({ formula: 'RSI(14) < 30' });
|
|
113
|
+
const goldenCross = await client.quant.factorsScreen({ formula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 20))' });
|
|
114
114
|
|
|
115
115
|
// Get OHLCV data
|
|
116
116
|
const ohlcv = await client.quant.ohlcv({ symbol: '000001', startDate: '2024-01-01' });
|
package/dist/index.d.mts
CHANGED
|
@@ -757,13 +757,13 @@ interface BacktestResult {
|
|
|
757
757
|
* @example
|
|
758
758
|
* ```typescript
|
|
759
759
|
* // Compute RSI indicator
|
|
760
|
-
* const data = await client.quant.
|
|
760
|
+
* const data = await client.quant.indicatorsCompute({
|
|
761
761
|
* symbols: ['000001'],
|
|
762
762
|
* formula: 'RSI(14)'
|
|
763
763
|
* });
|
|
764
764
|
*
|
|
765
765
|
* // Screen stocks by formula
|
|
766
|
-
* const stocks = await client.quant.
|
|
766
|
+
* const stocks = await client.quant.factorsScreen({
|
|
767
767
|
* formula: 'RSI(14) < 30'
|
|
768
768
|
* });
|
|
769
769
|
* ```
|
|
@@ -780,14 +780,14 @@ declare class QuantModule {
|
|
|
780
780
|
*
|
|
781
781
|
* @example
|
|
782
782
|
* ```typescript
|
|
783
|
-
* const indicators = await client.quant.
|
|
783
|
+
* const indicators = await client.quant.indicators();
|
|
784
784
|
* indicators.forEach(ind => {
|
|
785
785
|
* console.log(`${ind.name}: ${ind.description}`);
|
|
786
786
|
* console.log(` Fields: ${ind.fields.join(', ')}`);
|
|
787
787
|
* });
|
|
788
788
|
* ```
|
|
789
789
|
*/
|
|
790
|
-
|
|
790
|
+
indicators(): Promise<IndicatorMeta[]>;
|
|
791
791
|
/**
|
|
792
792
|
* Compute indicator values for given symbols
|
|
793
793
|
*
|
|
@@ -801,25 +801,25 @@ declare class QuantModule {
|
|
|
801
801
|
* @example
|
|
802
802
|
* ```typescript
|
|
803
803
|
* // RSI indicator
|
|
804
|
-
* const data = await client.quant.
|
|
804
|
+
* const data = await client.quant.indicatorsCompute({
|
|
805
805
|
* symbols: ['000001'],
|
|
806
806
|
* formula: 'RSI(14)'
|
|
807
807
|
* });
|
|
808
808
|
*
|
|
809
809
|
* // MACD indicator
|
|
810
|
-
* const data = await client.quant.
|
|
810
|
+
* const data = await client.quant.indicatorsCompute({
|
|
811
811
|
* symbols: ['000001'],
|
|
812
812
|
* formula: 'MACD()'
|
|
813
813
|
* });
|
|
814
814
|
*
|
|
815
815
|
* // Standard deviation
|
|
816
|
-
* const data = await client.quant.
|
|
816
|
+
* const data = await client.quant.indicatorsCompute({
|
|
817
817
|
* symbols: ['000001'],
|
|
818
818
|
* formula: 'STD(CLOSE, 20)'
|
|
819
819
|
* });
|
|
820
820
|
* ```
|
|
821
821
|
*/
|
|
822
|
-
|
|
822
|
+
indicatorsCompute(params: IndicatorComputeParams): Promise<IndicatorData[]>;
|
|
823
823
|
/**
|
|
824
824
|
* Get list of available factors (variables and functions)
|
|
825
825
|
*
|
|
@@ -829,7 +829,7 @@ declare class QuantModule {
|
|
|
829
829
|
*
|
|
830
830
|
* @returns Array of factor definitions organized by level
|
|
831
831
|
*/
|
|
832
|
-
|
|
832
|
+
factors(): Promise<FactorMeta[]>;
|
|
833
833
|
/**
|
|
834
834
|
* Compute factor values for given symbols
|
|
835
835
|
*
|
|
@@ -845,31 +845,31 @@ declare class QuantModule {
|
|
|
845
845
|
* @example
|
|
846
846
|
* ```typescript
|
|
847
847
|
* // Simple indicator
|
|
848
|
-
* const data = await client.quant.
|
|
848
|
+
* const data = await client.quant.factorsCompute({
|
|
849
849
|
* symbols: ['000001'],
|
|
850
850
|
* formula: 'RSI(14)'
|
|
851
851
|
* });
|
|
852
852
|
*
|
|
853
853
|
* // MACD DIF line
|
|
854
|
-
* const data = await client.quant.
|
|
854
|
+
* const data = await client.quant.factorsCompute({
|
|
855
855
|
* symbols: ['000001'],
|
|
856
856
|
* formula: 'MACD().dif'
|
|
857
857
|
* });
|
|
858
858
|
*
|
|
859
859
|
* // Close above 20-day MA
|
|
860
|
-
* const data = await client.quant.
|
|
860
|
+
* const data = await client.quant.factorsCompute({
|
|
861
861
|
* symbols: ['000001'],
|
|
862
862
|
* formula: 'CLOSE > MA(CLOSE, 20)'
|
|
863
863
|
* });
|
|
864
864
|
*
|
|
865
865
|
* // Fundamental factors (note: functions require parentheses)
|
|
866
|
-
* const data = await client.quant.
|
|
866
|
+
* const data = await client.quant.factorsCompute({
|
|
867
867
|
* symbols: ['000001'],
|
|
868
868
|
* formula: 'PE()'
|
|
869
869
|
* });
|
|
870
870
|
* ```
|
|
871
871
|
*/
|
|
872
|
-
|
|
872
|
+
factorsCompute(params: FactorComputeParams): Promise<IndicatorData[]>;
|
|
873
873
|
/**
|
|
874
874
|
* Screen stocks based on factor formula
|
|
875
875
|
*
|
|
@@ -883,27 +883,27 @@ declare class QuantModule {
|
|
|
883
883
|
* @example
|
|
884
884
|
* ```typescript
|
|
885
885
|
* // RSI oversold
|
|
886
|
-
* const stocks = await client.quant.
|
|
886
|
+
* const stocks = await client.quant.factorsScreen({
|
|
887
887
|
* formula: 'RSI(14) < 30'
|
|
888
888
|
* });
|
|
889
889
|
*
|
|
890
890
|
* // Golden cross
|
|
891
|
-
* const stocks = await client.quant.
|
|
891
|
+
* const stocks = await client.quant.factorsScreen({
|
|
892
892
|
* formula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 10))'
|
|
893
893
|
* });
|
|
894
894
|
*
|
|
895
895
|
* // Uptrend
|
|
896
|
-
* const stocks = await client.quant.
|
|
896
|
+
* const stocks = await client.quant.factorsScreen({
|
|
897
897
|
* formula: '(CLOSE > MA(CLOSE, 20)) & (MA(CLOSE, 20) > MA(CLOSE, 60))'
|
|
898
898
|
* });
|
|
899
899
|
*
|
|
900
900
|
* // Fundamental screening (note: functions require parentheses)
|
|
901
|
-
* const stocks = await client.quant.
|
|
901
|
+
* const stocks = await client.quant.factorsScreen({
|
|
902
902
|
* formula: '(PE() < 20) & (ROE() > 0.15)'
|
|
903
903
|
* });
|
|
904
904
|
* ```
|
|
905
905
|
*/
|
|
906
|
-
|
|
906
|
+
factorsScreen(params: ScreenParams): Promise<ScreenedStock[]>;
|
|
907
907
|
/**
|
|
908
908
|
* Get OHLCV daily data for a single symbol
|
|
909
909
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -757,13 +757,13 @@ interface BacktestResult {
|
|
|
757
757
|
* @example
|
|
758
758
|
* ```typescript
|
|
759
759
|
* // Compute RSI indicator
|
|
760
|
-
* const data = await client.quant.
|
|
760
|
+
* const data = await client.quant.indicatorsCompute({
|
|
761
761
|
* symbols: ['000001'],
|
|
762
762
|
* formula: 'RSI(14)'
|
|
763
763
|
* });
|
|
764
764
|
*
|
|
765
765
|
* // Screen stocks by formula
|
|
766
|
-
* const stocks = await client.quant.
|
|
766
|
+
* const stocks = await client.quant.factorsScreen({
|
|
767
767
|
* formula: 'RSI(14) < 30'
|
|
768
768
|
* });
|
|
769
769
|
* ```
|
|
@@ -780,14 +780,14 @@ declare class QuantModule {
|
|
|
780
780
|
*
|
|
781
781
|
* @example
|
|
782
782
|
* ```typescript
|
|
783
|
-
* const indicators = await client.quant.
|
|
783
|
+
* const indicators = await client.quant.indicators();
|
|
784
784
|
* indicators.forEach(ind => {
|
|
785
785
|
* console.log(`${ind.name}: ${ind.description}`);
|
|
786
786
|
* console.log(` Fields: ${ind.fields.join(', ')}`);
|
|
787
787
|
* });
|
|
788
788
|
* ```
|
|
789
789
|
*/
|
|
790
|
-
|
|
790
|
+
indicators(): Promise<IndicatorMeta[]>;
|
|
791
791
|
/**
|
|
792
792
|
* Compute indicator values for given symbols
|
|
793
793
|
*
|
|
@@ -801,25 +801,25 @@ declare class QuantModule {
|
|
|
801
801
|
* @example
|
|
802
802
|
* ```typescript
|
|
803
803
|
* // RSI indicator
|
|
804
|
-
* const data = await client.quant.
|
|
804
|
+
* const data = await client.quant.indicatorsCompute({
|
|
805
805
|
* symbols: ['000001'],
|
|
806
806
|
* formula: 'RSI(14)'
|
|
807
807
|
* });
|
|
808
808
|
*
|
|
809
809
|
* // MACD indicator
|
|
810
|
-
* const data = await client.quant.
|
|
810
|
+
* const data = await client.quant.indicatorsCompute({
|
|
811
811
|
* symbols: ['000001'],
|
|
812
812
|
* formula: 'MACD()'
|
|
813
813
|
* });
|
|
814
814
|
*
|
|
815
815
|
* // Standard deviation
|
|
816
|
-
* const data = await client.quant.
|
|
816
|
+
* const data = await client.quant.indicatorsCompute({
|
|
817
817
|
* symbols: ['000001'],
|
|
818
818
|
* formula: 'STD(CLOSE, 20)'
|
|
819
819
|
* });
|
|
820
820
|
* ```
|
|
821
821
|
*/
|
|
822
|
-
|
|
822
|
+
indicatorsCompute(params: IndicatorComputeParams): Promise<IndicatorData[]>;
|
|
823
823
|
/**
|
|
824
824
|
* Get list of available factors (variables and functions)
|
|
825
825
|
*
|
|
@@ -829,7 +829,7 @@ declare class QuantModule {
|
|
|
829
829
|
*
|
|
830
830
|
* @returns Array of factor definitions organized by level
|
|
831
831
|
*/
|
|
832
|
-
|
|
832
|
+
factors(): Promise<FactorMeta[]>;
|
|
833
833
|
/**
|
|
834
834
|
* Compute factor values for given symbols
|
|
835
835
|
*
|
|
@@ -845,31 +845,31 @@ declare class QuantModule {
|
|
|
845
845
|
* @example
|
|
846
846
|
* ```typescript
|
|
847
847
|
* // Simple indicator
|
|
848
|
-
* const data = await client.quant.
|
|
848
|
+
* const data = await client.quant.factorsCompute({
|
|
849
849
|
* symbols: ['000001'],
|
|
850
850
|
* formula: 'RSI(14)'
|
|
851
851
|
* });
|
|
852
852
|
*
|
|
853
853
|
* // MACD DIF line
|
|
854
|
-
* const data = await client.quant.
|
|
854
|
+
* const data = await client.quant.factorsCompute({
|
|
855
855
|
* symbols: ['000001'],
|
|
856
856
|
* formula: 'MACD().dif'
|
|
857
857
|
* });
|
|
858
858
|
*
|
|
859
859
|
* // Close above 20-day MA
|
|
860
|
-
* const data = await client.quant.
|
|
860
|
+
* const data = await client.quant.factorsCompute({
|
|
861
861
|
* symbols: ['000001'],
|
|
862
862
|
* formula: 'CLOSE > MA(CLOSE, 20)'
|
|
863
863
|
* });
|
|
864
864
|
*
|
|
865
865
|
* // Fundamental factors (note: functions require parentheses)
|
|
866
|
-
* const data = await client.quant.
|
|
866
|
+
* const data = await client.quant.factorsCompute({
|
|
867
867
|
* symbols: ['000001'],
|
|
868
868
|
* formula: 'PE()'
|
|
869
869
|
* });
|
|
870
870
|
* ```
|
|
871
871
|
*/
|
|
872
|
-
|
|
872
|
+
factorsCompute(params: FactorComputeParams): Promise<IndicatorData[]>;
|
|
873
873
|
/**
|
|
874
874
|
* Screen stocks based on factor formula
|
|
875
875
|
*
|
|
@@ -883,27 +883,27 @@ declare class QuantModule {
|
|
|
883
883
|
* @example
|
|
884
884
|
* ```typescript
|
|
885
885
|
* // RSI oversold
|
|
886
|
-
* const stocks = await client.quant.
|
|
886
|
+
* const stocks = await client.quant.factorsScreen({
|
|
887
887
|
* formula: 'RSI(14) < 30'
|
|
888
888
|
* });
|
|
889
889
|
*
|
|
890
890
|
* // Golden cross
|
|
891
|
-
* const stocks = await client.quant.
|
|
891
|
+
* const stocks = await client.quant.factorsScreen({
|
|
892
892
|
* formula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 10))'
|
|
893
893
|
* });
|
|
894
894
|
*
|
|
895
895
|
* // Uptrend
|
|
896
|
-
* const stocks = await client.quant.
|
|
896
|
+
* const stocks = await client.quant.factorsScreen({
|
|
897
897
|
* formula: '(CLOSE > MA(CLOSE, 20)) & (MA(CLOSE, 20) > MA(CLOSE, 60))'
|
|
898
898
|
* });
|
|
899
899
|
*
|
|
900
900
|
* // Fundamental screening (note: functions require parentheses)
|
|
901
|
-
* const stocks = await client.quant.
|
|
901
|
+
* const stocks = await client.quant.factorsScreen({
|
|
902
902
|
* formula: '(PE() < 20) & (ROE() > 0.15)'
|
|
903
903
|
* });
|
|
904
904
|
* ```
|
|
905
905
|
*/
|
|
906
|
-
|
|
906
|
+
factorsScreen(params: ScreenParams): Promise<ScreenedStock[]>;
|
|
907
907
|
/**
|
|
908
908
|
* Get OHLCV daily data for a single symbol
|
|
909
909
|
*
|
package/dist/index.js
CHANGED
|
@@ -628,14 +628,14 @@ var QuantModule = class {
|
|
|
628
628
|
*
|
|
629
629
|
* @example
|
|
630
630
|
* ```typescript
|
|
631
|
-
* const indicators = await client.quant.
|
|
631
|
+
* const indicators = await client.quant.indicators();
|
|
632
632
|
* indicators.forEach(ind => {
|
|
633
633
|
* console.log(`${ind.name}: ${ind.description}`);
|
|
634
634
|
* console.log(` Fields: ${ind.fields.join(', ')}`);
|
|
635
635
|
* });
|
|
636
636
|
* ```
|
|
637
637
|
*/
|
|
638
|
-
async
|
|
638
|
+
async indicators() {
|
|
639
639
|
return this.client.get("/v1/quant/indicators");
|
|
640
640
|
}
|
|
641
641
|
/**
|
|
@@ -651,25 +651,25 @@ var QuantModule = class {
|
|
|
651
651
|
* @example
|
|
652
652
|
* ```typescript
|
|
653
653
|
* // RSI indicator
|
|
654
|
-
* const data = await client.quant.
|
|
654
|
+
* const data = await client.quant.indicatorsCompute({
|
|
655
655
|
* symbols: ['000001'],
|
|
656
656
|
* formula: 'RSI(14)'
|
|
657
657
|
* });
|
|
658
658
|
*
|
|
659
659
|
* // MACD indicator
|
|
660
|
-
* const data = await client.quant.
|
|
660
|
+
* const data = await client.quant.indicatorsCompute({
|
|
661
661
|
* symbols: ['000001'],
|
|
662
662
|
* formula: 'MACD()'
|
|
663
663
|
* });
|
|
664
664
|
*
|
|
665
665
|
* // Standard deviation
|
|
666
|
-
* const data = await client.quant.
|
|
666
|
+
* const data = await client.quant.indicatorsCompute({
|
|
667
667
|
* symbols: ['000001'],
|
|
668
668
|
* formula: 'STD(CLOSE, 20)'
|
|
669
669
|
* });
|
|
670
670
|
* ```
|
|
671
671
|
*/
|
|
672
|
-
async
|
|
672
|
+
async indicatorsCompute(params) {
|
|
673
673
|
const response = await this.client.post("/v1/quant/indicators/compute", {
|
|
674
674
|
symbols: params.symbols,
|
|
675
675
|
formula: params.formula,
|
|
@@ -691,7 +691,7 @@ var QuantModule = class {
|
|
|
691
691
|
*
|
|
692
692
|
* @returns Array of factor definitions organized by level
|
|
693
693
|
*/
|
|
694
|
-
async
|
|
694
|
+
async factors() {
|
|
695
695
|
return this.client.get("/v1/quant/factors");
|
|
696
696
|
}
|
|
697
697
|
/**
|
|
@@ -709,31 +709,31 @@ var QuantModule = class {
|
|
|
709
709
|
* @example
|
|
710
710
|
* ```typescript
|
|
711
711
|
* // Simple indicator
|
|
712
|
-
* const data = await client.quant.
|
|
712
|
+
* const data = await client.quant.factorsCompute({
|
|
713
713
|
* symbols: ['000001'],
|
|
714
714
|
* formula: 'RSI(14)'
|
|
715
715
|
* });
|
|
716
716
|
*
|
|
717
717
|
* // MACD DIF line
|
|
718
|
-
* const data = await client.quant.
|
|
718
|
+
* const data = await client.quant.factorsCompute({
|
|
719
719
|
* symbols: ['000001'],
|
|
720
720
|
* formula: 'MACD().dif'
|
|
721
721
|
* });
|
|
722
722
|
*
|
|
723
723
|
* // Close above 20-day MA
|
|
724
|
-
* const data = await client.quant.
|
|
724
|
+
* const data = await client.quant.factorsCompute({
|
|
725
725
|
* symbols: ['000001'],
|
|
726
726
|
* formula: 'CLOSE > MA(CLOSE, 20)'
|
|
727
727
|
* });
|
|
728
728
|
*
|
|
729
729
|
* // Fundamental factors (note: functions require parentheses)
|
|
730
|
-
* const data = await client.quant.
|
|
730
|
+
* const data = await client.quant.factorsCompute({
|
|
731
731
|
* symbols: ['000001'],
|
|
732
732
|
* formula: 'PE()'
|
|
733
733
|
* });
|
|
734
734
|
* ```
|
|
735
735
|
*/
|
|
736
|
-
async
|
|
736
|
+
async factorsCompute(params) {
|
|
737
737
|
const response = await this.client.post("/v1/quant/factors/compute", {
|
|
738
738
|
symbols: params.symbols,
|
|
739
739
|
formula: params.formula,
|
|
@@ -756,27 +756,27 @@ var QuantModule = class {
|
|
|
756
756
|
* @example
|
|
757
757
|
* ```typescript
|
|
758
758
|
* // RSI oversold
|
|
759
|
-
* const stocks = await client.quant.
|
|
759
|
+
* const stocks = await client.quant.factorsScreen({
|
|
760
760
|
* formula: 'RSI(14) < 30'
|
|
761
761
|
* });
|
|
762
762
|
*
|
|
763
763
|
* // Golden cross
|
|
764
|
-
* const stocks = await client.quant.
|
|
764
|
+
* const stocks = await client.quant.factorsScreen({
|
|
765
765
|
* formula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 10))'
|
|
766
766
|
* });
|
|
767
767
|
*
|
|
768
768
|
* // Uptrend
|
|
769
|
-
* const stocks = await client.quant.
|
|
769
|
+
* const stocks = await client.quant.factorsScreen({
|
|
770
770
|
* formula: '(CLOSE > MA(CLOSE, 20)) & (MA(CLOSE, 20) > MA(CLOSE, 60))'
|
|
771
771
|
* });
|
|
772
772
|
*
|
|
773
773
|
* // Fundamental screening (note: functions require parentheses)
|
|
774
|
-
* const stocks = await client.quant.
|
|
774
|
+
* const stocks = await client.quant.factorsScreen({
|
|
775
775
|
* formula: '(PE() < 20) & (ROE() > 0.15)'
|
|
776
776
|
* });
|
|
777
777
|
* ```
|
|
778
778
|
*/
|
|
779
|
-
async
|
|
779
|
+
async factorsScreen(params) {
|
|
780
780
|
const response = await this.client.post("/v1/quant/factors/screen", {
|
|
781
781
|
formula: params.formula,
|
|
782
782
|
market: params.market || "cn",
|
|
@@ -1670,7 +1670,7 @@ var Reportify = class {
|
|
|
1670
1670
|
headers: {
|
|
1671
1671
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1672
1672
|
"Content-Type": "application/json",
|
|
1673
|
-
"User-Agent": "reportify-sdk-js/0.3.
|
|
1673
|
+
"User-Agent": "reportify-sdk-js/0.3.9"
|
|
1674
1674
|
},
|
|
1675
1675
|
body: options.body ? JSON.stringify(options.body) : void 0,
|
|
1676
1676
|
signal: controller.signal
|
|
@@ -1731,7 +1731,7 @@ var Reportify = class {
|
|
|
1731
1731
|
headers: {
|
|
1732
1732
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1733
1733
|
"Content-Type": "application/json",
|
|
1734
|
-
"User-Agent": "reportify-sdk-typescript/0.3.
|
|
1734
|
+
"User-Agent": "reportify-sdk-typescript/0.3.9"
|
|
1735
1735
|
}
|
|
1736
1736
|
});
|
|
1737
1737
|
if (!response.ok) {
|
package/dist/index.mjs
CHANGED
|
@@ -586,14 +586,14 @@ var QuantModule = class {
|
|
|
586
586
|
*
|
|
587
587
|
* @example
|
|
588
588
|
* ```typescript
|
|
589
|
-
* const indicators = await client.quant.
|
|
589
|
+
* const indicators = await client.quant.indicators();
|
|
590
590
|
* indicators.forEach(ind => {
|
|
591
591
|
* console.log(`${ind.name}: ${ind.description}`);
|
|
592
592
|
* console.log(` Fields: ${ind.fields.join(', ')}`);
|
|
593
593
|
* });
|
|
594
594
|
* ```
|
|
595
595
|
*/
|
|
596
|
-
async
|
|
596
|
+
async indicators() {
|
|
597
597
|
return this.client.get("/v1/quant/indicators");
|
|
598
598
|
}
|
|
599
599
|
/**
|
|
@@ -609,25 +609,25 @@ var QuantModule = class {
|
|
|
609
609
|
* @example
|
|
610
610
|
* ```typescript
|
|
611
611
|
* // RSI indicator
|
|
612
|
-
* const data = await client.quant.
|
|
612
|
+
* const data = await client.quant.indicatorsCompute({
|
|
613
613
|
* symbols: ['000001'],
|
|
614
614
|
* formula: 'RSI(14)'
|
|
615
615
|
* });
|
|
616
616
|
*
|
|
617
617
|
* // MACD indicator
|
|
618
|
-
* const data = await client.quant.
|
|
618
|
+
* const data = await client.quant.indicatorsCompute({
|
|
619
619
|
* symbols: ['000001'],
|
|
620
620
|
* formula: 'MACD()'
|
|
621
621
|
* });
|
|
622
622
|
*
|
|
623
623
|
* // Standard deviation
|
|
624
|
-
* const data = await client.quant.
|
|
624
|
+
* const data = await client.quant.indicatorsCompute({
|
|
625
625
|
* symbols: ['000001'],
|
|
626
626
|
* formula: 'STD(CLOSE, 20)'
|
|
627
627
|
* });
|
|
628
628
|
* ```
|
|
629
629
|
*/
|
|
630
|
-
async
|
|
630
|
+
async indicatorsCompute(params) {
|
|
631
631
|
const response = await this.client.post("/v1/quant/indicators/compute", {
|
|
632
632
|
symbols: params.symbols,
|
|
633
633
|
formula: params.formula,
|
|
@@ -649,7 +649,7 @@ var QuantModule = class {
|
|
|
649
649
|
*
|
|
650
650
|
* @returns Array of factor definitions organized by level
|
|
651
651
|
*/
|
|
652
|
-
async
|
|
652
|
+
async factors() {
|
|
653
653
|
return this.client.get("/v1/quant/factors");
|
|
654
654
|
}
|
|
655
655
|
/**
|
|
@@ -667,31 +667,31 @@ var QuantModule = class {
|
|
|
667
667
|
* @example
|
|
668
668
|
* ```typescript
|
|
669
669
|
* // Simple indicator
|
|
670
|
-
* const data = await client.quant.
|
|
670
|
+
* const data = await client.quant.factorsCompute({
|
|
671
671
|
* symbols: ['000001'],
|
|
672
672
|
* formula: 'RSI(14)'
|
|
673
673
|
* });
|
|
674
674
|
*
|
|
675
675
|
* // MACD DIF line
|
|
676
|
-
* const data = await client.quant.
|
|
676
|
+
* const data = await client.quant.factorsCompute({
|
|
677
677
|
* symbols: ['000001'],
|
|
678
678
|
* formula: 'MACD().dif'
|
|
679
679
|
* });
|
|
680
680
|
*
|
|
681
681
|
* // Close above 20-day MA
|
|
682
|
-
* const data = await client.quant.
|
|
682
|
+
* const data = await client.quant.factorsCompute({
|
|
683
683
|
* symbols: ['000001'],
|
|
684
684
|
* formula: 'CLOSE > MA(CLOSE, 20)'
|
|
685
685
|
* });
|
|
686
686
|
*
|
|
687
687
|
* // Fundamental factors (note: functions require parentheses)
|
|
688
|
-
* const data = await client.quant.
|
|
688
|
+
* const data = await client.quant.factorsCompute({
|
|
689
689
|
* symbols: ['000001'],
|
|
690
690
|
* formula: 'PE()'
|
|
691
691
|
* });
|
|
692
692
|
* ```
|
|
693
693
|
*/
|
|
694
|
-
async
|
|
694
|
+
async factorsCompute(params) {
|
|
695
695
|
const response = await this.client.post("/v1/quant/factors/compute", {
|
|
696
696
|
symbols: params.symbols,
|
|
697
697
|
formula: params.formula,
|
|
@@ -714,27 +714,27 @@ var QuantModule = class {
|
|
|
714
714
|
* @example
|
|
715
715
|
* ```typescript
|
|
716
716
|
* // RSI oversold
|
|
717
|
-
* const stocks = await client.quant.
|
|
717
|
+
* const stocks = await client.quant.factorsScreen({
|
|
718
718
|
* formula: 'RSI(14) < 30'
|
|
719
719
|
* });
|
|
720
720
|
*
|
|
721
721
|
* // Golden cross
|
|
722
|
-
* const stocks = await client.quant.
|
|
722
|
+
* const stocks = await client.quant.factorsScreen({
|
|
723
723
|
* formula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 10))'
|
|
724
724
|
* });
|
|
725
725
|
*
|
|
726
726
|
* // Uptrend
|
|
727
|
-
* const stocks = await client.quant.
|
|
727
|
+
* const stocks = await client.quant.factorsScreen({
|
|
728
728
|
* formula: '(CLOSE > MA(CLOSE, 20)) & (MA(CLOSE, 20) > MA(CLOSE, 60))'
|
|
729
729
|
* });
|
|
730
730
|
*
|
|
731
731
|
* // Fundamental screening (note: functions require parentheses)
|
|
732
|
-
* const stocks = await client.quant.
|
|
732
|
+
* const stocks = await client.quant.factorsScreen({
|
|
733
733
|
* formula: '(PE() < 20) & (ROE() > 0.15)'
|
|
734
734
|
* });
|
|
735
735
|
* ```
|
|
736
736
|
*/
|
|
737
|
-
async
|
|
737
|
+
async factorsScreen(params) {
|
|
738
738
|
const response = await this.client.post("/v1/quant/factors/screen", {
|
|
739
739
|
formula: params.formula,
|
|
740
740
|
market: params.market || "cn",
|
|
@@ -1628,7 +1628,7 @@ var Reportify = class {
|
|
|
1628
1628
|
headers: {
|
|
1629
1629
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1630
1630
|
"Content-Type": "application/json",
|
|
1631
|
-
"User-Agent": "reportify-sdk-js/0.3.
|
|
1631
|
+
"User-Agent": "reportify-sdk-js/0.3.9"
|
|
1632
1632
|
},
|
|
1633
1633
|
body: options.body ? JSON.stringify(options.body) : void 0,
|
|
1634
1634
|
signal: controller.signal
|
|
@@ -1689,7 +1689,7 @@ var Reportify = class {
|
|
|
1689
1689
|
headers: {
|
|
1690
1690
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1691
1691
|
"Content-Type": "application/json",
|
|
1692
|
-
"User-Agent": "reportify-sdk-typescript/0.3.
|
|
1692
|
+
"User-Agent": "reportify-sdk-typescript/0.3.9"
|
|
1693
1693
|
}
|
|
1694
1694
|
});
|
|
1695
1695
|
if (!response.ok) {
|