reportify-sdk 0.3.3 → 0.3.4
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 +3 -3
- package/dist/index.d.mts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +15 -15
- package/dist/index.mjs +15 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -114,7 +114,7 @@ const macd = await client.quant.computeIndicators({
|
|
|
114
114
|
|
|
115
115
|
// Screen stocks by formula
|
|
116
116
|
const oversold = await client.quant.screen({ formula: 'RSI(14) < 30' });
|
|
117
|
-
const goldenCross = await client.quant.screen({ formula: 'CROSS(MA(5), MA(20))' });
|
|
117
|
+
const goldenCross = await client.quant.screen({ formula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 20))' });
|
|
118
118
|
|
|
119
119
|
// Get OHLCV data
|
|
120
120
|
const ohlcv = await client.quant.ohlcv({ symbol: '000001', startDate: '2024-01-01' });
|
|
@@ -125,8 +125,8 @@ const result = await client.quant.backtest({
|
|
|
125
125
|
startDate: '2023-01-01',
|
|
126
126
|
endDate: '2024-01-01',
|
|
127
127
|
symbol: '000001',
|
|
128
|
-
entryFormula: 'CROSS(MA(5), MA(20))',
|
|
129
|
-
exitFormula: 'CROSSDOWN(MA(5), MA(20))'
|
|
128
|
+
entryFormula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 20))',
|
|
129
|
+
exitFormula: 'CROSSDOWN(MA(CLOSE, 5), MA(CLOSE, 20))'
|
|
130
130
|
});
|
|
131
131
|
console.log(`Total Return: ${(result.total_return_pct * 100).toFixed(2)}%`);
|
|
132
132
|
```
|
package/dist/index.d.mts
CHANGED
|
@@ -800,7 +800,7 @@ declare class QuantModule {
|
|
|
800
800
|
/**
|
|
801
801
|
* Get list of available technical indicators
|
|
802
802
|
*
|
|
803
|
-
* All indicators are functions and require parentheses when used (e.g., MA(20), RSI(14), MACD()).
|
|
803
|
+
* All indicators are functions and require parentheses when used (e.g., MA(CLOSE, 20), RSI(14), MACD()).
|
|
804
804
|
*
|
|
805
805
|
* @returns Array of indicator definitions
|
|
806
806
|
*
|
|
@@ -819,7 +819,7 @@ declare class QuantModule {
|
|
|
819
819
|
*
|
|
820
820
|
* Variables vs Functions:
|
|
821
821
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME (aliases: C, O, H, L, V, VOL)
|
|
822
|
-
* - Functions (
|
|
822
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), RSI(14), MACD(), etc.
|
|
823
823
|
*
|
|
824
824
|
* @param params - Indicator computation parameters
|
|
825
825
|
* @returns Array of indicator data
|
|
@@ -851,7 +851,7 @@ declare class QuantModule {
|
|
|
851
851
|
*
|
|
852
852
|
* Variables vs Functions:
|
|
853
853
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME, PE_TTM, ROE_TTM, etc.
|
|
854
|
-
* - Functions (
|
|
854
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
855
855
|
*
|
|
856
856
|
* @returns Array of factor definitions organized by level
|
|
857
857
|
*/
|
|
@@ -863,7 +863,7 @@ declare class QuantModule {
|
|
|
863
863
|
*
|
|
864
864
|
* Variables vs Functions:
|
|
865
865
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME
|
|
866
|
-
* - Functions (
|
|
866
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
867
867
|
*
|
|
868
868
|
* @param params - Factor computation parameters
|
|
869
869
|
* @returns Array of factor data
|
|
@@ -885,7 +885,7 @@ declare class QuantModule {
|
|
|
885
885
|
* // Close above 20-day MA
|
|
886
886
|
* const data = await client.quant.computeFactors({
|
|
887
887
|
* symbols: ['000001'],
|
|
888
|
-
* formula: 'CLOSE > MA(20)'
|
|
888
|
+
* formula: 'CLOSE > MA(CLOSE, 20)'
|
|
889
889
|
* });
|
|
890
890
|
*
|
|
891
891
|
* // Fundamental factors (note: functions require parentheses)
|
|
@@ -901,7 +901,7 @@ declare class QuantModule {
|
|
|
901
901
|
*
|
|
902
902
|
* Variables vs Functions:
|
|
903
903
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME
|
|
904
|
-
* - Functions (
|
|
904
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
905
905
|
*
|
|
906
906
|
* @param params - Screening parameters
|
|
907
907
|
* @returns Array of stocks that passed the filter
|
|
@@ -915,12 +915,12 @@ declare class QuantModule {
|
|
|
915
915
|
*
|
|
916
916
|
* // Golden cross
|
|
917
917
|
* const stocks = await client.quant.screen({
|
|
918
|
-
* formula: 'CROSS(MA(5), MA(10))'
|
|
918
|
+
* formula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 10))'
|
|
919
919
|
* });
|
|
920
920
|
*
|
|
921
921
|
* // Uptrend
|
|
922
922
|
* const stocks = await client.quant.screen({
|
|
923
|
-
* formula: '(CLOSE > MA(20)) & (MA(20) > MA(60))'
|
|
923
|
+
* formula: '(CLOSE > MA(CLOSE, 20)) & (MA(CLOSE, 20) > MA(CLOSE, 60))'
|
|
924
924
|
* });
|
|
925
925
|
*
|
|
926
926
|
* // Fundamental screening (note: functions require parentheses)
|
|
@@ -965,7 +965,7 @@ declare class QuantModule {
|
|
|
965
965
|
*
|
|
966
966
|
* Variables vs Functions:
|
|
967
967
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME
|
|
968
|
-
* - Functions (
|
|
968
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
969
969
|
*
|
|
970
970
|
* @param params - Backtest parameters
|
|
971
971
|
* @returns Backtest results
|
|
@@ -977,7 +977,7 @@ declare class QuantModule {
|
|
|
977
977
|
* startDate: '2023-01-01',
|
|
978
978
|
* endDate: '2024-01-01',
|
|
979
979
|
* symbol: '000001',
|
|
980
|
-
* entryFormula: 'CROSS(MA(5), MA(20))', // Buy when MA5 crosses above MA20
|
|
980
|
+
* entryFormula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 20))', // Buy when MA5 crosses above MA20
|
|
981
981
|
* initialCash: 100000
|
|
982
982
|
* });
|
|
983
983
|
*
|
|
@@ -990,8 +990,8 @@ declare class QuantModule {
|
|
|
990
990
|
* startDate: '2023-01-01',
|
|
991
991
|
* endDate: '2024-01-01',
|
|
992
992
|
* symbol: '000001',
|
|
993
|
-
* entryFormula: 'CROSS(MA(5), MA(20))', // Buy signal
|
|
994
|
-
* exitFormula: 'CROSSDOWN(MA(5), MA(20))' // Sell signal
|
|
993
|
+
* entryFormula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 20))', // Buy signal
|
|
994
|
+
* exitFormula: 'CROSSDOWN(MA(CLOSE, 5), MA(CLOSE, 20))' // Sell signal
|
|
995
995
|
* });
|
|
996
996
|
*
|
|
997
997
|
* // Fundamental screening backtest (note: functions require parentheses)
|
|
@@ -1009,7 +1009,7 @@ declare class QuantModule {
|
|
|
1009
1009
|
* symbol: '000001',
|
|
1010
1010
|
* entryFormula: 'RSI(14) < 30',
|
|
1011
1011
|
* exitFormula: 'RSI(14) > 70',
|
|
1012
|
-
* labels: { rsi: 'RSI(14)', ma20: 'MA(20)' }
|
|
1012
|
+
* labels: { rsi: 'RSI(14)', ma20: 'MA(CLOSE, 20)' }
|
|
1013
1013
|
* });
|
|
1014
1014
|
* ```
|
|
1015
1015
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -800,7 +800,7 @@ declare class QuantModule {
|
|
|
800
800
|
/**
|
|
801
801
|
* Get list of available technical indicators
|
|
802
802
|
*
|
|
803
|
-
* All indicators are functions and require parentheses when used (e.g., MA(20), RSI(14), MACD()).
|
|
803
|
+
* All indicators are functions and require parentheses when used (e.g., MA(CLOSE, 20), RSI(14), MACD()).
|
|
804
804
|
*
|
|
805
805
|
* @returns Array of indicator definitions
|
|
806
806
|
*
|
|
@@ -819,7 +819,7 @@ declare class QuantModule {
|
|
|
819
819
|
*
|
|
820
820
|
* Variables vs Functions:
|
|
821
821
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME (aliases: C, O, H, L, V, VOL)
|
|
822
|
-
* - Functions (
|
|
822
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), RSI(14), MACD(), etc.
|
|
823
823
|
*
|
|
824
824
|
* @param params - Indicator computation parameters
|
|
825
825
|
* @returns Array of indicator data
|
|
@@ -851,7 +851,7 @@ declare class QuantModule {
|
|
|
851
851
|
*
|
|
852
852
|
* Variables vs Functions:
|
|
853
853
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME, PE_TTM, ROE_TTM, etc.
|
|
854
|
-
* - Functions (
|
|
854
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
855
855
|
*
|
|
856
856
|
* @returns Array of factor definitions organized by level
|
|
857
857
|
*/
|
|
@@ -863,7 +863,7 @@ declare class QuantModule {
|
|
|
863
863
|
*
|
|
864
864
|
* Variables vs Functions:
|
|
865
865
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME
|
|
866
|
-
* - Functions (
|
|
866
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
867
867
|
*
|
|
868
868
|
* @param params - Factor computation parameters
|
|
869
869
|
* @returns Array of factor data
|
|
@@ -885,7 +885,7 @@ declare class QuantModule {
|
|
|
885
885
|
* // Close above 20-day MA
|
|
886
886
|
* const data = await client.quant.computeFactors({
|
|
887
887
|
* symbols: ['000001'],
|
|
888
|
-
* formula: 'CLOSE > MA(20)'
|
|
888
|
+
* formula: 'CLOSE > MA(CLOSE, 20)'
|
|
889
889
|
* });
|
|
890
890
|
*
|
|
891
891
|
* // Fundamental factors (note: functions require parentheses)
|
|
@@ -901,7 +901,7 @@ declare class QuantModule {
|
|
|
901
901
|
*
|
|
902
902
|
* Variables vs Functions:
|
|
903
903
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME
|
|
904
|
-
* - Functions (
|
|
904
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
905
905
|
*
|
|
906
906
|
* @param params - Screening parameters
|
|
907
907
|
* @returns Array of stocks that passed the filter
|
|
@@ -915,12 +915,12 @@ declare class QuantModule {
|
|
|
915
915
|
*
|
|
916
916
|
* // Golden cross
|
|
917
917
|
* const stocks = await client.quant.screen({
|
|
918
|
-
* formula: 'CROSS(MA(5), MA(10))'
|
|
918
|
+
* formula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 10))'
|
|
919
919
|
* });
|
|
920
920
|
*
|
|
921
921
|
* // Uptrend
|
|
922
922
|
* const stocks = await client.quant.screen({
|
|
923
|
-
* formula: '(CLOSE > MA(20)) & (MA(20) > MA(60))'
|
|
923
|
+
* formula: '(CLOSE > MA(CLOSE, 20)) & (MA(CLOSE, 20) > MA(CLOSE, 60))'
|
|
924
924
|
* });
|
|
925
925
|
*
|
|
926
926
|
* // Fundamental screening (note: functions require parentheses)
|
|
@@ -965,7 +965,7 @@ declare class QuantModule {
|
|
|
965
965
|
*
|
|
966
966
|
* Variables vs Functions:
|
|
967
967
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME
|
|
968
|
-
* - Functions (
|
|
968
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
969
969
|
*
|
|
970
970
|
* @param params - Backtest parameters
|
|
971
971
|
* @returns Backtest results
|
|
@@ -977,7 +977,7 @@ declare class QuantModule {
|
|
|
977
977
|
* startDate: '2023-01-01',
|
|
978
978
|
* endDate: '2024-01-01',
|
|
979
979
|
* symbol: '000001',
|
|
980
|
-
* entryFormula: 'CROSS(MA(5), MA(20))', // Buy when MA5 crosses above MA20
|
|
980
|
+
* entryFormula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 20))', // Buy when MA5 crosses above MA20
|
|
981
981
|
* initialCash: 100000
|
|
982
982
|
* });
|
|
983
983
|
*
|
|
@@ -990,8 +990,8 @@ declare class QuantModule {
|
|
|
990
990
|
* startDate: '2023-01-01',
|
|
991
991
|
* endDate: '2024-01-01',
|
|
992
992
|
* symbol: '000001',
|
|
993
|
-
* entryFormula: 'CROSS(MA(5), MA(20))', // Buy signal
|
|
994
|
-
* exitFormula: 'CROSSDOWN(MA(5), MA(20))' // Sell signal
|
|
993
|
+
* entryFormula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 20))', // Buy signal
|
|
994
|
+
* exitFormula: 'CROSSDOWN(MA(CLOSE, 5), MA(CLOSE, 20))' // Sell signal
|
|
995
995
|
* });
|
|
996
996
|
*
|
|
997
997
|
* // Fundamental screening backtest (note: functions require parentheses)
|
|
@@ -1009,7 +1009,7 @@ declare class QuantModule {
|
|
|
1009
1009
|
* symbol: '000001',
|
|
1010
1010
|
* entryFormula: 'RSI(14) < 30',
|
|
1011
1011
|
* exitFormula: 'RSI(14) > 70',
|
|
1012
|
-
* labels: { rsi: 'RSI(14)', ma20: 'MA(20)' }
|
|
1012
|
+
* labels: { rsi: 'RSI(14)', ma20: 'MA(CLOSE, 20)' }
|
|
1013
1013
|
* });
|
|
1014
1014
|
* ```
|
|
1015
1015
|
*/
|
package/dist/index.js
CHANGED
|
@@ -663,7 +663,7 @@ var QuantModule = class {
|
|
|
663
663
|
/**
|
|
664
664
|
* Get list of available technical indicators
|
|
665
665
|
*
|
|
666
|
-
* All indicators are functions and require parentheses when used (e.g., MA(20), RSI(14), MACD()).
|
|
666
|
+
* All indicators are functions and require parentheses when used (e.g., MA(CLOSE, 20), RSI(14), MACD()).
|
|
667
667
|
*
|
|
668
668
|
* @returns Array of indicator definitions
|
|
669
669
|
*
|
|
@@ -684,7 +684,7 @@ var QuantModule = class {
|
|
|
684
684
|
*
|
|
685
685
|
* Variables vs Functions:
|
|
686
686
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME (aliases: C, O, H, L, V, VOL)
|
|
687
|
-
* - Functions (
|
|
687
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), RSI(14), MACD(), etc.
|
|
688
688
|
*
|
|
689
689
|
* @param params - Indicator computation parameters
|
|
690
690
|
* @returns Array of indicator data
|
|
@@ -728,7 +728,7 @@ var QuantModule = class {
|
|
|
728
728
|
*
|
|
729
729
|
* Variables vs Functions:
|
|
730
730
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME, PE_TTM, ROE_TTM, etc.
|
|
731
|
-
* - Functions (
|
|
731
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
732
732
|
*
|
|
733
733
|
* @returns Array of factor definitions organized by level
|
|
734
734
|
*/
|
|
@@ -742,7 +742,7 @@ var QuantModule = class {
|
|
|
742
742
|
*
|
|
743
743
|
* Variables vs Functions:
|
|
744
744
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME
|
|
745
|
-
* - Functions (
|
|
745
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
746
746
|
*
|
|
747
747
|
* @param params - Factor computation parameters
|
|
748
748
|
* @returns Array of factor data
|
|
@@ -764,7 +764,7 @@ var QuantModule = class {
|
|
|
764
764
|
* // Close above 20-day MA
|
|
765
765
|
* const data = await client.quant.computeFactors({
|
|
766
766
|
* symbols: ['000001'],
|
|
767
|
-
* formula: 'CLOSE > MA(20)'
|
|
767
|
+
* formula: 'CLOSE > MA(CLOSE, 20)'
|
|
768
768
|
* });
|
|
769
769
|
*
|
|
770
770
|
* // Fundamental factors (note: functions require parentheses)
|
|
@@ -789,7 +789,7 @@ var QuantModule = class {
|
|
|
789
789
|
*
|
|
790
790
|
* Variables vs Functions:
|
|
791
791
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME
|
|
792
|
-
* - Functions (
|
|
792
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
793
793
|
*
|
|
794
794
|
* @param params - Screening parameters
|
|
795
795
|
* @returns Array of stocks that passed the filter
|
|
@@ -803,12 +803,12 @@ var QuantModule = class {
|
|
|
803
803
|
*
|
|
804
804
|
* // Golden cross
|
|
805
805
|
* const stocks = await client.quant.screen({
|
|
806
|
-
* formula: 'CROSS(MA(5), MA(10))'
|
|
806
|
+
* formula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 10))'
|
|
807
807
|
* });
|
|
808
808
|
*
|
|
809
809
|
* // Uptrend
|
|
810
810
|
* const stocks = await client.quant.screen({
|
|
811
|
-
* formula: '(CLOSE > MA(20)) & (MA(20) > MA(60))'
|
|
811
|
+
* formula: '(CLOSE > MA(CLOSE, 20)) & (MA(CLOSE, 20) > MA(CLOSE, 60))'
|
|
812
812
|
* });
|
|
813
813
|
*
|
|
814
814
|
* // Fundamental screening (note: functions require parentheses)
|
|
@@ -883,7 +883,7 @@ var QuantModule = class {
|
|
|
883
883
|
*
|
|
884
884
|
* Variables vs Functions:
|
|
885
885
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME
|
|
886
|
-
* - Functions (
|
|
886
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
887
887
|
*
|
|
888
888
|
* @param params - Backtest parameters
|
|
889
889
|
* @returns Backtest results
|
|
@@ -895,7 +895,7 @@ var QuantModule = class {
|
|
|
895
895
|
* startDate: '2023-01-01',
|
|
896
896
|
* endDate: '2024-01-01',
|
|
897
897
|
* symbol: '000001',
|
|
898
|
-
* entryFormula: 'CROSS(MA(5), MA(20))', // Buy when MA5 crosses above MA20
|
|
898
|
+
* entryFormula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 20))', // Buy when MA5 crosses above MA20
|
|
899
899
|
* initialCash: 100000
|
|
900
900
|
* });
|
|
901
901
|
*
|
|
@@ -908,8 +908,8 @@ var QuantModule = class {
|
|
|
908
908
|
* startDate: '2023-01-01',
|
|
909
909
|
* endDate: '2024-01-01',
|
|
910
910
|
* symbol: '000001',
|
|
911
|
-
* entryFormula: 'CROSS(MA(5), MA(20))', // Buy signal
|
|
912
|
-
* exitFormula: 'CROSSDOWN(MA(5), MA(20))' // Sell signal
|
|
911
|
+
* entryFormula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 20))', // Buy signal
|
|
912
|
+
* exitFormula: 'CROSSDOWN(MA(CLOSE, 5), MA(CLOSE, 20))' // Sell signal
|
|
913
913
|
* });
|
|
914
914
|
*
|
|
915
915
|
* // Fundamental screening backtest (note: functions require parentheses)
|
|
@@ -927,7 +927,7 @@ var QuantModule = class {
|
|
|
927
927
|
* symbol: '000001',
|
|
928
928
|
* entryFormula: 'RSI(14) < 30',
|
|
929
929
|
* exitFormula: 'RSI(14) > 70',
|
|
930
|
-
* labels: { rsi: 'RSI(14)', ma20: 'MA(20)' }
|
|
930
|
+
* labels: { rsi: 'RSI(14)', ma20: 'MA(CLOSE, 20)' }
|
|
931
931
|
* });
|
|
932
932
|
* ```
|
|
933
933
|
*/
|
|
@@ -1711,7 +1711,7 @@ var Reportify = class {
|
|
|
1711
1711
|
headers: {
|
|
1712
1712
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1713
1713
|
"Content-Type": "application/json",
|
|
1714
|
-
"User-Agent": "reportify-sdk-js/0.3.
|
|
1714
|
+
"User-Agent": "reportify-sdk-js/0.3.4"
|
|
1715
1715
|
},
|
|
1716
1716
|
body: options.body ? JSON.stringify(options.body) : void 0,
|
|
1717
1717
|
signal: controller.signal
|
|
@@ -1772,7 +1772,7 @@ var Reportify = class {
|
|
|
1772
1772
|
headers: {
|
|
1773
1773
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1774
1774
|
"Content-Type": "application/json",
|
|
1775
|
-
"User-Agent": "reportify-sdk-typescript/0.3.
|
|
1775
|
+
"User-Agent": "reportify-sdk-typescript/0.3.4"
|
|
1776
1776
|
}
|
|
1777
1777
|
});
|
|
1778
1778
|
if (!response.ok) {
|
package/dist/index.mjs
CHANGED
|
@@ -621,7 +621,7 @@ var QuantModule = class {
|
|
|
621
621
|
/**
|
|
622
622
|
* Get list of available technical indicators
|
|
623
623
|
*
|
|
624
|
-
* All indicators are functions and require parentheses when used (e.g., MA(20), RSI(14), MACD()).
|
|
624
|
+
* All indicators are functions and require parentheses when used (e.g., MA(CLOSE, 20), RSI(14), MACD()).
|
|
625
625
|
*
|
|
626
626
|
* @returns Array of indicator definitions
|
|
627
627
|
*
|
|
@@ -642,7 +642,7 @@ var QuantModule = class {
|
|
|
642
642
|
*
|
|
643
643
|
* Variables vs Functions:
|
|
644
644
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME (aliases: C, O, H, L, V, VOL)
|
|
645
|
-
* - Functions (
|
|
645
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), RSI(14), MACD(), etc.
|
|
646
646
|
*
|
|
647
647
|
* @param params - Indicator computation parameters
|
|
648
648
|
* @returns Array of indicator data
|
|
@@ -686,7 +686,7 @@ var QuantModule = class {
|
|
|
686
686
|
*
|
|
687
687
|
* Variables vs Functions:
|
|
688
688
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME, PE_TTM, ROE_TTM, etc.
|
|
689
|
-
* - Functions (
|
|
689
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
690
690
|
*
|
|
691
691
|
* @returns Array of factor definitions organized by level
|
|
692
692
|
*/
|
|
@@ -700,7 +700,7 @@ var QuantModule = class {
|
|
|
700
700
|
*
|
|
701
701
|
* Variables vs Functions:
|
|
702
702
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME
|
|
703
|
-
* - Functions (
|
|
703
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
704
704
|
*
|
|
705
705
|
* @param params - Factor computation parameters
|
|
706
706
|
* @returns Array of factor data
|
|
@@ -722,7 +722,7 @@ var QuantModule = class {
|
|
|
722
722
|
* // Close above 20-day MA
|
|
723
723
|
* const data = await client.quant.computeFactors({
|
|
724
724
|
* symbols: ['000001'],
|
|
725
|
-
* formula: 'CLOSE > MA(20)'
|
|
725
|
+
* formula: 'CLOSE > MA(CLOSE, 20)'
|
|
726
726
|
* });
|
|
727
727
|
*
|
|
728
728
|
* // Fundamental factors (note: functions require parentheses)
|
|
@@ -747,7 +747,7 @@ var QuantModule = class {
|
|
|
747
747
|
*
|
|
748
748
|
* Variables vs Functions:
|
|
749
749
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME
|
|
750
|
-
* - Functions (
|
|
750
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
751
751
|
*
|
|
752
752
|
* @param params - Screening parameters
|
|
753
753
|
* @returns Array of stocks that passed the filter
|
|
@@ -761,12 +761,12 @@ var QuantModule = class {
|
|
|
761
761
|
*
|
|
762
762
|
* // Golden cross
|
|
763
763
|
* const stocks = await client.quant.screen({
|
|
764
|
-
* formula: 'CROSS(MA(5), MA(10))'
|
|
764
|
+
* formula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 10))'
|
|
765
765
|
* });
|
|
766
766
|
*
|
|
767
767
|
* // Uptrend
|
|
768
768
|
* const stocks = await client.quant.screen({
|
|
769
|
-
* formula: '(CLOSE > MA(20)) & (MA(20) > MA(60))'
|
|
769
|
+
* formula: '(CLOSE > MA(CLOSE, 20)) & (MA(CLOSE, 20) > MA(CLOSE, 60))'
|
|
770
770
|
* });
|
|
771
771
|
*
|
|
772
772
|
* // Fundamental screening (note: functions require parentheses)
|
|
@@ -841,7 +841,7 @@ var QuantModule = class {
|
|
|
841
841
|
*
|
|
842
842
|
* Variables vs Functions:
|
|
843
843
|
* - Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME
|
|
844
|
-
* - Functions (
|
|
844
|
+
* - Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
845
845
|
*
|
|
846
846
|
* @param params - Backtest parameters
|
|
847
847
|
* @returns Backtest results
|
|
@@ -853,7 +853,7 @@ var QuantModule = class {
|
|
|
853
853
|
* startDate: '2023-01-01',
|
|
854
854
|
* endDate: '2024-01-01',
|
|
855
855
|
* symbol: '000001',
|
|
856
|
-
* entryFormula: 'CROSS(MA(5), MA(20))', // Buy when MA5 crosses above MA20
|
|
856
|
+
* entryFormula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 20))', // Buy when MA5 crosses above MA20
|
|
857
857
|
* initialCash: 100000
|
|
858
858
|
* });
|
|
859
859
|
*
|
|
@@ -866,8 +866,8 @@ var QuantModule = class {
|
|
|
866
866
|
* startDate: '2023-01-01',
|
|
867
867
|
* endDate: '2024-01-01',
|
|
868
868
|
* symbol: '000001',
|
|
869
|
-
* entryFormula: 'CROSS(MA(5), MA(20))', // Buy signal
|
|
870
|
-
* exitFormula: 'CROSSDOWN(MA(5), MA(20))' // Sell signal
|
|
869
|
+
* entryFormula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 20))', // Buy signal
|
|
870
|
+
* exitFormula: 'CROSSDOWN(MA(CLOSE, 5), MA(CLOSE, 20))' // Sell signal
|
|
871
871
|
* });
|
|
872
872
|
*
|
|
873
873
|
* // Fundamental screening backtest (note: functions require parentheses)
|
|
@@ -885,7 +885,7 @@ var QuantModule = class {
|
|
|
885
885
|
* symbol: '000001',
|
|
886
886
|
* entryFormula: 'RSI(14) < 30',
|
|
887
887
|
* exitFormula: 'RSI(14) > 70',
|
|
888
|
-
* labels: { rsi: 'RSI(14)', ma20: 'MA(20)' }
|
|
888
|
+
* labels: { rsi: 'RSI(14)', ma20: 'MA(CLOSE, 20)' }
|
|
889
889
|
* });
|
|
890
890
|
* ```
|
|
891
891
|
*/
|
|
@@ -1669,7 +1669,7 @@ var Reportify = class {
|
|
|
1669
1669
|
headers: {
|
|
1670
1670
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1671
1671
|
"Content-Type": "application/json",
|
|
1672
|
-
"User-Agent": "reportify-sdk-js/0.3.
|
|
1672
|
+
"User-Agent": "reportify-sdk-js/0.3.4"
|
|
1673
1673
|
},
|
|
1674
1674
|
body: options.body ? JSON.stringify(options.body) : void 0,
|
|
1675
1675
|
signal: controller.signal
|
|
@@ -1730,7 +1730,7 @@ var Reportify = class {
|
|
|
1730
1730
|
headers: {
|
|
1731
1731
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1732
1732
|
"Content-Type": "application/json",
|
|
1733
|
-
"User-Agent": "reportify-sdk-typescript/0.3.
|
|
1733
|
+
"User-Agent": "reportify-sdk-typescript/0.3.4"
|
|
1734
1734
|
}
|
|
1735
1735
|
});
|
|
1736
1736
|
if (!response.ok) {
|